Rafael Espindola
50ce2f06de
Use references and simplify.
...
llvm-svn: 122405
2010-12-22 16:11:57 +00:00
Rafael Espindola
6bdb49ded8
Don't relax org or align. They change size as the relaxation happens, but they
...
are not actually relaxed. For example, a section with only alignments will never
needs relaxation.
llvm-svn: 122356
2010-12-21 20:35:18 +00:00
Daniel Dunbar
ff78eda678
MC/Mach-O: Shuffle enums a bit to make it harder to inadvertently use the wrong
...
type.
llvm-svn: 122334
2010-12-21 15:26:45 +00:00
Duncan Sands
d0eb6d39f8
Pull a few more simplifications out of instcombine (there are still
...
plenty left though!), in particular for multiplication.
llvm-svn: 122330
2010-12-21 14:00:22 +00:00
Rafael Espindola
98d93c5294
Layout one section until no relaxations are done and then move to the next
...
section.
This helps because in practice sections form a dag with debug sections pointing
to text sections. Finishing up the text sections first makes the debug section
relaxation trivial.
llvm-svn: 122314
2010-12-21 04:22:09 +00:00
Chris Lattner
3e5fbd74ed
rename MVT::Flag to MVT::Glue. "Flag" is a terrible name for
...
something that just glues two nodes together, even if it is
sometimes used for flags.
llvm-svn: 122310
2010-12-21 02:38:05 +00:00
Jakob Stoklund Olesen
4c278f82c8
Use IntEqClasses to compute connected components of live intervals.
...
llvm-svn: 122296
2010-12-21 00:48:17 +00:00
Jakob Stoklund Olesen
baee655c5e
Add ADT/IntEqClasses.h as a light-weight implementation of EquivalenceClasses.h.
...
This implementation already exists as ConnectedVNInfoEqClasses in
LiveInterval.cpp, and it seems to be generally useful to have a light-weight way
of forming equivalence classes of small integers.
IntEqClasses doesn't allow enumeration of the elements in a class.
llvm-svn: 122293
2010-12-21 00:04:46 +00:00
Owen Anderson
aa81496c76
Revert r122114 (CallbackVH observing use-list changes) because it caused severe slowdowns on the Linux self-host configuration.
...
llvm-svn: 122279
2010-12-20 22:28:03 +00:00
Bill Wendling
b0602a6b0f
This is still used and issuing an annoying warning. Don't deprecate something in
...
the library unless *all* uses have been converted over to the new form.
llvm-svn: 122267
2010-12-20 21:14:18 +00:00
Duncan Sands
a436cbe4bf
Add a new convenience pass for testing InstructionSimplify. Previously
...
it could only be tested indirectly, via instcombine, gvn or some other
pass that makes use of InstructionSimplify, which means that testcases
had to be carefully contrived to dance around any other transformations
that that pass did.
llvm-svn: 122264
2010-12-20 20:54:37 +00:00
Michael J. Spencer
7c3f1dc901
Fix spelling.
...
llvm-svn: 122244
2010-12-20 13:30:37 +00:00
Duncan Sands
70db5e7cb2
There is no need for isAssociative to take the type as an argument anymore.
...
llvm-svn: 122242
2010-12-20 13:10:23 +00:00
Duncan Sands
5a2ce5fbf7
Discourage people from using isWeakForLinker when they should be using
...
mayBeOverridden.
llvm-svn: 122241
2010-12-20 10:57:01 +00:00
Chris Lattner
f5bb590e2d
update comment.
...
llvm-svn: 122212
2010-12-20 00:56:59 +00:00
Nick Lewycky
21dcac2128
Use the new way of silencing this warning.
...
llvm-svn: 122195
2010-12-19 20:57:14 +00:00
Nick Lewycky
0de20af7ba
Add missing standard headers. Patch by Joerg Sonnenberger!
...
llvm-svn: 122193
2010-12-19 20:43:38 +00:00
Chris Lattner
94f24db6f0
add a version of IRBuilder::SetInsertPoint that takes an instruction.
...
llvm-svn: 122180
2010-12-19 19:16:22 +00:00
Chris Lattner
eff3af9d4e
remove dead header
...
llvm-svn: 122169
2010-12-19 04:49:11 +00:00
Michael J. Spencer
d3f7af5181
Support/PathV1: Clarify deprecation warning.
...
llvm-svn: 122159
2010-12-18 22:23:24 +00:00
Michael J. Spencer
ca93d8406d
Support/PathV1: Deprecate get{Basename,Dirname,Suffix}.
...
llvm-svn: 122157
2010-12-18 22:23:07 +00:00
Eric Christopher
8786aab475
Header warning patrol.
...
llvm-svn: 122152
2010-12-18 10:54:29 +00:00
Roman Divacky
71d29167ea
Add support for lexing single quotes like 'c'.
...
This fixed 8615.
llvm-svn: 122150
2010-12-18 08:56:37 +00:00
Owen Anderson
c15ab07cff
Revert r122143 through r122140, which collectively broke the LLVMC tests on
...
the buildbots.
llvm-svn: 122149
2010-12-18 07:37:18 +00:00
Rafael Espindola
b403e098a1
Merge isAbsolute into IsSymbolRefDifferenceFullyResolved.
...
llvm-svn: 122148
2010-12-18 06:27:54 +00:00
Rafael Espindola
8396dd0893
Remove the MCObjectFormat class.
...
llvm-svn: 122147
2010-12-18 05:37:28 +00:00
Michael J. Spencer
092b55542f
Support/PathV1: Clarify deprecation warning.
...
llvm-svn: 122143
2010-12-18 04:13:54 +00:00
Michael J. Spencer
4f63507d05
Support/PathV1: Deprecate get{Basename,Dirname,Suffix}.
...
llvm-svn: 122141
2010-12-18 04:13:36 +00:00
Rafael Espindola
5004f4a9b5
Revert 122011, 122012, 122013, 122023 adding back an important optimization.
...
I added a note, but suggestions on how to add a test are really welcome.
llvm-svn: 122138
2010-12-18 03:57:21 +00:00
Rafael Espindola
fdaae0d16f
Move some data to the TargetWriter.
...
llvm-svn: 122134
2010-12-18 03:27:34 +00:00
Michael J. Spencer
762a55b19f
Support/PathV1: Deprecate getLast.
...
llvm-svn: 122116
2010-12-18 00:19:10 +00:00
Owen Anderson
e663aeacf9
Add support to CallbackVH to receive notification when a Value's use-list changes.
...
llvm-svn: 122114
2010-12-18 00:07:15 +00:00
Jakob Stoklund Olesen
bf4550e3fb
Pass a Banner argument to the machine code verifier both from
...
createMachineVerifierPass and MachineFunction::verify.
The banner is printed before the machine code dump, just like the printer pass.
llvm-svn: 122113
2010-12-18 00:06:56 +00:00
Jakob Stoklund Olesen
cf846100d8
Avoid dereferencing end() in collectInterferingVRegs() when there is no
...
interference.
llvm-svn: 122108
2010-12-17 23:16:38 +00:00
Jakob Stoklund Olesen
1740e00104
Enable loop splitting in RegAllocGreedy.
...
The heuristics split around the largest loop where the current register may be
allocated without interference.
llvm-svn: 122106
2010-12-17 23:16:32 +00:00
Bill Wendling
3fff1fd49b
During local stack slot allocation, the materializeFrameBaseRegister function
...
may be called. If the entry block is empty, the insertion point iterator will be
the "end()" value. Calling ->getParent() on it (among others) causes problems.
Modify materializeFrameBaseRegister to take the machine basic block and insert
the frame base register at the beginning of that block. (It's very similar to
what the code does all ready. The only difference is that it will always insert
at the beginning of the entry block instead of after a previous materialization
of the frame base register. I doubt that that matters here.)
<rdar://problem/8782198>
llvm-svn: 122104
2010-12-17 23:09:14 +00:00
Jakob Stoklund Olesen
00b29fbdec
Add more checks to IntervalMapOverlaps::advance() to ensure that advanceTo sees
...
monotonic keys.
llvm-svn: 122093
2010-12-17 22:07:54 +00:00
Jakob Stoklund Olesen
54912ed921
It is allowed to call IntervalMap::const_iterator::advanceTo() with a key that
...
moves the iterator to end(), and it is valid to call it on end().
That means it is valid to call advanceTo() with any monotonic key sequence.
llvm-svn: 122092
2010-12-17 22:07:51 +00:00
Michael J. Spencer
01a984023d
Fix 80 col.
...
llvm-svn: 122089
2010-12-17 21:32:47 +00:00
Michael J. Spencer
559e09e39d
Support/Path: Deprecate PathV1::isAbsolute.
...
llvm-svn: 122086
2010-12-17 21:21:31 +00:00
Jakob Stoklund Olesen
213de04d75
Fix crash when IntervalMapOverlaps::advanceTo moves past the last overlap.
...
llvm-svn: 122081
2010-12-17 19:18:38 +00:00
Benjamin Kramer
292b44baea
Pass StringRefs by value, for consistency.
...
llvm-svn: 122074
2010-12-17 18:19:06 +00:00
Jakob Stoklund Olesen
38b6d494d5
Add MachineLoopRange comparators for sorting loop lists by number and by area.
...
llvm-svn: 122073
2010-12-17 18:13:52 +00:00
Rafael Espindola
6b5e56c2b1
Stub out explicit MCELFObjectTargetWriter interface.
...
llvm-svn: 122067
2010-12-17 17:45:22 +00:00
Michael J. Spencer
93febde321
Support: Rename Path.h to PathV1.h and add a new Path.h that includes both V1 and V2.
...
llvm-svn: 122065
2010-12-17 17:22:36 +00:00
Rafael Espindola
f0e24d426a
Move createELFObjectWriter to its own header.
...
llvm-svn: 122064
2010-12-17 16:59:53 +00:00
Chris Lattner
d14b0f1db7
improve switch formation to handle small range
...
comparisons formed by comparisons. For example,
this:
void foo(unsigned x) {
if (x == 0 || x == 1 || x == 3 || x == 4 || x == 6)
bar();
}
compiles into:
_foo: ## @foo
## BB#0: ## %entry
cmpl $6, %edi
ja LBB0_2
## BB#1: ## %entry
movl %edi, %eax
movl $91, %ecx
btq %rax, %rcx
jb LBB0_3
instead of:
_foo: ## @foo
## BB#0: ## %entry
cmpl $2, %edi
jb LBB0_4
## BB#1: ## %switch.early.test
cmpl $6, %edi
ja LBB0_3
## BB#2: ## %switch.early.test
movl %edi, %eax
movl $88, %ecx
btq %rax, %rcx
jb LBB0_4
This catches a bunch of cases in GCC, which look like this:
%804 = load i32* @which_alternative, align 4, !tbaa !0
%805 = icmp ult i32 %804, 2
%806 = icmp eq i32 %804, 3
%or.cond121 = or i1 %805, %806
%807 = icmp eq i32 %804, 4
%or.cond124 = or i1 %or.cond121, %807
br i1 %or.cond124, label %.thread, label %808
turning this into a range comparison.
llvm-svn: 122045
2010-12-17 06:20:15 +00:00
Daniel Dunbar
2ee6c9b8c9
MC/Mach-O: On second thought, use a custom hook for enabling aggressive
...
IsSymbolRefDifferenceFullyResolved, it turns out this does change behavior on
enough cases for x86-32 that I would rather wait a bit on it.
- In practice, we will want to change this eventually because it only means we
generate less relocations (it also eliminates the need for the horrible
'.set' hack that Darwin requires in some places).
llvm-svn: 122042
2010-12-17 05:50:29 +00:00
Daniel Dunbar
f2adf782ab
MC/ObjectWriter: Add a new IsSymbolRefDifferenceFullyResolved target format specific hook.
...
- Currently just has stub implementations for Mach-O, ELF, and COFF.
llvm-svn: 122037
2010-12-17 04:54:54 +00:00
Jakob Stoklund Olesen
9c7f3a46d8
Provide LiveIntervalUnion::Query::checkLoopInterference.
...
This is a three-way interval list intersection between a virtual register, a
live interval union, and a loop. It will be used to identify interference-free
loops for live range splitting.
llvm-svn: 122034
2010-12-17 04:09:47 +00:00
Daniel Dunbar
50269280f8
MC/Assembler: Strip out object writer arguments, now that it is always available
...
-- and remove FIXME asking for the same!
llvm-svn: 122032
2010-12-17 02:45:59 +00:00
Daniel Dunbar
42a037abb1
MC/Assembler: Make the MCObjectWriter available through the lifetime of the
...
assembler.
llvm-svn: 122031
2010-12-17 02:45:41 +00:00
Daniel Dunbar
d2867f13a0
MC/Target: Remove HasScatteredSymbols target hook variable, which has been
...
superceded and was effectively dead.
llvm-svn: 122024
2010-12-17 02:06:08 +00:00
Daniel Dunbar
e491ea4630
MC/Expr: Simplify.
...
llvm-svn: 122023
2010-12-17 02:05:45 +00:00
Daniel Dunbar
f89156da92
MC: Remove another dead MCAssembler argument, and update clients.
...
llvm-svn: 122013
2010-12-17 01:07:35 +00:00
Daniel Dunbar
f15aeb8d01
MC: Remove dead MCAssembler argument -- Rafael, can you check the FIXME I added
...
here?
llvm-svn: 122012
2010-12-17 01:07:31 +00:00
Daniel Dunbar
218a3f2441
Fix 80-col viola.
...
llvm-svn: 122010
2010-12-17 01:07:25 +00:00
Jakob Stoklund Olesen
af49e9774a
Add basic test exposing many bugs.
...
llvm-svn: 121995
2010-12-16 19:46:09 +00:00
Daniel Dunbar
03fcccbb47
MC/Mach-O: Lift some MachObjectWriter arguments into the target specific
...
interface.
llvm-svn: 121981
2010-12-16 17:21:02 +00:00
Daniel Dunbar
8888a9604d
MC/Mach-O: Stub out explicit MCMachObjectTargetWriter interface.
...
llvm-svn: 121973
2010-12-16 16:09:19 +00:00
Daniel Dunbar
73b8713d7c
MC/Mach-O: Move createMachObjectWriter into MCMachObjectWriter.h.
...
llvm-svn: 121971
2010-12-16 16:08:33 +00:00
Michael J. Spencer
39a0ffc394
MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> via an out parm.
...
llvm-svn: 121958
2010-12-16 03:29:14 +00:00
Daniel Dunbar
0c9d9fdd81
MC: Move target specific fixup info descriptors to TargetAsmBackend instead of
...
the MCCodeEmitter, which seems like a better organization.
- Also, cleaned up some magic constants while in the area.
llvm-svn: 121953
2010-12-16 03:20:06 +00:00
Daniel Dunbar
ecd0c8a557
MC: Make TargetAsmBackend available to the AsmStreamer.
...
- Treaty talks on the non-proliferation of MC objects broke down.
llvm-svn: 121949
2010-12-16 03:05:59 +00:00
Daniel Dunbar
c2be9a9630
MC: Split MCFixupKindInfo out into its own header.
...
llvm-svn: 121948
2010-12-16 03:05:53 +00:00
Daniel Dunbar
001e2ef549
MC: Remove a FIXME I no longer agree with.
...
llvm-svn: 121947
2010-12-16 03:05:46 +00:00
Jakob Stoklund Olesen
6e47260a8b
Add IntervalMapOverlaps - An iterator for overlapping intervals in two
...
IntervalMaps.
The IntervalMaps can have different template parameters, but the KeyT and Traits
types must be the same.
Tests are forthcoming.
llvm-svn: 121935
2010-12-16 01:18:29 +00:00
Jakob Stoklund Olesen
5e97781386
Add MachineLoopRanges analysis.
...
A MachineLoopRange contains the intervals of slot indexes covered by the blocks
in a loop. This representation of the loop blocks is more efficient to compare
against interfering registers during register coalescing.
llvm-svn: 121917
2010-12-15 23:41:23 +00:00
Rafael Espindola
50baf9d984
Typo.
...
llvm-svn: 121906
2010-12-15 22:33:06 +00:00
Bob Wilson
fa27a8621c
Add Neon VCVT instructions for f32 <-> f16 conversions.
...
Clang is now providing intrinsics for these and so we need to support them
in the backend. Radar 8068427.
llvm-svn: 121902
2010-12-15 22:14:12 +00:00
Jakob Stoklund Olesen
c7f6d79450
Add SlotIndexes::getMBBRange() to get the range of a basic block in a single
...
lookup.
llvm-svn: 121893
2010-12-15 20:40:22 +00:00
Wesley Peck
1ee1d63649
Adding target specific calling conventions to support the MBlaze GCC function
...
attributes "interrupt_handle" and "save_volatiles". Support for lowering these
correctly will be in an upcoming commit.
llvm-svn: 121888
2010-12-15 20:14:09 +00:00
Dan Gohman
a4fcd2418d
Move Value::getUnderlyingObject to be a standalone
...
function so that it can live in Analysis instead of
VMCore.
llvm-svn: 121885
2010-12-15 20:02:24 +00:00
Owen Anderson
622ad5170b
Implement cleanups suggested by Daniel.
...
llvm-svn: 121875
2010-12-15 18:48:27 +00:00
Duncan Sands
0a2c416894
Move Sub simplifications and additional Add simplifications out of
...
instcombine and into InstructionSimplify.
llvm-svn: 121861
2010-12-15 14:07:39 +00:00
Rafael Espindola
844f6b6cfb
Relax alignment fragments.
...
With this we don't need the EffectiveSize field anymore. Without that field
LayoutFragment only updates offsets and we don't need to invalidate the
current fragment when it is relaxed (only the ones following it).
This is also a very small improvement in the accuracy of the layout info as
we now use the after relaxation size immediately.
llvm-svn: 121857
2010-12-15 08:45:53 +00:00
Rafael Espindola
f80f18a11a
Generalize an assert.
...
llvm-svn: 121851
2010-12-15 07:12:24 +00:00
Jakob Stoklund Olesen
757f0e37ea
Introduce TargetRegisterInfo::getOverlaps(Reg), returning a list of all
...
registers that alias Reg, including itself. This is almost the same as the
existing getAliasSet() method, except for the inclusion of Reg.
The name matches the reflexive TRI::regsOverlap(x, y) relation.
It is very common to do stuff to a register and all its aliases:
stuff(Reg)
for (const unsigned *Alias = TRI->getAliasSet(Reg); *Alias; ++Alias)
stuff(*Alias);
That can now be written as the simpler:
for (const unsigned *Alias = TRI->getOverlaps(Reg); *Alias; ++Alias)
stuff(*Alias);
This change requires a bit more constant space for the alias lists because Reg
is included and because the empty alias list cannot be shared any longer.
If the getAliasSet method is eventually removed, this space can be reclaimed by
sharing overlap lists. For instance, %rax and %eax have identical overlap sets.
llvm-svn: 121800
2010-12-14 23:03:42 +00:00
Jakob Stoklund Olesen
2dd1ee5fd5
Add TargetRegisterInfo::printReg() to pretty-print registers.
...
llvm-svn: 121780
2010-12-14 18:53:39 +00:00
Jim Grosbach
41955ff958
ARM Fixups relative to thumb functions need to have the low bit of the value
...
set for interworking to work properly. rdar://8755956
llvm-svn: 121778
2010-12-14 18:46:57 +00:00
Chris Lattner
afd2a8cfbb
remove the dead (and terrible) llvm::RemoveSuccessor function.
...
llvm-svn: 121753
2010-12-14 06:51:55 +00:00
Jakob Stoklund Olesen
a97a954364
Remove debugging code.
...
llvm-svn: 121738
2010-12-14 00:37:52 +00:00
Dan Gohman
4bd64fa805
Introduce a new PartialAlias response for AliasAnalysis. For most
...
AliasAnalysis consumers, PartialAlias will be treated as MayAlias.
For AliasAnalysis chaining, MayAlias says "procede to the next analysis".
PartialAlias will be used to indicate that the query should terminate,
even though it didn't reach MustAlias or NoAlias.
llvm-svn: 121507
2010-12-10 19:38:58 +00:00
Rafael Espindola
0a017a6db2
Fixed version of 121434 with no new memory leaks.
...
llvm-svn: 121471
2010-12-10 07:39:47 +00:00
Daniel Dunbar
ede0e9b585
Mach-O/ARM: Add relocation type enumeration.
...
llvm-svn: 121467
2010-12-10 06:19:49 +00:00
Daniel Dunbar
7bfb872d3d
Mach-O: Tweak field name.
...
llvm-svn: 121465
2010-12-10 06:19:39 +00:00
Nick Lewycky
565fa9c7dc
Remove dead header.
...
llvm-svn: 121463
2010-12-10 05:12:54 +00:00
Rafael Espindola
a945a34c73
Revert my previous patch to make the valgrind bots happy.
...
llvm-svn: 121461
2010-12-10 04:01:09 +00:00
Rafael Espindola
56eb741237
Initial support for the cfi directives. This is just enough to get
...
f:
.cfi_startproc
nop
.cfi_endproc
assembled (on ELF).
llvm-svn: 121434
2010-12-09 23:48:29 +00:00
Owen Anderson
3ef19d9d48
Fix an issue in some Thumb fixups, where the effective PC address needs to be 4-byte aligned when calculating
...
the offset. Add a new fixup flag to represent this, and use it for the one fixups that I have a testcase for needing
this. It's quite likely that the other Thumb fixups will need this too, and to have their fixup encoding logic
adjusted accordingly.
llvm-svn: 121408
2010-12-09 20:27:52 +00:00
Michael J. Spencer
db97c0b520
Fix whitespace.
...
llvm-svn: 121382
2010-12-09 17:37:32 +00:00
Michael J. Spencer
751e9aafa9
Support: Move c_str from SmallVector back to SmallString and add a free standing
...
templated c_str in Windows.h to replace it.
llvm-svn: 121381
2010-12-09 17:37:18 +00:00
Michael J. Spencer
730f51ad96
Support/FileSystem: Change file_status predicate functions that cannot fail to
...
return their result instead of an error_code. Also add some missing predicate
functions.
llvm-svn: 121380
2010-12-09 17:37:02 +00:00
Michael J. Spencer
7b6fef82d4
Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with error_code &ec. And fix clients.
...
llvm-svn: 121379
2010-12-09 17:36:48 +00:00
Lang Hames
ce333073af
Fixed some dependencies in RegAllocPBQP.h . Thanks to Borja Ferrer for pointing out this issue.
...
llvm-svn: 121292
2010-12-08 22:15:32 +00:00
Devang Patel
b68c6231e9
Add support to create debug info for functions and methods.
...
llvm-svn: 121281
2010-12-08 20:42:44 +00:00
Devang Patel
81c3c87717
Add support to create class type.
...
llvm-svn: 121279
2010-12-08 20:18:20 +00:00
Andrew Trick
00067fb147
Generalize PostRAHazardRecognizer so it can be used in any pass for
...
both forward and backward scheduling. Rename it to
ScoreboardHazardRecognizer (Scoreboard is one word). Remove integer
division from the scoreboard's critical path.
llvm-svn: 121274
2010-12-08 20:04:29 +00:00
Jakob Stoklund Olesen
b8812a1c15
Stub out RegAllocGreedy.
...
This new register allocator is initially identical to RegAllocBasic, but it will
receive all of the tricks that RegAllocBasic won't get.
RegAllocGreedy will eventually replace linear scan.
llvm-svn: 121234
2010-12-08 03:26:16 +00:00
Devang Patel
89ea4f27a8
Add support to create vector, array, enums etc...
...
llvm-svn: 121224
2010-12-08 01:50:15 +00:00