oota-llvm.git
18 years agoUnlike Unix, Windows won't let a file be implicitly replaced via renaming without...
Jeff Cohen [Sun, 7 May 2006 02:51:51 +0000 (02:51 +0000)]
Unlike Unix, Windows won't let a file be implicitly replaced via renaming without explicit permission.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28157 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoNew rlwimi implementation, which is superior to the old one. There are
Nate Begeman [Sun, 7 May 2006 00:23:38 +0000 (00:23 +0000)]
New rlwimi implementation, which is superior to the old one. There are
still a couple missed optimizations, but we now generate all the possible
rlwimis for multiple inserts into the same bitfield.  More regression tests
to come.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28156 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoUse ComputeMaskedBits to determine # sign bits as a fallback. This allows us
Chris Lattner [Sat, 6 May 2006 23:48:13 +0000 (23:48 +0000)]
Use ComputeMaskedBits to determine # sign bits as a fallback.  This allows us
to handle all kinds of stuff, including silly things like:
sextinreg(setcc,i16) -> setcc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28155 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdd some more sign propagation cases
Chris Lattner [Sat, 6 May 2006 23:40:29 +0000 (23:40 +0000)]
Add some more sign propagation cases

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28154 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoApply bug fix supplied by Greg Pettyjohn for a bug he found: '<invalid>' is not...
Jeff Cohen [Sat, 6 May 2006 23:25:53 +0000 (23:25 +0000)]
Apply bug fix supplied by Greg Pettyjohn for a bug he found:  '<invalid>' is not a legal path on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28153 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoSimplify some code, add a couple minor missed folds
Chris Lattner [Sat, 6 May 2006 23:06:26 +0000 (23:06 +0000)]
Simplify some code, add a couple minor missed folds

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28152 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoconstant fold sign_extend_inreg
Chris Lattner [Sat, 6 May 2006 23:05:41 +0000 (23:05 +0000)]
constant fold sign_extend_inreg

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28151 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoremove cases handled elsewhere
Chris Lattner [Sat, 6 May 2006 22:43:44 +0000 (22:43 +0000)]
remove cases handled elsewhere

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28150 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdd some more simple sign bit propagation cases.
Chris Lattner [Sat, 6 May 2006 22:39:59 +0000 (22:39 +0000)]
Add some more simple sign bit propagation cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28149 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoFix some loose ends in MASM support.
Jeff Cohen [Sat, 6 May 2006 21:27:14 +0000 (21:27 +0000)]
Fix some loose ends in MASM support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28148 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agonew testcase we handle right now.
Chris Lattner [Sat, 6 May 2006 18:15:50 +0000 (18:15 +0000)]
new testcase we handle right now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28147 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoUse the new TargetLowering::ComputeNumSignBits method to eliminate
Chris Lattner [Sat, 6 May 2006 09:30:03 +0000 (09:30 +0000)]
Use the new TargetLowering::ComputeNumSignBits method to eliminate
sign_extend_inreg operations.  Though ComputeNumSignBits is still rudimentary,
this is enough to compile this:

short test(short X, short x) {
  int Y = X+x;
  return (Y >> 1);
}
short test2(short X, short x) {
  int Y = (short)(X+x);
  return Y >> 1;
}

into:

_test:
        add r2, r3, r4
        srawi r3, r2, 1
        blr
_test2:
        add r2, r3, r4
        extsh r2, r2
        srawi r3, r2, 1
        blr

instead of:

_test:
        add r2, r3, r4
        srawi r2, r2, 1
        extsh r3, r2
        blr
_test2:
        add r2, r3, r4
        extsh r2, r2
        srawi r2, r2, 1
        extsh r3, r2
        blr

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28146 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdd some really really simple code for computing sign-bit propagation.
Chris Lattner [Sat, 6 May 2006 09:27:13 +0000 (09:27 +0000)]
Add some really really simple code for computing sign-bit propagation.

This will certainly be enhanced in the future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28145 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdd some new methods for computing sign bit information.
Chris Lattner [Sat, 6 May 2006 09:26:22 +0000 (09:26 +0000)]
Add some new methods for computing sign bit information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28144 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoWhen inserting casts, be careful of where we put them. We cannot insert
Chris Lattner [Sat, 6 May 2006 09:10:37 +0000 (09:10 +0000)]
When inserting casts, be careful of where we put them.  We cannot insert
a cast immediately before a PHI node.

