Commit Graph

24643 Commits

Author SHA1 Message Date
Chris Lattner 873ef133ce Significantly revamp allocation of machine code to use free lists, real
allocation policies and much more.  All this complexity, and we have no
functionality change, woo! :)

llvm-svn: 28225
2006-05-11 23:08:08 +00:00
Chris Lattner 1443bc52be Refactor some code, making it simpler.
When doing the initial pass of constant folding, if we get a constantexpr,
simplify the constant expr like we would do if the constant is folded in the
normal loop.

This fixes the missed-optimization regression in
Transforms/InstCombine/getelementptr.ll last night.

llvm-svn: 28224
2006-05-11 17:11:52 +00:00
Evan Cheng dd7230c9e0 Add MOV16_rm / MOV32_rm and MOV16_mr / MOV32_mr to isLoadFromStackSlot and isStoreToStackSlot
llvm-svn: 28223
2006-05-11 07:33:49 +00:00
Evan Cheng 0da0c50f1e Also add super- register class info.
llvm-svn: 28222
2006-05-11 07:31:44 +00:00
Evan Cheng 229a6d0026 Also add super- register classes info.
llvm-svn: 28221
2006-05-11 07:30:26 +00:00
Evan Cheng 47926aff96 Set weight of zero length intervals to infinite to prevent them from being
spilled.

llvm-svn: 28220
2006-05-11 07:29:24 +00:00
Evan Cheng db6aa4896b Backing out previous check-in.
llvm-svn: 28219
2006-05-11 07:28:16 +00:00
Owen Anderson 68afff2dcd Fix some problems linking stuff in libTarget.
llvm-svn: 28218
2006-05-11 03:10:15 +00:00
Evan Cheng 6ad040a6bc If the live interval legnth is essentially zero, i.e. in every live range
the use follows def immediately, it doesn't make sense to spill it and
hope it will be easier to allocate for this LI.

llvm-svn: 28217
2006-05-10 22:30:41 +00:00
Evan Cheng 47a57ac4f9 Update test case
llvm-svn: 28216
2006-05-10 19:53:05 +00:00
Chris Lattner a36ee4ea34 Two changes:
1. Implement InstCombine/deadcode.ll by not adding instructions in unreachable
   blocks (due to constants in conditional branches/switches) to the worklist.
   This causes them to be deleted before instcombine starts up, leading to
   better optimization.

2. In the prepass over instructions, do trivial constprop/dce as we go.  This
   has the effect of improving the effectiveness of #1.  In addition, it
   *significantly* speeds up instcombine on test cases with large amounts of
   constant folding code (for example, that produced by code specialization
   or partial evaluation).  In one example, it speeds up instcombine from
   0.0589s to 0.0224s with a release build (a 2.6x speedup).

llvm-svn: 28215
2006-05-10 19:00:36 +00:00
Chris Lattner 1a0e0c1c9e New testcase, check that dead code doesn't pessimize instcombine
llvm-svn: 28214
2006-05-10 18:56:04 +00:00
Chris Lattner b25cb79604 Fix the PowerPC JIT-only failure on UnitTests/Vector/sumarray-dbl, which is
really a bad codegen bug that LLC happens to get lucky with. I must chat with
Nate for the proper fix.

llvm-svn: 28213
2006-05-10 06:38:32 +00:00
Evan Cheng 9665ba053f Templatify RegReductionPriorityQueue
llvm-svn: 28212
2006-05-10 06:16:44 +00:00
Chris Lattner 728c377e0f Add alloca/malloc ctors that don't take array sizes.
llvm-svn: 28211
2006-05-10 04:38:35 +00:00
Chris Lattner bb7ff6690f Add an assertion for a common error
llvm-svn: 28210
2006-05-10 04:32:43 +00:00
Evan Cheng 32982836b6 Watch out for the following case:
1. Use expects a chain output.
2. Node is expanded into multiple target ops.
3. One of the inner node produces a chain, the outer most one doesn't.

llvm-svn: 28209
2006-05-10 02:47:57 +00:00
Evan Cheng d2b8067748 Fix a load folding bug. It is exposed by a multi- resulting instructions
def : Pat<> pattern.

llvm-svn: 28208
2006-05-10 00:05:46 +00:00
Nate Begeman 1a225d23ae Fix PR773
llvm-svn: 28207
2006-05-09 18:20:51 +00:00
Chris Lattner 5d779af587 This method doesn't need to be virtual, thanks to Reid for pointing this out.
llvm-svn: 28206
2006-05-09 17:29:17 +00:00
Chris Lattner f801792e08 Fix a regression in my patch from last night that broke the llvmgcc4 build on
ppc

llvm-svn: 28205
2006-05-09 16:41:59 +00:00
Chris Lattner 2814134a5d Indent .data/.text in the .s file
llvm-svn: 28204
2006-05-09 16:15:00 +00:00
Evan Cheng 43ddc376fb Another instruction scheduling test case
llvm-svn: 28203
2006-05-09 07:20:24 +00:00
Evan Cheng 7d693898ee Add pseudo dependency to force a def&use operand to be scheduled last (unless
the distance between the def and another use is much longer). This is under
option control for now "-sched-lower-defnuse".

