Commit Graph

3611 Commits

Author SHA1 Message Date
Evan Cheng
9e2d86add8 Turn on GEP index sinking by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35127 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-16 18:32:30 +00:00
Evan Cheng
9f5ead9601 Stupid bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35126 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-16 17:50:20 +00:00
Evan Cheng
3cd4e5095b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35123 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-16 08:46:27 +00:00
Evan Cheng
14245a9d62 Added isLegalAddressExpression hook to test if the given expression can be
folded into target addressing mode for the given type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35121 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-16 08:42:32 +00:00
Evan Cheng
56fdd7af88 Debugging output stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35117 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-15 21:19:28 +00:00
Evan Cheng
c6deb3d447 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35109 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-14 22:43:40 +00:00
Evan Cheng
61230d18d2 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35089 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-13 23:25:11 +00:00
Evan Cheng
c289faf015 More flexible TargetLowering LSR hooks for testing whether an immediate is a legal target address immediate or scale.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35076 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-12 23:37:10 +00:00
Evan Cheng
e2ee99620f 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35041 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-09 09:48:56 +00:00
Evan Cheng
219705131d Print preds / succs BB numbers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35040 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-09 08:29:08 +00:00
Evan Cheng
f0e3bb1333 Avoid variable shadowing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35039 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-09 06:02:17 +00:00
Chris Lattner
6dfc6806bf implement support for floating point constants used as inline asm memory operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-08 22:29:47 +00:00
Chris Lattner
b4ddac9bf7 make this fail even in non-assert builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35025 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-08 07:07:03 +00:00
Anton Korobeynikov
d0b82b301d Refactoring of formal parameter flags. Enable properly use of
zext/sext/aext stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35008 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-07 16:25:09 +00:00
Anton Korobeynikov
6a143590b3 Cleanup: make SetCounter an instance variable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35007 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-07 08:25:02 +00:00
Evan Cheng
83060c544b Avoid combining indexed load further.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35005 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-07 08:07:03 +00:00
Anton Korobeynikov
a6199c87c2 Fix DWARF debugging information on x86/Linux and (hopefully)
Mingw32/Cygwin targets. This fixes PR978


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35000 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-07 02:47:57 +00:00
Evan Cheng
caddd590f7 Minor bug fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34985 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 21:58:15 +00:00
Devang Patel
0f54dcbf07 Now LoopStrengthReduce is a LoopPass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34984 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 21:14:09 +00:00
Chris Lattner
edf2e8da25 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34983 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 20:01:06 +00:00
Anton Korobeynikov
fb269cf3e7 Small eye-candy: use asciz directive everywhere, where possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34981 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 19:25:02 +00:00
Evan Cheng
87f8bf65dd If target decides to create an emergency spill slot, make sure it's closest to SP or frame pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34965 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 10:02:38 +00:00
Evan Cheng
b74a3e6fda Register scavenger is now capable of scavenging. It spills a register whose use of furthest away to make it available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34964 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 10:01:25 +00:00
Anton Korobeynikov
0db79d86de Enumerate SDISel formal parameter attributes. Make use of new
enumeration.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34960 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 06:10:33 +00:00
Jeff Cohen
ca5183d445 Unbreak VC++ build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34917 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 00:00:42 +00:00
Chris Lattner
b654176cb4 fold away addc nodes when we know there cannot be a carry-out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34913 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 20:40:38 +00:00
Chris Lattner
bcf2484450 generalize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34910 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 20:08:45 +00:00
Chris Lattner
91153686f0 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34909 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 20:03:15 +00:00
Chris Lattner
175415e116 eliminate some ops if they have an undef RHS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34908 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 20:01:46 +00:00
Reid Spencer
d7f3de655b Remove unneeded header file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34903 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 04:41:04 +00:00
Chris Lattner
8b2d42c949 Fix CodeGen/Generic/fpowi-promote.ll and PR1239
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34893 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 23:43:21 +00:00
Chris Lattner
a9569f10de Add an expand action for ISD label which just deletes the label.
This "fixes" PR1238.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34890 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 19:21:38 +00:00
Evan Cheng
a7288df62d Only propagate IsKill if the last use is a kill.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34878 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 06:32:37 +00:00
Nate Begeman
af80638869 http://llvm.org/bugs/show_bug.cgi?id=1237
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34875 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 06:18:18 +00:00
Evan Cheng
a16d4429e4 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34866 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 02:18:00 +00:00
Evan Cheng
5de3b7f351 Mark dead def as unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34844 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 10:43:16 +00:00
Evan Cheng
7b466d0481 Dead live-in detection bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34843 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 10:41:15 +00:00
Evan Cheng
6b448092bf - Keep track all def and uses of stack slot available in register.
- Available value use may be deleted (e.g. noop move).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34841 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 08:52:00 +00:00
Evan Cheng
c3dd314b78 Invalidate last use of a reused register if the use is a deleted noop copy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34839 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 05:41:42 +00:00
Jim Laskey
0102ca8f5a Emit eh filter info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34805 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 20:26:43 +00:00
Jim Laskey
59e8434a85 Collect eh filter info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34804 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 20:25:32 +00:00
Jim Laskey
0b4711bd94 Lower eh filter intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34802 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 20:24:30 +00:00
Evan Cheng
a81a5ab357 Delete register scavenger when done with it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34786 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 10:23:33 +00:00
Evan Cheng
5196b3680c Add a version of FindUnusedReg that restrict search to a specific set of registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34784 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 08:56:24 +00:00
Evan Cheng
c0ba1bc49b A restore is promoted to copy (or deleted entirely), remove the kill from the last use of the targetted register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34773 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 02:27:30 +00:00
Evan Cheng
23322d1427 Interface clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34772 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 02:25:51 +00:00
Evan Cheng
a3756ee7fe Interface clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34770 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 02:19:39 +00:00
Evan Cheng
8e92b4bae2 Oops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34768 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 02:05:35 +00:00
Evan Cheng
88d1f587d2 Track all joined registers and eliminate unneeded kills after all joining are done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34767 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 02:03:03 +00:00
Jim Laskey
8782d481a3 Chain is on second operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34759 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 20:43:58 +00:00
Jim Laskey
3f09fc2ff8 Handle mix of personalities.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34752 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 18:38:31 +00:00
Jim Laskey
63f3e3fa1d Provide a more meaningful name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34751 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 18:37:50 +00:00
Jim Laskey
64ce0ca90d MERGE_VALUES unnecessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34750 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 18:37:04 +00:00
Nate Begeman
a0a6278c7c Fix a typo, thanks Bill!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34741 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 09:16:38 +00:00
Nate Begeman
fec910c3b9 More Mach-O writer improvements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34740 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 07:40:50 +00:00
Chris Lattner
66baf26fe0 add methods for analysis of call results and return nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34738 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 07:09:40 +00:00
Chris Lattner
fb39f99fa4 add methods to analyze calls and formals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34736 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 06:56:37 +00:00
Chris Lattner
e5876ce21a add a newline at end of file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34735 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 06:42:11 +00:00
Evan Cheng
36230cdda4 Make requiresRegisterScavenging determination on a per MachineFunction basis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34711 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 00:59:19 +00:00
Evan Cheng
37f15a6d48 MRegisterInfo disowns RegScavenger. It's immutable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34706 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 00:17:36 +00:00
Evan Cheng
898218cc5e Some more code clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34700 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 22:58:43 +00:00
Evan Cheng
8cab162e03 Oops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34698 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 22:10:52 +00:00
Evan Cheng
3f6fd87473 Let MRegisterInfo now owns RegScavenger.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34691 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 21:10:33 +00:00
Evan Cheng
bb6fb3357d RegScavenger interface change to make it more flexible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34690 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 21:09:48 +00:00
Chris Lattner
13513b7a50 Minor refactoring of CC Lowering interfaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34656 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 05:13:54 +00:00
Chris Lattner
362e98a5f5 move CC Lowering stuff to its own public interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34655 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 04:43:02 +00:00
Evan Cheng
ed570dedad forward() should not increment internal iterator. Its client may insert instruction between now and next forward() call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34649 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 01:58:48 +00:00
Evan Cheng
edeffb37dc Joining an interval with a dead copy instruction. Shorten the live range to the last use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34645 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-26 21:37:37 +00:00
Chris Lattner
2255887574 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34621 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-26 03:13:59 +00:00
Chris Lattner
ddf53e45b2 track signedness of formal argument, though we have a fixme here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34620 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-26 02:56:58 +00:00
Jim Laskey
183f47fb1a Fix for PR1224.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34610 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-25 21:43:59 +00:00
Chris Lattner
251db1890c optimize duplicate ValueMap lookups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34599 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-25 18:40:32 +00:00
Evan Cheng
de4e942faa A couple of more places where a register liveness has been extended and its last kill should be updated accordingly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34597 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-25 09:51:27 +00:00
Evan Cheng
0badfea274 Add an assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34596 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-25 09:47:31 +00:00
Evan Cheng
48ef398ebd Fix a couple of bugs related IsDead back propagation during coalescing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34595 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-25 09:46:31 +00:00
Evan Cheng
16191f0333 If the liveinterval of the source instruction has been extended, remove the IsKill marker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34594 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-25 09:41:59 +00:00
Evan Cheng
bc025fbb64 Only add liveinterval to livein set if it isn't assigned a stack slot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34593 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-25 09:39:02 +00:00
Chris Lattner
753d9cb50e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34584 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-25 08:24:27 +00:00
Chris Lattner
6618039f9f initialize a instance variable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34567 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-25 01:28:05 +00:00
Jim Laskey
7a1de987a6 Deal with cases when MMI is not requested.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34556 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-24 09:45:44 +00:00
Jim Laskey
e80873ee75 Drop unused operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34555 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-24 09:44:17 +00:00
Chris Lattner
01ca65b23e Fix CodeGen/Generic/2007-02-23-DAGCombine-Miscompile.ll and PR1219
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34551 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-24 02:09:29 +00:00
Evan Cheng
50d25d7ff7 Reuse extends the liveness of a register. Transfer the kill to the operand that reuse it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34536 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-23 21:47:50 +00:00
Jim Laskey
1da20a71d1 Handle improper cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34535 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-23 21:45:01 +00:00
Evan Cheng
da2295e631 Handle cases when joining live intervals of two virtual registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34534 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-23 20:40:13 +00:00
Evan Cheng
403c45dfcc Mark livein registers as being in used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34525 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-23 08:41:19 +00:00
Evan Cheng
91e2390818 A spill kills the register being stored. But it is later being reused by spiller, its live range has to be extended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34517 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-23 01:13:26 +00:00
Evan Cheng
49dd06461a First potential client of register scavenger.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34516 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-23 01:11:26 +00:00
Evan Cheng
76d7e76c15 Use findRegisterUseOperand to find a kill of particular register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34512 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-23 01:04:26 +00:00
Evan Cheng
96fa612373 Initial check in of register scavenger. Its only current functionality is tracking live registers per MBB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34511 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-23 01:01:19 +00:00
Evan Cheng
30cac02a92 Remove unnecessary isKill properties if a live range has been lengthened due to coalescing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34503 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-22 23:03:39 +00:00
Jim Laskey
774b864f0e Update comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34502 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-22 18:51:19 +00:00
Jim Laskey
5df3ad8b7a Missing end of abbreviations - correction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34501 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-22 18:48:52 +00:00
Jim Laskey
7b1b39d9bc Missing end of abbreviations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34500 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-22 18:22:42 +00:00
Jim Laskey
9bb3c93af2 Need to init.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34499 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-22 18:04:49 +00:00
Jim Laskey
033c9715d9 Remove isAccessable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34497 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-22 16:39:03 +00:00
Jim Laskey
a4e7cd947e Use exception flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34496 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-22 16:22:15 +00:00
Jim Laskey
f9b1cbc80d Remove assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34494 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-22 16:12:17 +00:00
Jim Laskey
cbfdb7b871 Tighten up error checking of args.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34493 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-22 16:10:05 +00:00
Jim Laskey
735b6f8cc3 Handle lowering invoke to call correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34492 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-22 15:38:06 +00:00
Jim Laskey
2bc210d99f Simplify lowering and selection of exception ops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34491 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-22 15:37:19 +00:00
Jim Laskey
b180aa1753 Selection and lowering for exception handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34481 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-21 22:53:45 +00:00
Jim Laskey
bacd304463 Exception handling support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34479 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-21 22:48:45 +00:00
Jim Laskey
bda9b0ec7b Add support for changes in DwarfWriter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34478 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-21 22:47:38 +00:00
Jim Laskey
02b3f5ec4a Make branch folding behave in the presence of landing pads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34476 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-21 22:42:20 +00:00
Jim Laskey
9b25b8ca24 Allow for live in registers for eh landing pads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34475 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-21 22:41:17 +00:00
Jim Laskey
59667fe203 Add structures used for collecting eh information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34473 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-21 22:38:31 +00:00
Evan Cheng
788fb1c103 Out of bound reference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34461 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-21 02:27:39 +00:00
Evan Cheng
957840b3e1 Use BitVector instead. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34460 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-21 02:22:03 +00:00
Evan Cheng
667089de04 Dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34435 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-20 01:29:10 +00:00
Evan Cheng
b371f457b0 Re-apply my liveintervalanalysis changes. Now with PR1207 fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34428 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-19 21:49:54 +00:00
Reid Spencer
a284cbf667 For PR1207:
Revert patches that caused the problem. Evan, please investigate and reapply
when you've discovered the problem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34399 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-19 03:20:00 +00:00
Evan Cheng
aa7976199c - 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34383 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-17 11:15:40 +00:00
Evan Cheng
e1fd6828af Do not add livein's to entry MBB twice.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34382 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-17 11:11:27 +00:00
Evan Cheng
795d9509d5 Added removeLiveIn.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34381 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-17 11:10:48 +00:00
Evan Cheng
094e3e553f Added findRegisterDefOperand().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34380 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-17 11:10:18 +00:00
Evan Cheng
e15764f28f - Use MRegister::regsOverlap().
- Allow LiveVariables to track liveness of more registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34379 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-17 11:09:47 +00:00
Chris Lattner
95ad943ed5 print target nodes nicely
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34369 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-17 06:38:37 +00:00
Chris Lattner
9ff6ee85fe Implement i/n/s constraints correctly. This fixes
test/CodeGen/PowerPC/2007-02-16-InlineAsmNConstraint.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34368 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-17 06:00:35 +00:00
Dale Johannesen
6b896cec8b Fixes PR 1200
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34359 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-17 00:44:34 +00:00
Evan Cheng
bdf44b929f Print <dead> def operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34343 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-16 09:49:18 +00:00
Evan Cheng
9fc508fdc4 Add live-ins to every BB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34342 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-16 09:05:02 +00:00
Dale Johannesen
4c3a5f8ccb test commit (blank line)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34337 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-16 01:54:53 +00:00
Chris Lattner
5d4a9f7731 fix indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34307 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-15 18:19:15 +00:00
Chris Lattner
0152829e89 Apply B Scott Michel's patch for PR1184, which improves diagnostics in an
abort case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34306 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-15 18:17:56 +00:00
Evan Cheng
61de82d885 Use BitVector instead of vector<bool> which can be extremely slow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34302 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-15 05:59:24 +00:00
Reid Spencer
ac9dcb94dd For PR1195:
Change use of "packed" term to "vector" in comments, strings, variable
names, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34300 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-15 03:39:18 +00:00
Reid Spencer
9d6565a5b1 For PR1195:
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34293 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-15 02:26:10 +00:00
Chris Lattner
c661d61d82 fix a warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34272 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-14 07:34:56 +00:00
Chris Lattner
21840b1c5c Refix CodeGen/Generic/switch-lower.ll. In contrast to my previous patch,
this doesn't miscompile lots of programs :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34268 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-14 07:18:16 +00:00
Chris Lattner
d2b7cec527 Generalize TargetData strings, to support more interesting forms of data.
Patch by Scott Michel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34266 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-14 05:52:17 +00:00
Chris Lattner
4c948eb373 implement expand of truncate. This allows truncates from i128 to i64 to
be supported on 32-bit hosts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34257 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-13 23:55:16 +00:00
Chris Lattner
f839ce7d03 Fix PR1198, by adding initial i128 support. Patch by Dan Gohman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34256 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-13 23:41:38 +00:00
Chris Lattner
ae4f99d843 revert my previous switch lowering change, which miscompiles a few programs.
This will break a dj test until I have time to investigate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34247 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-13 20:09:07 +00:00
Lauro Ramos Venancio
cf8270a994 Add a space between // and the comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34244 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-13 18:10:13 +00:00
Lauro Ramos Venancio
7aa47b69ca Add "original alignment" to function arguments flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34240 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-13 13:50:08 +00:00
Chris Lattner
990b849abc eliminate vector-related allocations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34223 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-13 06:01:22 +00:00
Evan Cheng
0c9f92e1ff 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34217 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-13 01:30:55 +00:00
Chris Lattner
818d42f1e8 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34216 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-13 01:05:56 +00:00
Chris Lattner
7f6b9d2f1a eliminate temporary vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34161 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 20:31:59 +00:00
Chris Lattner
b0c39a3b4d encapsulate the rest of the StructLayout members.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34157 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 19:59:22 +00:00
Chris Lattner
b1919e2f08 Privatize StructLayout::MemberOffsets, adding an accessor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34156 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 19:55:17 +00:00
Evan Cheng
ad2070c667 Add function live-ins to entry block live-in set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34112 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 02:43:39 +00:00
Evan Cheng
13d8285678 Add live-ins to MachineBasicBlock.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34111 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 02:38:19 +00:00
Evan Cheng
15699fc5ed Rename some variables to avoid confusion with SelectionDAGISel::BB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34110 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 01:08:18 +00:00
Evan Cheng
2e67781ef5 Make use of TLI.SimplifySetCC() in LegalizeSetCCOperands().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34066 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-08 22:16:19 +00:00
Evan Cheng
fa1eb27b76 Move SimplifySetCC to TargetLowering and allow it to be shared with legalizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34065 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-08 22:13:59 +00:00
Evan Cheng
f50d09ad21 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34039 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-08 06:04:54 +00:00
Bill Wendling
04523eab6b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34032 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-08 01:36:53 +00:00
Bill Wendling
8f84f1f301 Add function to create a file writer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34031 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-08 01:35:27 +00:00