This fixes Regression/CodeGen/Generic/2006-05-06-GEP-Cast-Sink-Crash.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28143 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agonew testcase
Chris Lattner [Sat, 6 May 2006 09:09:47 +0000 (09:09 +0000)]
new testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28142 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoMove some code around.
Chris Lattner [Sat, 6 May 2006 09:00:16 +0000 (09:00 +0000)]
Move some code around.

Make the "fold (and (cast A), (cast B)) -> (cast (and A, B))" transformation
only apply when both casts really will cause code to be generated.  If one or
both doesn't, then this xform doesn't remove a cast.

This fixes Transforms/InstCombine/2006-05-06-Infloop.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28141 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agonew testcase from ghostscript that inf looped instcombine
Chris Lattner [Sat, 6 May 2006 08:58:06 +0000 (08:58 +0000)]
new testcase from ghostscript that inf looped instcombine

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28140 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoTeach the X86 backend about non-i32 inline asm register classes.
Chris Lattner [Sat, 6 May 2006 00:29:37 +0000 (00:29 +0000)]
Teach the X86 backend about non-i32 inline asm register classes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28139 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoFold (trunc (srl x, c)) -> (srl (trunc x), c)
Chris Lattner [Sat, 6 May 2006 00:11:52 +0000 (00:11 +0000)]
Fold (trunc (srl x, c)) -> (srl (trunc x), c)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28138 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoFold trunc(any_ext). This gives stuff like:
Chris Lattner [Fri, 5 May 2006 22:56:26 +0000 (22:56 +0000)]
Fold trunc(any_ext).  This gives stuff like:

27,28c27
<       movzwl %di, %edi
<       movl %edi, %ebx
---
>       movw %di, %bx

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28137 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoShrink shifts when possible.
Chris Lattner [Fri, 5 May 2006 22:53:17 +0000 (22:53 +0000)]
Shrink shifts when possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28136 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoImplement ComputeMaskedBits/SimplifyDemandedBits for ISD::TRUNCATE
Chris Lattner [Fri, 5 May 2006 22:32:12 +0000 (22:32 +0000)]
Implement ComputeMaskedBits/SimplifyDemandedBits for ISD::TRUNCATE

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28135 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoPrint a grouping around inline asm blocks so that we can tell when we are
Chris Lattner [Fri, 5 May 2006 21:50:04 +0000 (21:50 +0000)]
Print a grouping around inline asm blocks so that we can tell when we are
using them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28134 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoPrint *some* grouping around inline asm blocks so we know where they are.
Chris Lattner [Fri, 5 May 2006 21:48:50 +0000 (21:48 +0000)]
Print *some* grouping around inline asm blocks so we know where they are.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28133 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoIndent multiline asm strings more nicely
Chris Lattner [Fri, 5 May 2006 21:47:05 +0000 (21:47 +0000)]
Indent multiline asm strings more nicely

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28132 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoTeach the code generator to use cvtss2sd as extload f32 -> f64
Chris Lattner [Fri, 5 May 2006 21:35:18 +0000 (21:35 +0000)]
Teach the code generator to use cvtss2sd as extload f32 -> f64

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28131 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoFold (fpext (load x)) -> (extload x)
Chris Lattner [Fri, 5 May 2006 21:34:35 +0000 (21:34 +0000)]
Fold (fpext (load x)) -> (extload x)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28130 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoMore aggressively sink GEP offsets into loops. For example, before we
Chris Lattner [Fri, 5 May 2006 21:17:49 +0000 (21:17 +0000)]
More aggressively sink GEP offsets into loops.  For example, before we
generated:

        movl 8(%esp), %eax
        movl %eax, %edx
        addl $4316, %edx
        cmpb $1, %cl
        ja LBB1_2       #cond_false
LBB1_1: #cond_true
        movl L_QuantizationTables720$non_lazy_ptr, %ecx
        movl %ecx, (%edx)
        movl L_QNOtoQuantTableShift720$non_lazy_ptr, %edx
        movl %edx, 4460(%eax)
        ret
...

Now we generate:

        movl 8(%esp), %eax
        cmpb $1, %cl
        ja LBB1_2       #cond_false
