Chris Lattner
2a991268f7
don't rely on ADL
...
llvm-svn: 35299
2007-03-24 17:37:03 +00:00
Evan Cheng
b7051f596a
Adjust offset to compensate for big endian machines.
...
llvm-svn: 35293
2007-03-24 00:02:43 +00:00
Evan Cheng
a883b58caf
Make sure SEXTLOAD of the specific type is supported on the target.
...
llvm-svn: 35289
2007-03-23 22:13:36 +00:00
Evan Cheng
e2f5f24e8e
Also replace uses of SRL if that's also folded during ReduceLoadWidth().
...
llvm-svn: 35286
2007-03-23 20:55:21 +00:00
Evan Cheng
a824e79f06
A couple of bug fixes for reducing load width xform:
...
1. Address offset is in bytes.
2. Make sure truncate node uses are replaced with new load.
llvm-svn: 35274
2007-03-23 02:16:52 +00:00
Dan Gohman
dcb291faa4
Change uses of Function::front to Function::getEntryBlock for readability.
...
llvm-svn: 35265
2007-03-22 16:38:57 +00:00
Evan Cheng
464dc9b74c
More opportunities to reduce load size.
...
llvm-svn: 35254
2007-03-22 01:54:19 +00:00
Evan Cheng
a20815e157
Fix for PR1257. Bug in live range shortening as a result of copy coalescing
...
where the destination is dead.
llvm-svn: 35252
2007-03-22 01:26:05 +00:00
Dale Johannesen
0c6bb5eab7
repair x86 performance, dejagnu problems from previous change
...
llvm-svn: 35245
2007-03-21 21:51:52 +00:00
Evan Cheng
d63baead9b
fold (truncate (srl (load x), c)) -> (smaller load (x+c/vt bits))
...
llvm-svn: 35239
2007-03-21 20:14:05 +00:00
Evan Cheng
3578dd61c6
Potential spiller improvement.
...
llvm-svn: 35228
2007-03-20 22:22:38 +00:00
Dale Johannesen
bacf4acf65
do not share old induction variables when this would result in invalid
...
instructions (that would have to be split later)
llvm-svn: 35227
2007-03-20 21:54:54 +00:00
Dale Johannesen
d05a1a2ade
maintain LiveIn when splitting blocks (register scavenging needs it)
...
llvm-svn: 35226
2007-03-20 21:35:06 +00:00
Jeff Cohen
1baf5c84ab
Fix some VC++ warnings.
...
llvm-svn: 35224
2007-03-20 20:43:18 +00:00
Lauro Ramos Venancio
971aa18867
Code clean up.
...
llvm-svn: 35220
2007-03-20 20:09:03 +00:00
Evan Cheng
550cf0369c
Minor bug.
...
llvm-svn: 35219
2007-03-20 19:32:11 +00:00
Lauro Ramos Venancio
25878b45f5
CopyToReg source operand can be a physical register.
...
llvm-svn: 35213
2007-03-20 16:46:44 +00:00
Evan Cheng
0e3278e505
First cut trivial re-materialization support.
...
llvm-svn: 35208
2007-03-20 08:13:50 +00:00
Evan Cheng
25d00d545d
Remove -reduce-joining-phys-regs options. Make it on by default.
...
llvm-svn: 35165
2007-03-19 18:08:26 +00:00
Evan Cheng
c5e74f6404
Minor bug fix.
...
llvm-svn: 35153
2007-03-19 04:22:35 +00:00
Evan Cheng
d8f2e4fe4c
- Merge UsedBlocks info after two virtual registers are coalesced.
...
- Use distance to closest use to determine whether to abort coalescing.
llvm-svn: 35141
2007-03-18 09:05:55 +00:00
Evan Cheng
5382426577
Keep UsedBlocks info accurate.
...
llvm-svn: 35140
2007-03-18 09:02:31 +00:00
Evan Cheng
f6f043332f
Track the BB's where each virtual register is used.
...
llvm-svn: 35135
2007-03-17 09:29:54 +00:00
Evan Cheng
7b2a001669
Joining a live interval of a physical register with a virtual one can turn out
...
to be really bad. Once they are joined they are not broken apart. Also, physical
intervals cannot be spilled!
Added a heuristic as a workaround for this. Be careful coalescing with a
physical register if the virtual register uses are "far". Check if there are
uses in the same loop as the source (copy instruction). Check if it is in the
loop preheader, etc.
llvm-svn: 35134
2007-03-17 09:27:35 +00:00
Evan Cheng
a2465dfc07
Use SmallSet instead of std::set.
...
llvm-svn: 35133
2007-03-17 08:53:30 +00:00
Evan Cheng
be22235790
If sdisel has decided to sink GEP index expression into any BB. Replace all uses
...
in that BB.
llvm-svn: 35132
2007-03-17 08:22:49 +00:00
Evan Cheng
c5bc763f50
Turn on GEP index sinking by default.
...
llvm-svn: 35127
2007-03-16 18:32:30 +00:00
Evan Cheng
0a9d0cabaf
Stupid bug.
...
llvm-svn: 35126
2007-03-16 17:50:20 +00:00
Evan Cheng
009ea54262
Sink a binary expression into its use blocks if it is a loop invariant
...
computation used as GEP indexes and if the expression can be folded into
target addressing mode of GEP load / store use types.
llvm-svn: 35123
2007-03-16 08:46:27 +00:00
Evan Cheng
a2a2fd1e55
Added isLegalAddressExpression hook to test if the given expression can be
...
folded into target addressing mode for the given type.
llvm-svn: 35121
2007-03-16 08:42:32 +00:00
Evan Cheng
88de94a4fb
Debugging output stuff.
...
llvm-svn: 35117
2007-03-15 21:19:28 +00:00
Evan Cheng
b9e3db67fb
Estimate a cost using the possible number of scratch registers required and use
...
it as a late BURR scheduling tie-breaker.
Intuitively, it's good to push down instructions whose results are liveout so
their long live ranges won't conflict with other values which are needed inside
the BB. Further prioritize liveout instructions by the number of operands which
are calculated within the BB.
llvm-svn: 35109
2007-03-14 22:43:40 +00:00
Evan Cheng
2874855302
Try schedule def + use closer whne Sethi-Ullman numbers are the same.
...
e.g.
t1 = op t2, c1
t3 = op t4, c2
and the following instructions are both ready.
t2 = op c3
t4 = op c4
Then schedule t2 = op first.
i.e.
t4 = op c4
t2 = op c3
t1 = op t2, c1
t3 = op t4, c2
This creates more short live intervals which work better with the register
allocator.
llvm-svn: 35089
2007-03-13 23:25:11 +00:00
Evan Cheng
b7004fd889
More flexible TargetLowering LSR hooks for testing whether an immediate is a legal target address immediate or scale.
...
llvm-svn: 35076
2007-03-12 23:37:10 +00:00
Evan Cheng
df7949a8d0
If a virtual register is already marked alive in this block, that means it is
...
alive in one of the successor block. Do not add it to the kill list.
llvm-svn: 35041
2007-03-09 09:48:56 +00:00
Evan Cheng
9bc8d4b6f2
Print preds / succs BB numbers.
...
llvm-svn: 35040
2007-03-09 08:29:08 +00:00
Evan Cheng
91b0790297
Avoid variable shadowing.
...
llvm-svn: 35039
2007-03-09 06:02:17 +00:00
Chris Lattner
ce8aba03ee
implement support for floating point constants used as inline asm memory operands.
...
llvm-svn: 35033
2007-03-08 22:29:47 +00:00
Chris Lattner
b7bc3f2d30
make this fail even in non-assert builds.
...
llvm-svn: 35025
2007-03-08 07:07:03 +00:00
Anton Korobeynikov
ed4b303c10
Refactoring of formal parameter flags. Enable properly use of
...
zext/sext/aext stuff.
llvm-svn: 35008
2007-03-07 16:25:09 +00:00
Anton Korobeynikov
dd6ce6900e
Cleanup: make SetCounter an instance variable
...
llvm-svn: 35007
2007-03-07 08:25:02 +00:00
Evan Cheng
8a1d09d079
Avoid combining indexed load further.
...
llvm-svn: 35005
2007-03-07 08:07:03 +00:00
Anton Korobeynikov
942fda027f
Fix DWARF debugging information on x86/Linux and (hopefully)
...
Mingw32/Cygwin targets. This fixes PR978
llvm-svn: 35000
2007-03-07 02:47:57 +00:00
Evan Cheng
24f65cc91e
Minor bug fix.
...
llvm-svn: 34985
2007-03-06 21:58:15 +00:00
Devang Patel
b0743b5d6a
Now LoopStrengthReduce is a LoopPass.
...
llvm-svn: 34984
2007-03-06 21:14:09 +00:00
Chris Lattner
13780ac7db
big endian 32-bit systems (e.g. ppc32) want to return the high reg first, not
...
the lo-reg first. This is fallout from my ppc calling conv change yesterday,
it fixes test/ExecutionEngine/2003-05-06-LivenessClobber.llx
llvm-svn: 34983
2007-03-06 20:01:06 +00:00
Anton Korobeynikov
6c5e0ad71c
Small eye-candy: use asciz directive everywhere, where possible.
...
llvm-svn: 34981
2007-03-06 19:25:02 +00:00
Evan Cheng
c1b21857a4
If target decides to create an emergency spill slot, make sure it's closest to SP or frame pointer.
...
llvm-svn: 34965
2007-03-06 10:02:38 +00:00
Evan Cheng
372c2c69f8
Register scavenger is now capable of scavenging. It spills a register whose use of furthest away to make it available.
...
llvm-svn: 34964
2007-03-06 10:01:25 +00:00
Anton Korobeynikov
f0b9316552
Enumerate SDISel formal parameter attributes. Make use of new
...
enumeration.
llvm-svn: 34960
2007-03-06 06:10:33 +00:00
Jeff Cohen
b622c11f77
Unbreak VC++ build.
...
llvm-svn: 34917
2007-03-05 00:00:42 +00:00
Chris Lattner
47206667c0
fold away addc nodes when we know there cannot be a carry-out.
...
llvm-svn: 34913
2007-03-04 20:40:38 +00:00
Chris Lattner
2dcc6e7f58
generalize
...
llvm-svn: 34910
2007-03-04 20:08:45 +00:00
Chris Lattner
e2e13caeb2
canonicalize constants to the RHS of addc/adde. If nothing uses the carry out of
...
addc, turn it into add.
This allows us to compile:
long long test(long long A, unsigned B) {
return (A + ((long long)B << 32)) & 123;
}
into:
_test:
movl $123, %eax
andl 4(%esp), %eax
xorl %edx, %edx
ret
instead of:
_test:
xorl %edx, %edx
movl %edx, %eax
addl 4(%esp), %eax ;; add of zero
andl $123, %eax
ret
llvm-svn: 34909
2007-03-04 20:03:15 +00:00
Chris Lattner
362621c7ae
eliminate some ops if they have an undef RHS
...
llvm-svn: 34908
2007-03-04 20:01:46 +00:00
Reid Spencer
b8825b8c04
Remove unneeded header file.
...
llvm-svn: 34903
2007-03-04 04:41:04 +00:00
Chris Lattner
ca401aac31
Fix CodeGen/Generic/fpowi-promote.ll and PR1239
...
llvm-svn: 34893
2007-03-03 23:43:21 +00:00
Chris Lattner
567b9254cd
Add an expand action for ISD label which just deletes the label.
...
This "fixes" PR1238.
llvm-svn: 34890
2007-03-03 19:21:38 +00:00
Evan Cheng
d74cb0e194
Only propagate IsKill if the last use is a kill.
...
llvm-svn: 34878
2007-03-03 06:32:37 +00:00
Nate Begeman
323cf8f602
http://llvm.org/bugs/show_bug.cgi?id=1237
...
llvm-svn: 34875
2007-03-03 06:18:18 +00:00
Evan Cheng
3fd728596e
Watch out for cases like this:
...
entry (0x8b056f0, LLVM BB @0x8b01b30, ID#0):
Live Ins: %r0 %r1 %r2 %r3
%reg1032 = tMOVrr %r3<kill>
%reg1033 = tMOVri8 1
%reg1034 = tMOVri8 0
tCMPi8 %reg1029<kill>, 0
tBcc mbb<entry,0x8b06a10>, 0
Successors according to CFG: 0x8b06980 0x8b06a10
entry (0x8b06980, LLVM BB @0x8b01b30, ID#12):
Predecessors according to CFG: 0x8b056f0
%reg1036 = tMOVrr %reg1034<kill>
Successors according to CFG: 0x8b06a10
entry (0x8b06a10, LLVM BB @0x8b01b30, ID#13):
Predecessors according to CFG: 0x8b056f0 0x8b06980
%reg1024<dead> = tMOVrr %reg1030<kill>
...
reg1030 and r1 have already been joined. When reg1024 and reg1030 are joined,
r1 live range from function entry to the tMOVrr instruction are dead. Eliminate
r1 from the livein set of the entry BB, not the BB where the copy is.
llvm-svn: 34866
2007-03-03 02:18:00 +00:00
Evan Cheng
155ede21e0
Mark dead def as unused.
...
llvm-svn: 34844
2007-03-02 10:43:16 +00:00
Evan Cheng
9d615d1e70
Dead live-in detection bug.
...
llvm-svn: 34843
2007-03-02 10:41:15 +00:00
Evan Cheng
6605c5dbee
- Keep track all def and uses of stack slot available in register.
...
- Available value use may be deleted (e.g. noop move).
llvm-svn: 34841
2007-03-02 08:52:00 +00:00
Evan Cheng
08f2f0d145
Invalidate last use of a reused register if the use is a deleted noop copy.
...
llvm-svn: 34839
2007-03-02 05:41:42 +00:00
Jim Laskey
82af5943d1
Emit eh filter info.
...
llvm-svn: 34805
2007-03-01 20:26:43 +00:00
Jim Laskey
6458e6acb9
Collect eh filter info.
...
llvm-svn: 34804
2007-03-01 20:25:32 +00:00
Jim Laskey
d5453d7b56
Lower eh filter intrinsic.
...
llvm-svn: 34802
2007-03-01 20:24:30 +00:00
Evan Cheng
105fb1e0dd
Delete register scavenger when done with it.
...
llvm-svn: 34786
2007-03-01 10:23:33 +00:00
Evan Cheng
27bc565497
Add a version of FindUnusedReg that restrict search to a specific set of registers.
...
llvm-svn: 34784
2007-03-01 08:56:24 +00:00
Evan Cheng
d6450ba1dc
A restore is promoted to copy (or deleted entirely), remove the kill from the last use of the targetted register.
...
llvm-svn: 34773
2007-03-01 02:27:30 +00:00
Evan Cheng
31215d1395
Interface clean up.
...
llvm-svn: 34772
2007-03-01 02:25:51 +00:00
Evan Cheng
428eaa0059
Interface clean up.
...
llvm-svn: 34770
2007-03-01 02:19:39 +00:00
Evan Cheng
9be123c568
Oops.
...
llvm-svn: 34768
2007-03-01 02:05:35 +00:00
Evan Cheng
8a703ad4b6
Track all joined registers and eliminate unneeded kills after all joining are done.
...
llvm-svn: 34767
2007-03-01 02:03:03 +00:00
Jim Laskey
644af6b68f
Chain is on second operand.
...
llvm-svn: 34759
2007-02-28 20:43:58 +00:00
Jim Laskey
c46bf3577d
Handle mix of personalities.
...
llvm-svn: 34752
2007-02-28 18:38:31 +00:00
Jim Laskey
c114990526
Provide a more meaningful name.
...
llvm-svn: 34751
2007-02-28 18:37:50 +00:00
Jim Laskey
cf465fcebc
MERGE_VALUES unnecessary.
...
llvm-svn: 34750
2007-02-28 18:37:04 +00:00
Nate Begeman
37dc4b5bb3
Fix a typo, thanks Bill!
...
llvm-svn: 34741
2007-02-28 09:16:38 +00:00
Nate Begeman
e0232ec706
More Mach-O writer improvements.
...
llvm-svn: 34740
2007-02-28 07:40:50 +00:00
Chris Lattner
74bb92902e
add methods for analysis of call results and return nodes.
...
llvm-svn: 34738
2007-02-28 07:09:40 +00:00
Chris Lattner
e74744143f
add methods to analyze calls and formals.
...
llvm-svn: 34736
2007-02-28 06:56:37 +00:00
Chris Lattner
b5582bf984
add a newline at end of file
...
llvm-svn: 34735
2007-02-28 06:42:11 +00:00
Evan Cheng
e8af69632f
Make requiresRegisterScavenging determination on a per MachineFunction basis.
...
llvm-svn: 34711
2007-02-28 00:59:19 +00:00
Evan Cheng
589ba3964b
MRegisterInfo disowns RegScavenger. It's immutable.
...
llvm-svn: 34706
2007-02-28 00:17:36 +00:00
Evan Cheng
a7e4b60b85
Some more code clean up.
...
llvm-svn: 34700
2007-02-27 22:58:43 +00:00
Evan Cheng
8a8dc04e7e
Oops.
...
llvm-svn: 34698
2007-02-27 22:10:52 +00:00
Evan Cheng
e50a994cba
Let MRegisterInfo now owns RegScavenger.
...
llvm-svn: 34691
2007-02-27 21:10:33 +00:00
Evan Cheng
51f54640de
RegScavenger interface change to make it more flexible.
...
llvm-svn: 34690
2007-02-27 21:09:48 +00:00
Chris Lattner
9f059194a7
Minor refactoring of CC Lowering interfaces
...
llvm-svn: 34656
2007-02-27 05:13:54 +00:00
Chris Lattner
dc3adc83e7
move CC Lowering stuff to its own public interface
...
llvm-svn: 34655
2007-02-27 04:43:02 +00:00
Evan Cheng
ca25c0ee0d
forward() should not increment internal iterator. Its client may insert instruction between now and next forward() call.
...
llvm-svn: 34649
2007-02-27 01:58:48 +00:00
Evan Cheng
bdec83e4d2
Joining an interval with a dead copy instruction. Shorten the live range to the last use.
...
llvm-svn: 34645
2007-02-26 21:37:37 +00:00
Chris Lattner
fce448f856
Fold (sext (truncate x)) more aggressively, by avoiding creation of a
...
sextinreg if not needed. This is useful in two cases: before legalize,
it avoids creating a sextinreg that will be trivially removed. After legalize
if the target doesn't support sextinreg, the trunc/sext would not have been
removed before.
llvm-svn: 34621
2007-02-26 03:13:59 +00:00
Chris Lattner
ab5d0ac02c
track signedness of formal argument, though we have a fixme here.
...
llvm-svn: 34620
2007-02-26 02:56:58 +00:00
Jim Laskey
14059d958a
Fix for PR1224.
...
llvm-svn: 34610
2007-02-25 21:43:59 +00:00
Chris Lattner
8c504cf9a0
optimize duplicate ValueMap lookups
...
llvm-svn: 34599
2007-02-25 18:40:32 +00:00
Evan Cheng
38fd9b074f
A couple of more places where a register liveness has been extended and its last kill should be updated accordingly.
...
llvm-svn: 34597
2007-02-25 09:51:27 +00:00
Evan Cheng
fb2333a333
Add an assertion.
...
llvm-svn: 34596
2007-02-25 09:47:31 +00:00
Evan Cheng
0577b51538
Fix a couple of bugs related IsDead back propagation during coalescing.
...
llvm-svn: 34595
2007-02-25 09:46:31 +00:00
Evan Cheng
e54eb80720
If the liveinterval of the source instruction has been extended, remove the IsKill marker.
...
llvm-svn: 34594
2007-02-25 09:41:59 +00:00
Evan Cheng
220a7af107
Only add liveinterval to livein set if it isn't assigned a stack slot.
...
llvm-svn: 34593
2007-02-25 09:39:02 +00:00
Chris Lattner
387f464121
fold trivial token factor nodes. This allows us to compile
...
test/CodeGen/X86/fp-stack-ret.ll into:
movl 4(%esp), %eax
fldl (%eax)
ret
instead of:
subl $12, %esp
movl 16(%esp), %eax
movsd (%eax), %xmm0
movsd %xmm0, (%esp)
fldl (%esp)
addl $12, %esp
ret
by eliminating a token factor that blocked a check.
llvm-svn: 34584
2007-02-25 08:24:27 +00:00
Chris Lattner
168c5856bf
initialize a instance variable
...
llvm-svn: 34567
2007-02-25 01:28:05 +00:00
Jim Laskey
e1d1c0590f
Deal with cases when MMI is not requested.
...
llvm-svn: 34556
2007-02-24 09:45:44 +00:00
Jim Laskey
b869ab6f31
Drop unused operand.
...
llvm-svn: 34555
2007-02-24 09:44:17 +00:00
Chris Lattner
d7ef3f804d
Fix CodeGen/Generic/2007-02-23-DAGCombine-Miscompile.ll and PR1219
...
llvm-svn: 34551
2007-02-24 02:09:29 +00:00
Evan Cheng
520b20d3b7
Reuse extends the liveness of a register. Transfer the kill to the operand that reuse it.
...
llvm-svn: 34536
2007-02-23 21:47:50 +00:00
Jim Laskey
31fef788eb
Handle improper cast.
...
llvm-svn: 34535
2007-02-23 21:45:01 +00:00
Evan Cheng
97cc93841d
Handle cases when joining live intervals of two virtual registers.
...
llvm-svn: 34534
2007-02-23 20:40:13 +00:00
Evan Cheng
584e051c28
Mark livein registers as being in used.
...
llvm-svn: 34525
2007-02-23 08:41:19 +00:00
Evan Cheng
f7e320c9e0
A spill kills the register being stored. But it is later being reused by spiller, its live range has to be extended.
...
llvm-svn: 34517
2007-02-23 01:13:26 +00:00
Evan Cheng
1e56453585
First potential client of register scavenger.
...
llvm-svn: 34516
2007-02-23 01:11:26 +00:00
Evan Cheng
9965aebd5d
Use findRegisterUseOperand to find a kill of particular register.
...
llvm-svn: 34512
2007-02-23 01:04:26 +00:00
Evan Cheng
956fdeb694
Initial check in of register scavenger. Its only current functionality is tracking live registers per MBB.
...
llvm-svn: 34511
2007-02-23 01:01:19 +00:00
Evan Cheng
cc607daac1
Remove unnecessary isKill properties if a live range has been lengthened due to coalescing.
...
llvm-svn: 34503
2007-02-22 23:03:39 +00:00
Jim Laskey
5cbb4262ab
Update comment.
...
llvm-svn: 34502
2007-02-22 18:51:19 +00:00
Jim Laskey
66aa84d12f
Missing end of abbreviations - correction
...
llvm-svn: 34501
2007-02-22 18:48:52 +00:00
Jim Laskey
4e3d2b9acc
Missing end of abbreviations.
...
llvm-svn: 34500
2007-02-22 18:22:42 +00:00
Jim Laskey
3e3a65b764
Need to init.
...
llvm-svn: 34499
2007-02-22 18:04:49 +00:00
Jim Laskey
9df1a1d8d8
Remove isAccessable.
...
llvm-svn: 34497
2007-02-22 16:39:03 +00:00
Jim Laskey
69bd45c1d2
Use exception flag.
...
llvm-svn: 34496
2007-02-22 16:22:15 +00:00
Jim Laskey
46dbe12b32
Remove assertion.
...
llvm-svn: 34494
2007-02-22 16:12:17 +00:00
Jim Laskey
44c37e7dbf
Tighten up error checking of args.
...
llvm-svn: 34493
2007-02-22 16:10:05 +00:00
Jim Laskey
504e99479c
Handle lowering invoke to call correctly.
...
llvm-svn: 34492
2007-02-22 15:38:06 +00:00
Jim Laskey
7f5872c455
Simplify lowering and selection of exception ops.
...
llvm-svn: 34491
2007-02-22 15:37:19 +00:00
Jim Laskey
4b37a4c712
Selection and lowering for exception handling.
...
llvm-svn: 34481
2007-02-21 22:53:45 +00:00
Jim Laskey
09953e6482
Exception handling support.
...
llvm-svn: 34479
2007-02-21 22:48:45 +00:00
Jim Laskey
18fc09723c
Add support for changes in DwarfWriter.
...
llvm-svn: 34478
2007-02-21 22:47:38 +00:00
Jim Laskey
2dc5245c4a
Make branch folding behave in the presence of landing pads.
...
llvm-svn: 34476
2007-02-21 22:42:20 +00:00
Jim Laskey
5b2b7c1024
Allow for live in registers for eh landing pads.
...
llvm-svn: 34475
2007-02-21 22:41:17 +00:00
Jim Laskey
88dd2fd332
Add structures used for collecting eh information.
...
llvm-svn: 34473
2007-02-21 22:38:31 +00:00
Evan Cheng
e563c7eb27
Out of bound reference.
...
llvm-svn: 34461
2007-02-21 02:27:39 +00:00
Evan Cheng
de037a821a
Use BitVector instead. No functionality change.
...
llvm-svn: 34460
2007-02-21 02:22:03 +00:00
Evan Cheng
61cd0914ed
Dead code.
...
llvm-svn: 34435
2007-02-20 01:29:10 +00:00
Evan Cheng
f7ed82da10
Re-apply my liveintervalanalysis changes. Now with PR1207 fixes.
...
llvm-svn: 34428
2007-02-19 21:49:54 +00:00
Reid Spencer
da81bf4d3e
For PR1207:
...
Revert patches that caused the problem. Evan, please investigate and reapply
when you've discovered the problem.
llvm-svn: 34399
2007-02-19 03:20:00 +00:00
Evan Cheng
2605082f0e
- Changes how function livein's are handled, they now have a start index of 0.
...
- When coalescing a copy MI, if its destination is "dead", propagate the
property to the source MI's destination if there are no intervening uses.
- Detect dead function live-in's and remove them.
llvm-svn: 34383
2007-02-17 11:15:40 +00:00
Evan Cheng
a3d3599210
Do not add livein's to entry MBB twice.
...
llvm-svn: 34382
2007-02-17 11:11:27 +00:00
Evan Cheng
41d2a1d8bf
Added removeLiveIn.
...
llvm-svn: 34381
2007-02-17 11:10:48 +00:00
Evan Cheng
6accd480a2
Added findRegisterDefOperand().
...
llvm-svn: 34380
2007-02-17 11:10:18 +00:00
Evan Cheng
ef932b067d
- Use MRegister::regsOverlap().
...
- Allow LiveVariables to track liveness of more registers.
llvm-svn: 34379
2007-02-17 11:09:47 +00:00
Chris Lattner
56e5fea163
print target nodes nicely
...
llvm-svn: 34369
2007-02-17 06:38:37 +00:00
Chris Lattner
a9f917af59
Implement i/n/s constraints correctly. This fixes
...
test/CodeGen/PowerPC/2007-02-16-InlineAsmNConstraint.ll
llvm-svn: 34368
2007-02-17 06:00:35 +00:00
Dale Johannesen
12920dda9e
Fixes PR 1200
...
llvm-svn: 34359
2007-02-17 00:44:34 +00:00
Evan Cheng
66cb162f92
Print <dead> def operands.
...
llvm-svn: 34343
2007-02-16 09:49:18 +00:00
Evan Cheng
7238410766
Add live-ins to every BB.
...
llvm-svn: 34342
2007-02-16 09:05:02 +00:00
Dale Johannesen
915e15481e
test commit (blank line)
...
llvm-svn: 34337
2007-02-16 01:54:53 +00:00
Chris Lattner
68dcec6fea
fix indentation
...
llvm-svn: 34307
2007-02-15 18:19:15 +00:00
Chris Lattner
21ebae3394
Apply B Scott Michel's patch for PR1184, which improves diagnostics in an
...
abort case.
llvm-svn: 34306
2007-02-15 18:17:56 +00:00
Evan Cheng
14edd1989b
Use BitVector instead of vector<bool> which can be extremely slow.
...
llvm-svn: 34302
2007-02-15 05:59:24 +00:00
Reid Spencer
09575bac2e
For PR1195:
...
Change use of "packed" term to "vector" in comments, strings, variable
names, etc.
llvm-svn: 34300
2007-02-15 03:39:18 +00:00
Reid Spencer
d84d35ba70
For PR1195:
...
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.
llvm-svn: 34293
2007-02-15 02:26:10 +00:00
Chris Lattner
ab1812f806
fix a warning
...
llvm-svn: 34272
2007-02-14 07:34:56 +00:00
Chris Lattner
1cf84d2745
Refix CodeGen/Generic/switch-lower.ll. In contrast to my previous patch,
...
this doesn't miscompile lots of programs :)
llvm-svn: 34268
2007-02-14 07:18:16 +00:00
Chris Lattner
945e437c65
Generalize TargetData strings, to support more interesting forms of data.
...
Patch by Scott Michel.
llvm-svn: 34266
2007-02-14 05:52:17 +00:00
Chris Lattner
59b27fa371
implement expand of truncate. This allows truncates from i128 to i64 to
...
be supported on 32-bit hosts.
llvm-svn: 34257
2007-02-13 23:55:16 +00:00
Chris Lattner
d08d31f68a
Fix PR1198, by adding initial i128 support. Patch by Dan Gohman.
...
llvm-svn: 34256
2007-02-13 23:41:38 +00:00
Chris Lattner
2fbff4d2dc
revert my previous switch lowering change, which miscompiles a few programs.
...
This will break a dj test until I have time to investigate.
llvm-svn: 34247
2007-02-13 20:09:07 +00:00
Lauro Ramos Venancio
abde3cc16c
Add a space between // and the comment.
...
llvm-svn: 34244
2007-02-13 18:10:13 +00:00
Lauro Ramos Venancio
9956dcffbe
Add "original alignment" to function arguments flags.
...
llvm-svn: 34240
2007-02-13 13:50:08 +00:00
Chris Lattner
6ea07f178c
eliminate vector-related allocations
...
llvm-svn: 34223
2007-02-13 06:01:22 +00:00
Evan Cheng
b612316f20
Allow any MachineBasicBlock (not just the entry block) to have live-in physical
...
registers. Make sure liveinterval analysis is correctly creating live ranges
for them.
llvm-svn: 34217
2007-02-13 01:30:55 +00:00
Chris Lattner
9056bae3be
Fix switch lowering to order cases in zext order, which is how we emit the
...
comparisons. This fixes an infinite loop on CodeGen/Generic/switch-lower.ll
and PR1197
llvm-svn: 34216
2007-02-13 01:05:56 +00:00
Chris Lattner
83dfca816c
eliminate temporary vectors.
...
llvm-svn: 34161
2007-02-10 20:31:59 +00:00
Chris Lattner
b84892d2d2
encapsulate the rest of the StructLayout members.
...
llvm-svn: 34157
2007-02-10 19:59:22 +00:00
Chris Lattner
c473d8e431
Privatize StructLayout::MemberOffsets, adding an accessor
...
llvm-svn: 34156
2007-02-10 19:55:17 +00:00
Evan Cheng
276b44b0f9
Add function live-ins to entry block live-in set.
...
llvm-svn: 34112
2007-02-10 02:43:39 +00:00
Evan Cheng
bcf1d7faef
Add live-ins to MachineBasicBlock.
...
llvm-svn: 34111
2007-02-10 02:38:19 +00:00
Evan Cheng
de6083463d
Rename some variables to avoid confusion with SelectionDAGISel::BB.
...
llvm-svn: 34110
2007-02-10 01:08:18 +00:00
Evan Cheng
93049457ee
Make use of TLI.SimplifySetCC() in LegalizeSetCCOperands().
...
llvm-svn: 34066
2007-02-08 22:16:19 +00:00
Evan Cheng
92658d5648
Move SimplifySetCC to TargetLowering and allow it to be shared with legalizer.
...
llvm-svn: 34065
2007-02-08 22:13:59 +00:00
Evan Cheng
6ad6fdb70b
Fixed a long standing spiller bug that's exposed by Thumb:
...
The code sequence before the spiller is something like:
= tMOVrr
%reg1117 = tMOVrr
%reg1078 = tLSLri %reg1117, 2
The it starts spilling:
%r0 = tRestore <fi#5>, 0
%r1 = tRestore <fi#7>, 0
%r1 = tMOVrr %r1<kill>
tSpill %r1, <fi#5>, 0
%reg1078 = tLSLri %reg1117, 2
It restores the value while processing the first tMOVrr. At this point, the
spiller remembers fi#5 is available in %r0. Next it processes the second move.
It restores the source before the move and spills the result afterwards. The
move becomes a noop and is deleted. However, a spill has been inserted and that
should invalidate reuse of %r0 for fi#5 and add reuse of %r1 for fi#5.
Therefore, %reg1117 (which is also assigned fi#5) should get %r1, not %r0.
llvm-svn: 34039
2007-02-08 06:04:54 +00:00
Bill Wendling
523048ecde
Split the addPassesToEmitFile method up into two. This is so that we can
...
do some common stuff, then on our own add an object file writer (by calling
a concrete function), and then do some finishing stuff, if need be.
llvm-svn: 34032
2007-02-08 01:36:53 +00:00
Bill Wendling
3c4d37a531
Add function to create a file writer.
...
llvm-svn: 34031
2007-02-08 01:35:27 +00:00
Bill Wendling
860ce1b82e
Moved from include/llvm/CodeGen to lib/CodeGen.
...
llvm-svn: 34027
2007-02-08 01:30:50 +00:00
Nate Begeman
3cc886add8
Fix a fixme by correctly calculating preferred alignments for functions,
...
based on the alignment of the symbol and the target data's preferred align
for that type.
Also, rename some arguments for consistency.
llvm-svn: 33984
2007-02-07 05:47:16 +00:00
Chris Lattner
dc0a9a7b4a
Two fixes:
...
1. Memset takes an i32 for the value to set, not i8. This was causing GCC to
ICE all over the place (PR1183).
2. memcpy/memmove were not properly zext/trunc'ing the size in some cases.
llvm-svn: 33970
2007-02-06 19:06:38 +00:00
Chris Lattner
1b4b054cba
Fix PR1181 and CodeGen/CBackend/2007-02-05-memset.ll
...
llvm-svn: 33957
2007-02-06 06:07:51 +00:00
Chris Lattner
89e66e0c26
Oops, swap this. This fixes a regression I introduced in the ARM backend.
...
llvm-svn: 33946
2007-02-06 01:56:31 +00:00
Chris Lattner
a9428c4f9d
Fix PR1178
...
llvm-svn: 33924
2007-02-05 21:23:52 +00:00
Anton Korobeynikov
465c0253c3
Fixing silly "not-implemented" bug in AsmPrinter. This fixes PR1169.
...
llvm-svn: 33888
2007-02-04 23:27:42 +00:00
Chris Lattner
19083a4671
switch the VRBaseMap in the scheduler from an std::map to a DenseMap. This
...
speeds up the isel pass from 2.5570s to 2.4722s on kc++ (3.4%).
llvm-svn: 33879
2007-02-04 08:47:20 +00:00
Chris Lattner
9af2c86bc8
Introduce new UnarySDNode/BinarySDNode/TernarySDNode nodes, which coallocate
...
their operands with the node itself. This reduces malloc traffic for operand
lists. This reduces isel time on kc++ from 2.6164 to 2.5570s, about 2.3%.
llvm-svn: 33878
2007-02-04 08:35:21 +00:00
Chris Lattner
22639f3d90
eliminate the SDNode::setValueTypes method.
...
llvm-svn: 33876
2007-02-04 07:37:24 +00:00
Chris Lattner
f17b4222e2
eliminate a bunch of duplicate ctors and helper functions.
...
llvm-svn: 33875
2007-02-04 07:28:00 +00:00
Chris Lattner
edfc7e5fa2
move MorphNode to out of line and merge setNodeOperands into it. There is
...
no behavior or performance change here.
llvm-svn: 33869
2007-02-04 02:49:29 +00:00
Chris Lattner
3bf17b6fa5
simplify MorphNodeTo to take a VTList operand.
...
llvm-svn: 33868
2007-02-04 02:41:42 +00:00
Chris Lattner
486edfbc6f
eliminate some extraneous methods in SDNode
...
llvm-svn: 33867
2007-02-04 02:32:44 +00:00
Chris Lattner
20754cc579
Give each selectiondag node class a home for it's vtable and rtti info
...
llvm-svn: 33866
2007-02-04 02:23:32 +00:00
Chris Lattner
289aa4495c
Switch VAlueMap from std::map to DenseMap.
...
llvm-svn: 33863
2007-02-04 01:35:11 +00:00
Chris Lattner
79084305ee
Switch NodeMap from std::map to DenseMap, this speeds up isel by 2.3%
...
llvm-svn: 33862
2007-02-04 01:31:47 +00:00
Chris Lattner
94c44c96d3
swtich vector-> smallvector, speeding up selectiondag stuff 1%
...
llvm-svn: 33861
2007-02-04 01:20:02 +00:00
Chris Lattner
4b0ddb22e9
Switch promoted/expanded ops over to using a DenseMap. Vector related maps
...
aren't worth it.
llvm-svn: 33860
2007-02-04 01:17:38 +00:00
Chris Lattner
ed39c86176
switch LegalizedNodes from std::map to a DenseMap. This speeds up isel
...
time as a whole on kc++ by 11%.
llvm-svn: 33857
2007-02-04 00:50:02 +00:00
Chris Lattner
ebeb48d4bc
Eliminate some malloc traffic from LegalizeAllNodesNotLeadingTo, speeding
...
up isel on kimwitu by 0.7%.
llvm-svn: 33853
2007-02-04 00:27:56 +00:00
Chris Lattner
cba058ce51
Eliminate some std::sets. This speeds up isel of kimwitu by about 0.9%
...
llvm-svn: 33852
2007-02-04 00:24:41 +00:00
Chris Lattner
feec7137ce
Switch SelectionDAG::ReplaceAllUsesOfValueWith to use a SmallSetVector for
...
the users set (most nodes have 1 or 2 users). This speeds up the isel pass
3.2% on kimwitu.
llvm-svn: 33849
2007-02-04 00:14:31 +00:00
Bill Wendling
c27c70dc3d
Pass in non-Mach-O-specific parameters to the GetTargetRelocation method.
...
llvm-svn: 33816
2007-02-03 02:39:40 +00:00
Chris Lattner
0a30b1f00f
switch the sched unit map over to use a DenseMap instead of std::map. This
...
speeds up isel as a whole time by 2.6%.
llvm-svn: 33810
2007-02-03 01:34:13 +00:00
Chris Lattner
e83030b9c8
Switch ComputeTopDownOrdering over to using a densemap. This speeds up
...
isel as a whole by 3.3%.
llvm-svn: 33809
2007-02-03 01:12:36 +00:00
Evan Cheng
f309d13677
Pasto
...
llvm-svn: 33806
2007-02-03 00:43:46 +00:00
Reid Spencer
5dc84cdab7
Use short form of BinaryOperator create function.
...
llvm-svn: 33784
2007-02-02 14:09:34 +00:00
Reid Spencer
2341c22ec7
Changes to support making the shift instructions be true BinaryOperators.
...
This feature is needed in order to support shifts of more than 255 bits
on large integer types. This changes the syntax for llvm assembly to
make shl, ashr and lshr instructions look like a binary operator:
shl i32 %X, 1
instead of
shl i32 %X, i8 1
Additionally, this should help a few passes perform additional optimizations.
llvm-svn: 33776
2007-02-02 02:16:23 +00:00
Jim Laskey
f970221c4d
Slip up
...
llvm-svn: 33758
2007-02-01 17:48:20 +00:00
Jim Laskey
894ceb1c6f
Emit labels as label_n and not as debug_n
...
llvm-svn: 33757
2007-02-01 17:46:10 +00:00
Jim Laskey
c3de9b4b14
Support for non-landing pad exception handling.
...
llvm-svn: 33755
2007-02-01 16:31:34 +00:00
Anton Korobeynikov
1b4e6015b4
Fixed uninitialized stuff inside LegalizeDAG. Fortunately, the only
...
affected part is codegen of "memove" inside x86 backend. This fixes
PR1144
llvm-svn: 33752
2007-02-01 08:39:52 +00:00
Chris Lattner
1003dc72b4
rename DenseMap to IndexedMap.
...
llvm-svn: 33749
2007-02-01 05:32:05 +00:00
Chris Lattner
296a83cefb
Fit in 80 columns
...
llvm-svn: 33745
2007-02-01 04:55:59 +00:00
Chris Lattner
e3eeb24a86
Emit a better assertion message for PR1133
...
llvm-svn: 33736
2007-02-01 01:21:12 +00:00
Evan Cheng
53026f1d5a
Allow the target to override the ISD::CondCode that's to be used to test the
...
result of the comparison libcall against zero.
llvm-svn: 33701
2007-01-31 09:29:11 +00:00
Reid Spencer
5301e7c605
For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid
...
confusion with external linkage types.
llvm-svn: 33663
2007-01-30 20:08:39 +00:00
Chris Lattner
d27f95e08d
add initial support for handling inline asms with multiple constraints.
...
This doesn't do the "right thing" but will probably work in most cases.
This implements CodeGen/PowerPC/2007-01-29-lbrx-asm.ll.
llvm-svn: 33643
2007-01-29 23:45:14 +00:00
Jim Laskey
ee23de6c36
Out of line function.
...
llvm-svn: 33641
2007-01-29 23:40:33 +00:00
Jim Laskey
3f9f250928
Only gather frame info if debug or eh.
...
llvm-svn: 33639
2007-01-29 23:20:22 +00:00
Nate Begeman
eda5997cc8
Finish off bug 680, allowing targets to custom lower frame and return
...
address nodes.
llvm-svn: 33636
2007-01-29 22:58:52 +00:00
Nate Begeman
2a562ba47b
Properly support cstrings
...
llvm-svn: 33629
2007-01-29 21:20:42 +00:00
Jim Laskey
d1154860a4
Flag to control exception handling.
...
llvm-svn: 33628
2007-01-29 20:48:32 +00:00
Jim Laskey
18c3b5267d
Disable zero landing pads for now.
...
llvm-svn: 33625
2007-01-29 20:01:41 +00:00
Jim Laskey
b4a2f05d1c
Landing pad-less eh for PPC.
...
llvm-svn: 33622
2007-01-29 18:51:14 +00:00
Reid Spencer
d7035b654b
Use TargetData to obtain the correct size of the "size_t" argument for
...
functions like memcpy, memmove and memset. Ensure only one prototype is
used for these functions and that it matches the system definition by
using the appropriate type for the size argument.
llvm-svn: 33618
2007-01-29 17:42:06 +00:00
Reid Spencer
c7765617d2
For PR1138:
...
Force memcpy to be the 32-bit variant. Since this is only used with
CBE and lli which both target 32-bit machines, this should be okay.
llvm-svn: 33608
2007-01-28 22:28:00 +00:00
Anton Korobeynikov
06f7d4bec7
Arguments are counting from 1. not from 0. Maybe we should change
...
numbering somehow? E.g. make return argument the last?
llvm-svn: 33606
2007-01-28 18:01:49 +00:00
Anton Korobeynikov
9fa3839d29
More cleanup
...
llvm-svn: 33605
2007-01-28 16:04:40 +00:00
Anton Korobeynikov
037c867b54
Propagate changes from my local tree. This patch includes:
...
1. New parameter attribute called 'inreg'. It has meaning "place this
parameter in registers, if possible". This is some generalization of
gcc's regparm(n) attribute. It's currently used only in X86-32 backend.
2. Completely rewritten CC handling/lowering code inside X86 backend.
Merged stdcall + c CCs and fastcall + fast CC.
3. Dropped CSRET CC. We cannot add struct return variant for each
target-specific CC (e.g. stdcall + csretcc and so on).
4. Instead of CSRET CC introduced 'sret' parameter attribute. Setting in
on first attribute has meaning 'This is hidden pointer to structure
return. Handle it gently'.
5. Fixed small bug in llvm-extract + add new feature to
FunctionExtraction pass, which relinks all internal-linkaged callees
from deleted function to external linkage. This will allow further
linking everything together.
NOTEs: 1. Documentation will be updated soon.
2. llvm-upgrade should be improved to translate csret => sret.
Before this, there will be some unexpected test fails.
llvm-svn: 33597
2007-01-28 13:31:35 +00:00
Bill Wendling
3814e72ed1
Use TargetELFWriterInfo class.
...
llvm-svn: 33573
2007-01-27 02:55:44 +00:00
Nate Begeman
f209495e93
Handle multiple functions, properly mangle symbols, and fix support for
...
scattered relocations.
llvm-svn: 33555
2007-01-26 22:39:48 +00:00
Jim Laskey
5a1df9748b
rename files
...
llvm-svn: 33552
2007-01-26 21:38:26 +00:00
Jim Laskey
c56315c2b5
Change the MachineDebugInfo to MachineModuleInfo to better reflect usage
...
for debugging and exception handling.
llvm-svn: 33550
2007-01-26 21:22:28 +00:00
Jim Laskey
f9e5445ed4
Make LABEL a builtin opcode.
...
llvm-svn: 33537
2007-01-26 14:34:52 +00:00
Jim Laskey
f773e14547
Clarify some constants.
...
llvm-svn: 33536
2007-01-26 14:19:17 +00:00
Evan Cheng
ae4ea45eaf
Added a MRegisterInfo hook that tells PEI the target is responsible for
...
rounding the stack frame to a multiple of stack alignment.
llvm-svn: 33504
2007-01-25 22:12:41 +00:00
Jim Laskey
ee132b5fce
1. Remove dwarf-verbose option (now asm-verbose.)
...
2. Clean up end of lines.
llvm-svn: 33499
2007-01-25 15:45:58 +00:00
Jim Laskey
1c055e8d14
Migrate print routines to asm to be shared by exception handling.
...
llvm-svn: 33498
2007-01-25 15:12:02 +00:00
Jim Laskey
f6c63fec92
Repair debug frames as a prelude to eh_frames. Switched to using MachineMoves
...
by value so that clean up is less confusing (these vectors tend to be small.)
llvm-svn: 33488
2007-01-24 18:45:13 +00:00
Jim Laskey
f6487ec894
Use asm printer to emit alignment
...
llvm-svn: 33485
2007-01-24 13:12:32 +00:00
Bill Wendling
06a03210af
Make ivars private and use getters. Have the MachOWriter return "Mach-O
...
Writer" for the pass name.
llvm-svn: 33483
2007-01-24 07:13:56 +00:00
Evan Cheng
f5c96fabf9
Renamed getTypeAlignmentShift() to getPreferredTypeAlignmentShift().
...
llvm-svn: 33482
2007-01-24 07:03:39 +00:00
Bill Wendling
4905a473e8
Use the TargetMachOWriterInfo class to get this information.
...
llvm-svn: 33478
2007-01-24 03:38:47 +00:00
Evan Cheng
6730e12ae4
PEI is now responsible for adding MaxCallFrameSize to frame size and align the stack. Each target can further adjust the frame size if necessary.
...
llvm-svn: 33460
2007-01-23 09:38:11 +00:00
Chris Lattner
199818475b
Switch this to use SmallSet to avoid mallocs in the common case.
...
llvm-svn: 33457
2007-01-23 00:59:48 +00:00
Chris Lattner
d39e38848b
Fix a bunch of inline asm failures
...
llvm-svn: 33454
2007-01-23 00:36:17 +00:00
Evan Cheng
be48a47d9d
Remove the DoubleTy special case.
...
llvm-svn: 33449
2007-01-22 23:13:55 +00:00
Reid Spencer
2eadb5310d
For PR970:
...
Clean up handling of isFloatingPoint() and dealing with PackedType.
Patch by Gordon Henriksen!
llvm-svn: 33415
2007-01-21 00:29:26 +00:00
Chris Lattner
50ee0e40e5
Teach TargetData to handle 'preferred' alignment for each target, and use
...
these alignment amounts to align scalars when we can. Patch by Scott Michel!
llvm-svn: 33409
2007-01-20 22:35:55 +00:00
Evan Cheng
00a640dbe0
Fix for PR1108: type of insert_vector_elt index operand is PtrVT, not MVT::i32.
...
llvm-svn: 33398
2007-01-20 10:10:26 +00:00
Evan Cheng
887f75ac0a
Remove an unused variable.
...
llvm-svn: 33396
2007-01-20 09:21:54 +00:00
Evan Cheng
7ab6fa3a67
We not align the final stack slot but instead let the target do so in emitPrologue(). Each target can make adjustments to the stack frame and re-align the stack as it deem appropriate. Do not align it twice which can end up wasting stack space.
...
llvm-svn: 33387
2007-01-20 02:07:13 +00:00