llvm-svn: 28201
2006-05-09 07:13:34 +00:00
Evan Cheng 2c74848af1 Debugging info
llvm-svn: 28200
2006-05-09 06:55:15 +00:00
Evan Cheng fc532fe1b7 Remove a completed entry.
llvm-svn: 28199
2006-05-09 06:54:05 +00:00
Evan Cheng c39ab4575e Test case for PR770
llvm-svn: 28198
2006-05-09 06:48:12 +00:00
Evan Cheng ae45020720 PR 770 - permit coallescing of registers in subset register classes.
llvm-svn: 28197
2006-05-09 06:37:48 +00:00
Evan Cheng f2925b3b2c Added sub- register classes information.
llvm-svn: 28196
2006-05-09 06:35:30 +00:00
Evan Cheng 5e7ba0b049 Add sub-register class information.
llvm-svn: 28195
2006-05-09 06:34:26 +00:00
Chris Lattner 4ebc6a2311 Implement MASM sections correctly, without a "has masm sections flag" and a bunch of special case code.
llvm-svn: 28194
2006-05-09 05:33:48 +00:00
Chris Lattner af35b1476e Implement MASM sections correctly, without a "has masm sections flag" and a
bunch of special case code.

llvm-svn: 28193
2006-05-09 05:33:28 +00:00
Chris Lattner 8c2bfc0659 Oh yeah, there are two of these now, unify both.
llvm-svn: 28192
2006-05-09 05:24:50 +00:00
Chris Lattner 6341df8069 Setting SwitchToSectionDirective properly in the MASM backend permits a bunch
of code to be unified.

llvm-svn: 28191
2006-05-09 05:23:12 +00:00
Chris Lattner 0b7acaf027 MASM doesn't have one of these.
llvm-svn: 28190
2006-05-09 05:21:47 +00:00
Chris Lattner d36cc2b610 Don't prefix section directives with a tab. Doing so causes blank lines to
be emitted to the .s file.

llvm-svn: 28189
2006-05-09 05:19:59 +00:00
Chris Lattner e64f764d25 Make the masm codepath work like the normal code path.
llvm-svn: 28188
2006-05-09 05:15:58 +00:00
Chris Lattner e0006c6794 Preserve prior behavior
llvm-svn: 28187
2006-05-09 05:15:24 +00:00
Chris Lattner c0f0dfa56f The MASM asmprinter has been fixed, these hacks are no longer needed.
llvm-svn: 28186
2006-05-09 05:13:34 +00:00
Chris Lattner d0201946ad Fix the MASM asmprinter's lies. It does not want to emit code to .text/.data
it wants it emitted to _text/_data.

llvm-svn: 28185
2006-05-09 05:12:53 +00:00
Chris Lattner 8488ba2e41 Split SwitchSection into SwitchTo{Text|Data}Section methods.
llvm-svn: 28184
2006-05-09 04:59:56 +00:00
Chris Lattner a6212b0fe6 Split SwitchSection into the SwitchTo{Text|Data}Section functions, to better
support assemblers that distinguish the two.

llvm-svn: 28183
2006-05-09 04:59:30 +00:00
Chris Lattner 8587f8885d Some notes and thoughts to myself
llvm-svn: 28182
2006-05-09 04:58:46 +00:00
Chris Lattner 4fe87d67c4 Patch to make some xforms preserve each other. Patch contributed by
Domagoj Babic!

llvm-svn: 28181
2006-05-09 04:13:41 +00:00
Reid Spencer 357f3e8231 Use the -dumpversion option to llvm-gcc which gives us just the version #
and is unlikely to change in future releases. This also simplifies the
parsing of the full and major llvm-gcc version numbers in the script.

llvm-svn: 28180
2006-05-09 00:31:01 +00:00
Chris Lattner 6d8dd189f6 Move some methods out of line so that MutexGuard.h isn't needed in a public header.
llvm-svn: 28179
2006-05-08 22:00:52 +00:00
Chris Lattner 12b056007e Move methods out of line so that MutexGuard.h isn't required in the header.
llvm-svn: 28178
2006-05-08 22:00:26 +00:00
Chris Lattner aa193d80a9 Another bad case I noticed
llvm-svn: 28177
2006-05-08 21:39:45 +00:00
Chris Lattner 5bcea612f4 add a note
llvm-svn: 28176
2006-05-08 21:24:21 +00:00
Chris Lattner 446e1ef26a Make the case I just checked in stronger. Now we compile this:
short test2(short X, short x) {
  int Y = (short)(X+x);
  return Y >> 1;
}

to:

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

instead of:

_test2:
        add r2, r3, r4
        extsh r2, r2
        srwi r2, r2, 1
        extsh r3, r2
        blr

llvm-svn: 28175
2006-05-08 21:18:59 +00:00