LBB1_1: #cond_true
        movl L_QuantizationTables720$non_lazy_ptr, %ecx
        movl %ecx, 4316(%eax)
        movl L_QNOtoQuantTableShift720$non_lazy_ptr, %ecx
        movl %ecx, 4460(%eax)
        ret

... which uses one fewer register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28129 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoFix an infinite loop compiling oggenc last night.
Chris Lattner [Fri, 5 May 2006 20:51:30 +0000 (20:51 +0000)]
Fix an infinite loop compiling oggenc last night.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28128 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoNeed extload patterns after Chris' DAG combiner changes
Evan Cheng [Fri, 5 May 2006 08:23:07 +0000 (08:23 +0000)]
Need extload patterns after Chris' DAG combiner changes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28127 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoImplement InstCombine/cast.ll:test29
Chris Lattner [Fri, 5 May 2006 06:39:07 +0000 (06:39 +0000)]
Implement InstCombine/cast.ll:test29

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28126 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoNew testcase
Chris Lattner [Fri, 5 May 2006 06:38:40 +0000 (06:38 +0000)]
New testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28125 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoFold some common code.
Chris Lattner [Fri, 5 May 2006 06:32:04 +0000 (06:32 +0000)]
Fold some common code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28124 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoImplement:
Chris Lattner [Fri, 5 May 2006 06:31:05 +0000 (06:31 +0000)]
Implement:

  // fold (and (sext x), (sext y)) -> (sext (and x, y))
  // fold (or  (sext x), (sext y)) -> (sext (or  x, y))
  // fold (xor (sext x), (sext y)) -> (sext (xor x, y))
  // fold (and (aext x), (aext y)) -> (aext (and x, y))
  // fold (or  (aext x), (aext y)) -> (aext (or  x, y))
  // fold (xor (aext x), (aext y)) -> (aext (xor x, y))

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28123 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoPull and through and/or/xor. This compiles some bitfield code to:
Chris Lattner [Fri, 5 May 2006 06:10:43 +0000 (06:10 +0000)]
Pull and through and/or/xor.  This compiles some bitfield code to:

        mov EAX, DWORD PTR [ESP + 4]
        mov ECX, DWORD PTR [EAX]
        mov EDX, ECX
        add EDX, EDX
        or EDX, ECX
        and EDX, -2147483648
        and ECX, 2147483647
        or EDX, ECX
        mov DWORD PTR [EAX], EDX
        ret

instead of:

        sub ESP, 4
        mov DWORD PTR [ESP], ESI
        mov EAX, DWORD PTR [ESP + 8]
        mov ECX, DWORD PTR [EAX]
        mov EDX, ECX
        add EDX, EDX
        mov ESI, ECX
        and ESI, -2147483648
        and EDX, -2147483648
        or EDX, ESI
        and ECX, 2147483647
        or EDX, ECX
        mov DWORD PTR [EAX], EDX
        mov ESI, DWORD PTR [ESP]
        add ESP, 4
        ret

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28122 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoImplement a variety of simplifications for ANY_EXTEND.
Chris Lattner [Fri, 5 May 2006 05:58:59 +0000 (05:58 +0000)]
Implement a variety of simplifications for ANY_EXTEND.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28121 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoFactor some code, add these transformations:
Chris Lattner [Fri, 5 May 2006 05:51:50 +0000 (05:51 +0000)]
Factor some code, add these transformations:

  // fold (and (trunc x), (trunc y)) -> (trunc (and x, y))
  // fold (or  (trunc x), (trunc y)) -> (trunc (or  x, y))
  // fold (xor (trunc x), (trunc y)) -> (trunc (xor x, y))

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28120 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoBetter implementation of truncate. ISel matches it to a pseudo instruction
Evan Cheng [Fri, 5 May 2006 05:40:20 +0000 (05:40 +0000)]
Better implementation of truncate. ISel matches it to a pseudo instruction
that gets emitted as movl (for r32 to i16, i8) or a movw (for r16 to i8). And
if the destination gets allocated a subregister of the source operand, then
the instruction will not be emitted at all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28119 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoNew note, Nate, please check to see if I'm full of it :)
Chris Lattner [Fri, 5 May 2006 05:36:15 +0000 (05:36 +0000)]
New note, Nate, please check to see if I'm full of it :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28118 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoFix VC++ compilation error.
Jeff Cohen [Fri, 5 May 2006 01:47:05 +0000 (01:47 +0000)]
Fix VC++ compilation error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28117 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoSomehow, I missed this part of the checkin a couple days ago
Nate Begeman [Fri, 5 May 2006 01:13:11 +0000 (01:13 +0000)]
Somehow, I missed this part of the checkin a couple days ago

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28116 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoSink noop copies into the basic block that uses them. This reduces the number
Chris Lattner [Fri, 5 May 2006 01:04:50 +0000 (01:04 +0000)]
Sink noop copies into the basic block that uses them.  This reduces the number
of cross-block live ranges, and allows the bb-at-a-time selector to always
coallesce these away, at isel time.

This reduces the load on the coallescer and register allocator.  For example
on a codec on X86, we went from:

   1643 asm-printer           - Number of machine instrs printed
    419 liveintervals         - Number of loads/stores folded into instructions
   1144 liveintervals         - Number of identity moves eliminated after coalescing
   1022 liveintervals         - Number of interval joins performed
    282 liveintervals         - Number of intervals after coalescing
   1304 liveintervals         - Number of original intervals
     86 regalloc              - Number of times we had to backtrack
1.90232 regalloc              - Ratio of intervals processed over total intervals
     40 spiller               - Number of values reused
    182 spiller               - Number of loads added
    121 spiller               - Number of stores added
    132 spiller               - Number of register spills
      6 twoaddressinstruction - Number of instructions commuted to coalesce
    360 twoaddressinstruction - Number of two-address instructions

to:

   1636 asm-printer           - Number of machine instrs printed
    403 liveintervals         - Number of loads/stores folded into instructions
   1155 liveintervals         - Number of identity moves eliminated after coalescing
   1033 liveintervals         - Number of interval joins performed
    279 liveintervals         - Number of intervals after coalescing
   1312 liveintervals         - Number of original intervals
     76 regalloc              - Number of times we had to backtrack
1.88998 regalloc              - Ratio of intervals processed over total intervals
      1 spiller               - Number of copies elided
     41 spiller               - Number of values reused
    191 spiller               - Number of loads added
    114 spiller               - Number of stores added
    128 spiller               - Number of register spills
      4 twoaddressinstruction - Number of instructions commuted to coalesce
    356 twoaddressinstruction - Number of two-address instructions

On this testcase, this change provides a modest reduction in spill code,
regalloc iterations, and total instructions emitted.  It increases the number
of register coallesces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28115 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdd a helper method.
Chris Lattner [Fri, 5 May 2006 00:51:42 +0000 (00:51 +0000)]
Add a helper method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28114 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agowrap long line
Chris Lattner [Thu, 4 May 2006 23:35:31 +0000 (23:35 +0000)]
wrap long line

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28113 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdjust to use proper TargetData copy ctor
Chris Lattner [Thu, 4 May 2006 21:18:40 +0000 (21:18 +0000)]
Adjust to use proper TargetData copy ctor

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28112 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoFix this to be a proper copy ctor
Chris Lattner [Thu, 4 May 2006 21:17:35 +0000 (21:17 +0000)]
Fix this to be a proper copy ctor

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28111 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoFinal pass of minor cleanups for MachineInstr
Chris Lattner [Thu, 4 May 2006 19:36:09 +0000 (19:36 +0000)]
Final pass of minor cleanups for MachineInstr

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28110 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoInitial support for register pressure aware scheduling. The register reduction
Evan Cheng [Thu, 4 May 2006 19:16:39 +0000 (19:16 +0000)]
Initial support for register pressure aware scheduling. The register reduction
scheduler can go into a "vertical mode" (i.e. traversing up the two-address
chain, etc.) when the register pressure is low.
This does seem to reduce the number of spills in the cases I've looked at. But
with x86, it's no guarantee the performance of the code improves.
It can be turned on with -sched-vertically option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28108 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoRemove redundancy and a level of indirection when creating machine operands
Chris Lattner [Thu, 4 May 2006 19:14:44 +0000 (19:14 +0000)]
Remove redundancy and a level of indirection when creating machine operands

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28107 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoMove register numbers out of "extra" into "contents". Other minor cleanup.
Chris Lattner [Thu, 4 May 2006 18:25:20 +0000 (18:25 +0000)]
Move register numbers out of "extra" into "contents".  Other minor cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28106 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoRemove and simplify some more machineinstr/machineoperand stuff.
Chris Lattner [Thu, 4 May 2006 18:16:01 +0000 (18:16 +0000)]
Remove and simplify some more machineinstr/machineoperand stuff.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28105 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoRename MO_VirtualRegister -> MO_Register. Clean up immediate handling.
Chris Lattner [Thu, 4 May 2006 18:05:43 +0000 (18:05 +0000)]
Rename MO_VirtualRegister -> MO_Register.  Clean up immediate handling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28104 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoremove hasAllocatedReg
Chris Lattner [Thu, 4 May 2006 17:56:20 +0000 (17:56 +0000)]
remove hasAllocatedReg

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28103 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoMove some methods out of MachineInstr into MachineOperand
Chris Lattner [Thu, 4 May 2006 17:52:23 +0000 (17:52 +0000)]
Move some methods out of MachineInstr into MachineOperand

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28102 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoFix Transforms/InstCombine/2006-05-04-DemandedBitCrash.ll
Chris Lattner [Thu, 4 May 2006 17:33:35 +0000 (17:33 +0000)]
Fix Transforms/InstCombine/2006-05-04-DemandedBitCrash.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28101 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agonew testcase that crashes the instcombine pass
Chris Lattner [Thu, 4 May 2006 17:33:24 +0000 (17:33 +0000)]
new testcase that crashes the instcombine pass

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28100 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoThere shalt be only one "immediate" operand type!
Chris Lattner [Thu, 4 May 2006 17:21:20 +0000 (17:21 +0000)]
There shalt be only one "immediate" operand type!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28099 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoChange "value" in MachineOperand to be a GlobalValue, as that is the only
Chris Lattner [Thu, 4 May 2006 17:02:51 +0000 (17:02 +0000)]
Change "value" in MachineOperand to be a GlobalValue, as that is the only
thing that can be in it.  Remove a dead method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28098 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoRevert Nate's CR patch from last night, which caused many regressions (e.g. fhourstones).
Chris Lattner [Thu, 4 May 2006 16:56:45 +0000 (16:56 +0000)]
Revert Nate's CR patch from last night, which caused many regressions (e.g. fhourstones).

Loading and storing off R0 isn't what we wanted.  Also, taking some CR's out of
CRRC seems to cause failures as well.  Further investigation is required.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28097 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoMake external globals public; other minor cleanup.
Jeff Cohen [Thu, 4 May 2006 16:20:22 +0000 (16:20 +0000)]
Make external globals public; other minor cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28096 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoMake Intel syntax the default when LLVM is built with VC++.
Jeff Cohen [Thu, 4 May 2006 16:19:27 +0000 (16:19 +0000)]
Make Intel syntax the default when LLVM is built with VC++.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28095 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoRemove a bunch more dead V9 specific stuff
Chris Lattner [Thu, 4 May 2006 01:26:39 +0000 (01:26 +0000)]
Remove a bunch more dead V9 specific stuff

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28094 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoRemove a bunch more SparcV9 specific stuff
Chris Lattner [Thu, 4 May 2006 01:15:02 +0000 (01:15 +0000)]
Remove a bunch more SparcV9 specific stuff

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28093 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoRemove some more V9-specific stuff.
Chris Lattner [Thu, 4 May 2006 00:49:59 +0000 (00:49 +0000)]
Remove some more V9-specific stuff.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28092 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoRemove some more unused stuff from MachineInstr that was leftover from V9.
Chris Lattner [Thu, 4 May 2006 00:44:25 +0000 (00:44 +0000)]
Remove some more unused stuff from MachineInstr that was leftover from V9.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28091 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoSimplify handling of relocations
Chris Lattner [Thu, 4 May 2006 00:42:08 +0000 (00:42 +0000)]
Simplify handling of relocations

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28090 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoUse movsd to shuffle in the lowest two elements of a v4f32 / v4i32 vector when
Evan Cheng [Wed, 3 May 2006 20:32:03 +0000 (20:32 +0000)]
Use movsd to shuffle in the lowest two elements of a v4f32 / v4i32 vector when
movlps cannot be used (e.g. when load from m64 has multiple uses).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28089 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoChange from using MachineRelocation ctors to using static methods
Chris Lattner [Wed, 3 May 2006 20:30:20 +0000 (20:30 +0000)]
Change from using MachineRelocation ctors to using static methods
in MachineRelocation to create Relocations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28088 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agominor cleanups, no functionality change
Chris Lattner [Wed, 3 May 2006 18:55:56 +0000 (18:55 +0000)]
minor cleanups, no functionality change

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28087 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoCleanup the internal implementation of MachineRelocation. No interface or
Chris Lattner [Wed, 3 May 2006 18:52:31 +0000 (18:52 +0000)]
Cleanup the internal implementation of MachineRelocation.  No interface or
functionality changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28086 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAttempt to get this script working on Darwin.
Reid Spencer [Wed, 3 May 2006 18:16:01 +0000 (18:16 +0000)]
Attempt to get this script working on Darwin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28085 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoFor PR764:
Reid Spencer [Wed, 3 May 2006 17:49:50 +0000 (17:49 +0000)]
For PR764:
Don't check in the LibDeps.txt and FinalLibDeps.txt files to CVS because
the content differs from platform to platform. Instead, adjust the makefile
so that a dummy llvm-config is built if Perl is not available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28084 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoinline a simple method
Chris Lattner [Wed, 3 May 2006 17:21:32 +0000 (17:21 +0000)]
inline a simple method

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28083 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoSuck block address tracking out of targets into the JIT Emitter. This
Chris Lattner [Wed, 3 May 2006 17:10:41 +0000 (17:10 +0000)]
Suck block address tracking out of targets into the JIT Emitter.  This
simplifies the MachineCodeEmitter interface just a little bit and makes
BasicBlocks work like constant pools and jump tables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28082 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoFix a bug in Owen's checkin that broke the CBE on all non sparc v9 platforms.
Chris Lattner [Wed, 3 May 2006 05:48:41 +0000 (05:48 +0000)]
Fix a bug in Owen's checkin that broke the CBE on all non sparc v9 platforms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28081 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoTeach the x86 jit how to handle jump tables not directly used by a jump
Nate Begeman [Wed, 3 May 2006 04:52:47 +0000 (04:52 +0000)]
Teach the x86 jit how to handle jump tables not directly used by a jump
instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28080 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoFinish up the initial jump table implementation by allowing jump tables to
Nate Begeman [Wed, 3 May 2006 03:48:02 +0000 (03:48 +0000)]
Finish up the initial jump table implementation by allowing jump tables to
not be 100% dense.  Increase the minimum threshold for the number of cases
in a switch statement from 4 to 6 in order to create a jump table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28079 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoA few instruction scheduling test cases.
Evan Cheng [Wed, 3 May 2006 02:11:36 +0000 (02:11 +0000)]
A few instruction scheduling test cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28077 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoBottom up register pressure reduction work: clean up some hacks and enhanced
Evan Cheng [Wed, 3 May 2006 02:10:45 +0000 (02:10 +0000)]
Bottom up register pressure reduction work: clean up some hacks and enhanced
the heuristic to further reduce spills for several test cases. (Note, it may
not necessarily translate to runtime win!)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28076 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoSet isStore of instructions with ISD::TRUNCSTORE root node.
Evan Cheng [Wed, 3 May 2006 02:08:34 +0000 (02:08 +0000)]
Set isStore of instructions with ISD::TRUNCSTORE root node.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28075 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoRefactor TargetMachine, pushing handling of TargetData into the target-specific subcl...
Owen Anderson [Wed, 3 May 2006 01:29:57 +0000 (01:29 +0000)]
Refactor TargetMachine, pushing handling of TargetData into the target-specific subclasses.  This has one caller-visible change: getTargetData() now returns a pointer instead of a reference.

This fixes PR 759.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28074 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAlign function bodies correctly.
Chris Lattner [Wed, 3 May 2006 01:03:20 +0000 (01:03 +0000)]
Align function bodies correctly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28073 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdd a new emitAlignment method
Chris Lattner [Wed, 3 May 2006 01:01:51 +0000 (01:01 +0000)]
Add a new emitAlignment method

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28072 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoSimplify some code. Don't add memory blocks to the Blocks list twice.
Chris Lattner [Wed, 3 May 2006 00:54:49 +0000 (00:54 +0000)]
Simplify some code.  Don't add memory blocks to the Blocks list twice.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28071 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdd assertions that verify that the actual arguments to a call or invoke match
Chris Lattner [Wed, 3 May 2006 00:48:22 +0000 (00:48 +0000)]
Add assertions that verify that the actual arguments to a call or invoke match
the prototype of the called function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28070 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoChange the BasicBlockAddrs map to be a vector, indexed by MBB number.
Chris Lattner [Wed, 3 May 2006 00:32:55 +0000 (00:32 +0000)]
Change the BasicBlockAddrs map to be a vector, indexed by MBB number.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28069 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoKeep the alpha JIT similar to the PPC/X86 jits
Chris Lattner [Wed, 3 May 2006 00:31:21 +0000 (00:31 +0000)]
Keep the alpha JIT similar to the PPC/X86 jits

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28068 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoKeep Visual Studio happy.
Jeff Cohen [Wed, 3 May 2006 00:28:50 +0000 (00:28 +0000)]
Keep Visual Studio happy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28067 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoSimplify some code
Chris Lattner [Wed, 3 May 2006 00:13:06 +0000 (00:13 +0000)]
Simplify some code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28066 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoSeveral related changes:
Chris Lattner [Tue, 2 May 2006 23:22:24 +0000 (23:22 +0000)]
Several related changes:

1. Change several methods in the MachineCodeEmitter class to be pure virtual.
2. Suck emitConstantPool/initJumpTableInfo into startFunction, removing them
   from the MachineCodeEmitter interface, and reducing the amount of target-
   specific code.
3. Change the JITEmitter so that it allocates constantpools and jump tables
   *right* next to the functions that they belong to, instead of in a separate
   pool of memory.  This makes all memory for a function be contiguous, and
   means the JITEmitter only tracks one block of memory now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28065 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoAdd a method for allocating space from the code buffer.
Chris Lattner [Tue, 2 May 2006 22:51:03 +0000 (22:51 +0000)]
Add a method for allocating space from the code buffer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28064 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoRemove some stuff from the README
Nate Begeman [Tue, 2 May 2006 22:43:31 +0000 (22:43 +0000)]
Remove some stuff from the README

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28063 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoDo not make the JIT memory manager manage the memory for globals. Instead
Chris Lattner [Tue, 2 May 2006 21:57:51 +0000 (21:57 +0000)]
Do not make the JIT memory manager manage the memory for globals.  Instead
just have the JIT malloc them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28062 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoMinor cleanups, no functionality change.
Chris Lattner [Tue, 2 May 2006 21:44:14 +0000 (21:44 +0000)]
Minor cleanups, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28061 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoFix a purely hypothetical problem (for now): emitWord emits in the host
Chris Lattner [Tue, 2 May 2006 19:14:47 +0000 (19:14 +0000)]
Fix a purely hypothetical problem (for now): emitWord emits in the host
byte format.  This doesn't work when using the code emitter in a cross target
environment.  Since the code emitter is only really used by the JIT, this
isn't a current problem, but if we ever start emitting .o files, it would be.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28060 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoRefactor the machine code emitter interface to pull the pointers for the current
Chris Lattner [Tue, 2 May 2006 18:27:26 +0000 (18:27 +0000)]
Refactor the machine code emitter interface to pull the pointers for the current
code emission location into the base class, instead of being in the derived classes.

This change means that low-level methods like emitByte/emitWord now are no longer
virtual (yaay for speed), and we now have a framework to support growable code
segments.  This implements feature request #1 of PR469.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28059 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoSince we don't handle callee-save CRs right yet, don't allocate them. Also
Nate Begeman [Tue, 2 May 2006 17:37:31 +0000 (17:37 +0000)]
Since we don't handle callee-save CRs right yet, don't allocate them.  Also
don't step on R11 in the middle of a function when saving and restoring CRs

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28058 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoPrint function number instead of name
Nate Begeman [Tue, 2 May 2006 17:36:46 +0000 (17:36 +0000)]
Print function number instead of name

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28057 91177308-0d34-0410-b5e6-96231b3b80d8

18 years agoHooray, everyone now uses the same printBasicBlockLabel implementation
Nate Begeman [Tue, 2 May 2006 17:34:51 +0000 (17:34 +0000)]
Hooray, everyone now uses the same printBasicBlockLabel implementation

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28056 91177308-0d34-0410-b5e6-96231b3b80d8