Commit Graph

14532 Commits

Author SHA1 Message Date
Andrew Lenharth
632cd52162 Since there was interest on the mailing list, this is a utility pass that
uses DSA to make find targets of calls.  It provides a very convinient
interface to DSA results to do things with indirect calls, such as
write a devirtualizer (which I have and may commit one of these days).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28545 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-29 22:58:38 +00:00
Vladimir Prus
cb29bd7fc9 Reset DEBUG_SYMBOL_TABLE back to 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28538 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-29 12:54:52 +00:00
Vladimir Prus
6ba568fabb Fix compile error when DEBUG_SYMBOL_TABLE is defined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28537 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-29 12:45:15 +00:00
Reid Spencer
fd20c0ab00 Fix grammar in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28534 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-29 02:34:34 +00:00
Owen Anderson
00ea74c27e Add Use replacement. Assuming there is nothing horribly wrong with this, LCSSA
is now theoretically feature-complete.  It has not, however, been thoroughly
test, and is still considered experimental.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28529 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-29 01:00:00 +00:00
Owen Anderson
bd82277cbb Major think-o. Iterate over all live out-of-loop values, and perform the
other calculations on each individually, rather than trying to delay it and do
them all at the end.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28527 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-28 19:33:28 +00:00
Owen Anderson
2f21e07915 Make LCSSA insert proper Phi nodes throughout the rest of the CFG by computing
the iterated Dominance Frontier of the loop-closure Phi's.  This is the
second phase of the LCSSA pass.  The third phase (coming soon) will be to
update all uses of loop variables to use the loop-closure Phi's instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28524 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-27 18:47:11 +00:00
Chris Lattner
8d8d6530b1 Fix some regression from the inliner patch I committed last night. This fixes
ldecod, lencod, and SPASS.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28523 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-27 17:28:13 +00:00
Chris Lattner
5b5bc3032f Switch the inliner over to using CloneAndPruneFunctionInto. This effectively
makes it so that it constant folds instructions on the fly.  This is good
for several reasons:

0. Many instructions are constant foldable after inlining, particularly if
   inlining a call with constant arguments.
1. Without this, the inliner has to allocate memory for all of the instructions
   that can be constant folded, then a subsequent pass has to delete them.  This
   gets the job done without this extra work.
2. This makes the inliner *pass* a bit more aggressive: in particular, it
   partially solves a phase order issue where the inliner would inline lots
   of code that folds away to nothing, but think that the resultant function
   is big because of this code that will be gone.  Now the code never exists.

This is the first part of a 2-step process.  The second part will be smart
enough to see when this implicit constant folding propagates a constant into
a branch or switch instruction, making CFG edges dead.

This implements Transforms/Inline/inline_constprop.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28521 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-27 01:28:04 +00:00
Chris Lattner
a5135ba0c9 Ignore generated files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28520 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-27 01:23:30 +00:00
Chris Lattner
83f03bfc3f Implement a new method, CloneAndPruneFunctionInto, as documented.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28519 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-27 01:22:24 +00:00
Chris Lattner
4b30fcb5f5 Refactor some code to expose an interface to constant fold and instruction given it's opcode, typeand operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28517 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-27 01:18:04 +00:00
Chris Lattner
729c6d1da8 Fix a nasty dag combiner bug that caused nondeterminstic crashes (MY FAVORITE!):
SimplifySelectOps would eliminate a Select, delete it, then return true.

The clients would see that it did something and return null.

The top level would see a null return, and decide that nothing happened,
proceeding to process the node in other ways: boom.

The fix is simple: clients of SimplifySelectOps should return the select
node itself.

In order to catch really obnoxious boogs like this in the future, add an
assert that nodes are not deleted.  We do this by checking for a sentry node
type that the SDNode dtor sets when a node is destroyed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28514 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-27 00:43:02 +00:00
Owen Anderson
a90b2c7240 A few small clean-ups, and the addition of an LCSSA statistic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28512 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-27 00:31:37 +00:00
Evan Cheng
d61c4820c9 Make CALL node consistent with RET node. Signness of value has type MVT::i32
instead of MVT::i1. Either is fine except MVT::i32 is probably a legal type
for most (if not all) platforms while MVT::i1 is not.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28511 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 23:13:20 +00:00
Evan Cheng
6848be1a27 Change RET node to include signness information of the return values. i.e.
RET chain, value1, sign1, value2, sign2, ...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28510 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 23:10:12 +00:00
Evan Cheng
8e7d056bc5 Change RET node to include signness information of the return values. e.g.
RET chain, value1, sign1, value2, sign2


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28509 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 23:09:09 +00:00
Owen Anderson
fc3a3bc64b Fix a copy-and-paste-o that would break some compilers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28507 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 21:19:17 +00:00
Owen Anderson
2480737211 Clean up and refactor LCSSA a bunch. It should also run faster now, though
there's still a lot of work to be done on it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28506 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 21:11:53 +00:00
Evan Cheng
3fddf241d8 Vector argument must be passed in memory location aligned on 16-byte boundary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28505 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 20:37:47 +00:00
Evan Cheng
1d6a9b3b6c Mac OS X ABI document lied. The first four XMM registers are used to pass
vector arguments, not three.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28504 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 19:22:06 +00:00
Chris Lattner
b4db97ffa7 Implement Transforms/InstCombine/store.ll:test2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28503 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 19:19:20 +00:00
Chris Lattner
a65371ea25 Fix a bug in the bc reader/writer: we were not correctly encoding varargs
nonccc calls (we were dropping the CC and tail flag).  This broke several
FORTRAN programs.

Testcase here: Regression/Assembler/2006-05-26-VarargsCallEncode.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28501 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 18:42:34 +00:00
Evan Cheng
052fb5110f Minor update to make the code more clear
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28499 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 18:39:59 +00:00
Evan Cheng
f9d62dc6e5 Update more comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28498 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 18:37:16 +00:00
Evan Cheng
f9ff7c54be Fix some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28497 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 18:25:43 +00:00
Evan Cheng
6f707999a1 No need to handle illegal types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28496 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 18:22:49 +00:00
Owen Anderson
11f510b577 Skeletal LCSSA pass. This is currently non-functional. Expect functionality
and documentation updates soo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28495 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 13:58:26 +00:00
Rafael Espindola
a1334cdfb2 On ARM, alignment is in bits
Add lr as a hard coded operand of bx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28494 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 10:56:17 +00:00
Evan Cheng
138a24e4d4 Remove a couple of bogus casts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28493 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 08:04:31 +00:00
Evan Cheng
00aff7d977 Remove a bogus cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28492 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 08:00:14 +00:00
Evan Cheng
57c0788e02 Minor bug caught by Ashwin Chandra
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28491 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 06:22:34 +00:00
Chris Lattner
7b2e2792d6 Transform things like (splat(splat)) -> splat
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28490 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 00:29:06 +00:00
Chris Lattner
863bcff183 Introduce a helper function that simplifies interpretation of shuffle masks.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28489 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 23:48:38 +00:00
Evan Cheng
cc1fc220a0 Consistency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28488 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 23:31:23 +00:00
Chris Lattner
01575b7315 Turn (cast (shuffle (cast)) -> shuffle (cast) if it reduces the # casts in
the program.  This exposes more opportunities for the instcombiner, and implements
vec_shuffle.ll:test6


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28487 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 23:24:33 +00:00
Chris Lattner
73fa49d697 extract element from a shuffle vector can be trivially turned into an
extractelement from the SV's source.  This implement vec_shuffle.ll:test[45]


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28485 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 22:53:38 +00:00
Evan Cheng
25e71d10a0 Some clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28483 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 22:38:31 +00:00
Chris Lattner
8b5fbc5cd4 Add support for the missing FP condition codes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28482 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 22:26:02 +00:00
Evan Cheng
a9bb445db0 Remove some dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28481 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 22:25:52 +00:00
Evan Cheng
932ad51fea X86 / Cygwin asm / alignment fixes.
Patch contributed by Anton Korobeynikov!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28480 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 21:59:08 +00:00
Chris Lattner
99f2af2dee Revert a patch that is unsafe, due to out of range array accesses in inner
array scopes possibly accessing valid memory in outer subscripts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28478 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 21:25:12 +00:00
Evan Cheng
6b5783d0b1 Build breakage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28475 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 18:56:34 +00:00
Chris Lattner
8e2a04e21d Fix build failure of povray
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28473 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 18:06:16 +00:00
Chris Lattner
5d634ce466 Fix Benchmarks/MallocBench/cfrac
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28471 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 16:54:16 +00:00
Rafael Espindola
2f99b6bd96 implement initial version of ARMAsmPrinter::printOperand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28470 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 12:57:06 +00:00
Rafael Espindola
c3c1a86aa0 port the ARM backend to use ISD::CALL instead of LowerCallTo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28469 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 11:00:18 +00:00
Evan Cheng
3b78823868 Turn on -sched-commute-nodes by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28465 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 08:37:31 +00:00
Evan Cheng
32fe1035a7 Switch X86 over to a call-selection model where the lowering code creates
the copyto/fromregs instead of making the X86ISD::CALL selection code create
them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28463 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 00:59:30 +00:00
Evan Cheng
4360bdcf1f CALL node change (arg / sign pairs instead of just arguments).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28462 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 00:57:32 +00:00
Evan Cheng
f6d62c2e2a CALL node change: now including signness of every argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28461 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 00:55:32 +00:00
Evan Cheng
6a3d5a62f0 Assert if InflightSet is not cleared after instruction selecting a BB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28459 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 00:24:28 +00:00
Evan Cheng
afe358e7d4 Clear HandleMap and ReplaceMap after instruction selection. Or it may cause
non-deterministic behavior.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28454 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-24 20:46:25 +00:00
Reid Spencer
19b7e0e0ca For PR786:
Minor tweaks in public headers and a few .cpp files so that LLVM can build
successfully with -pedantic and projects using LLVM with -pedantic don't
get warnings from LLVM. There's still more -pedantic warnings to fix.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28453 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-24 19:21:13 +00:00
Reid Spencer
077b387207 For PR786:
Remove a spurious ;


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28452 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-24 19:05:21 +00:00
Chris Lattner
a04c0c417b Patch for a new instcombine xform, patch contributed by Nick Lewycky!
This implements Transforms/InstCombine/2006-05-10-InvalidIndexUndef.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28450 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-24 17:34:30 +00:00
Chris Lattner
d74ea2bbd8 Patches to make the LLVM sources more -pedantic clean. Patch provided
by Anton Korobeynikov!  This is a step towards closing PR786.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28447 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-24 17:04:05 +00:00
Chris Lattner
2ef5e89dc9 Fix CodeGen/Generic/vector.ll:test_div with altivec.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28445 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-24 00:15:25 +00:00
Chris Lattner
5734012375 Handle SETO* like we handle SET*, restoring behavior after Evan's setcc
change.  This fixes PowerPC/fnegsel.ll.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28443 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-24 00:06:44 +00:00
Chris Lattner
0c54d8964d Print struct return functions and calls as actually returning the hidden
argument struct pointer, enabling ABI compatibility for the CBE with
platforms with strange struct-return ABIs.  This fixes 252.eon and
CoyoteBench/fftbench on Darwin/X86 among other things.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28442 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-23 23:39:48 +00:00
Chris Lattner
c6d0567324 Fix file header comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28441 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-23 23:20:42 +00:00
Evan Cheng
4db3af3511 Better way to check for vararg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28440 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-23 21:08:24 +00:00
Evan Cheng
25caf63cd2 Remove PreprocessCCCArguments and PreprocessFastCCArguments now that
FORMAL_ARGUMENTS nodes include a token operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28439 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-23 21:06:34 +00:00
Chris Lattner
2d2970905c Implement an annoying part of the Darwin/X86 abi: the callee of a struct
return argument pops the hidden struct pointer if present, not the caller.

For example, in this testcase:

struct X { int D, E, F, G; };
struct X bar() {
  struct X a;
  a.D = 0;
  a.E = 1;
  a.F = 2;
  a.G = 3;
  return a;
}
void foo(struct X *P) {
  *P = bar();
}

We used to emit:

_foo:
        subl $28, %esp
        movl 32(%esp), %eax
        movl %eax, (%esp)
        call _bar
        addl $28, %esp
        ret
_bar:
        movl 4(%esp), %eax
        movl $0, (%eax)
        movl $1, 4(%eax)
        movl $2, 8(%eax)
        movl $3, 12(%eax)
        ret

This is correct on Linux/X86 but not Darwin/X86.  With this patch, we now
emit:

_foo:
        subl $28, %esp
        movl 32(%esp), %eax
        movl %eax, (%esp)
        call _bar
***     addl $24, %esp
        ret
_bar:
        movl 4(%esp), %eax
        movl $0, (%eax)
        movl $1, 4(%eax)
        movl $2, 8(%eax)
        movl $3, 12(%eax)
***     ret $4

For the record, GCC emits (which is functionally equivalent to our new code):

_bar:
        movl    4(%esp), %eax
        movl    $3, 12(%eax)
        movl    $2, 8(%eax)
        movl    $1, 4(%eax)
        movl    $0, (%eax)
        ret     $4
_foo:
        pushl   %esi
        subl    $40, %esp
        movl    48(%esp), %esi
        leal    16(%esp), %eax
        movl    %eax, (%esp)
        call    _bar
        subl    $4, %esp
        movl    16(%esp), %eax
        movl    %eax, (%esi)
        movl    20(%esp), %eax
        movl    %eax, 4(%esi)
        movl    24(%esp), %eax
        movl    %eax, 8(%esi)
        movl    28(%esp), %eax
        movl    %eax, 12(%esi)
        addl    $40, %esp
        popl    %esi
        ret

This fixes SingleSource/Benchmarks/CoyoteBench/fftbench with LLC and the
JIT, and fixes the X86-backend portion of PR729.  The CBE still needs to
be updated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28438 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-23 18:50:38 +00:00
Evan Cheng
80235d508e -enable-unsafe-fp-math implies -enable-finite-only-fp-math
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28437 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-23 18:18:46 +00:00
Vladimir Prus
124729155d Fix missing include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28435 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-23 13:43:15 +00:00
Evan Cheng
f6f9581983 Incorrect SETCC CondCode used for FP comparisons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28433 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-23 06:40:47 +00:00
Evan Cheng
95942d76f4 Added option -enable-finite-only-fp-math. When on, the codegen can assume that
FP arithmetic arguments and results are never NaNs or +=Infs. This includes
ignoring parity flag (PF) when checking for FP equality.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28432 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-23 06:39:12 +00:00
Rafael Espindola
4b442b528a implement minimal versions of
ARMAsmPrinter::runOnMachineFunction
LowerFORMAL_ARGUMENTS
ARMInstrInfo::isMoveInstr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28431 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-23 02:48:20 +00:00
Evan Cheng
435bcd7f5f A isel deficiency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28427 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-22 05:54:49 +00:00
Evan Cheng
3c380e71e1 Back out indirect branch load folding hack. It broke some tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28425 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-21 06:28:50 +00:00
Chris Lattner
e8263e6437 Add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28424 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-21 03:57:07 +00:00
Owen Anderson
bcd8a8264e Make TargetData strings less redundant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28423 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-20 23:28:54 +00:00
Chris Lattner
01859e8853 Silence a bogus gcc warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28422 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-20 23:14:03 +00:00
Chris Lattner
f489fb24f2 Fix a parsing bug that caused 7 llvm-test regressions on PPC last night.
I'm suprised it didn't cause more!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28421 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-20 21:16:59 +00:00
Evan Cheng
4f7f71de43 - Use of load's chain result should be redirected to load's chain operand.
If it reads the chain result of the call, then the use, callseq_start,
  and call would form a cycle!
- Don't forget handle node replacement!
- There could also be a TokenFactor between the load and the callseq_start.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28420 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-20 09:21:39 +00:00
Evan Cheng
0d23bc4666 A new entry
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28419 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-20 07:44:53 +00:00
Evan Cheng
6b2e254437 Missing break statements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28418 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-20 07:44:28 +00:00
Evan Cheng
fb914c43ba Remove unused patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28417 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-20 01:40:16 +00:00
Evan Cheng
b245d92328 Handle indirect call which folds a load manually. This never matches by
the TableGen generated code since the load's chain result is read by
the callseq_start node.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28416 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-20 01:36:52 +00:00
Owen Anderson
8f7f4cc1ae Sparc is big-endian.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28415 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-20 00:49:30 +00:00
Owen Anderson
d988b32aba Make all of the TargetMachine subclasses use the new string TargetData methods.
This is part of the on-going work on PR 761.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28414 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-20 00:24:56 +00:00
Chris Lattner
0deaab89fe Print csretcc calls like this:
call csretcc void %structret( { sbyte }* %P )

instead of this:

        callcsretcc  void %structret( { sbyte }* %P )


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28412 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 21:58:52 +00:00
Chris Lattner
ebf8e6cd92 Fix misencoding of calling conventions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28411 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 21:57:37 +00:00
Chris Lattner
7dd29aadf9 pretty print csretcc for calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28410 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 21:54:03 +00:00
Chris Lattner
cdbaeb52ae CSRet allows varargs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28409 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 21:34:04 +00:00
Chris Lattner
25f88aa7ad Asmprint csret nicely
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28408 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 21:29:57 +00:00
Chris Lattner
7546619743 Regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28407 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 21:28:53 +00:00
Chris Lattner
515906d106 Add support for parsing csret
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28406 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 21:28:34 +00:00
Chris Lattner
80105ddf51 csret functions can be varargs (as can target cc's). Verify restrictions on
csret functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28405 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 21:25:17 +00:00
Chris Lattner
f00f68ad0d Add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28402 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 21:01:38 +00:00
Chris Lattner
778ae71f37 Add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28401 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 20:55:31 +00:00
Chris Lattner
c11ab17a8e Split the SSE readme items out into their own README.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28400 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 20:51:43 +00:00
Chris Lattner
2420d81247 Split FP-stack notes out of the main readme. Next up: splitting out SSE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28399 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 20:45:52 +00:00
Chris Lattner
870cf1b715 Move a target-independent note out of the X86 readme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28398 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 20:45:08 +00:00
Chris Lattner
de050a7509 Particularly ugly code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28397 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 19:41:33 +00:00
Reid Spencer
bc2eba1ca2 Fix a doxygen problem and break lines at 80 columns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28395 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 19:09:46 +00:00
Evan Cheng
6de0163201 These can be transformed into lea as well. Not that we use this feature
currently...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28393 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 18:43:41 +00:00
Evan Cheng
09e3c80984 - Use exact-width integer types, e.g. int32_t, to avoid confusion.
- Fix a couple of minor bugs in i16immSExt8 and i16immZExt8.
- Added loadiPTR fragment used for indirect jumps and calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28392 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 18:40:54 +00:00
Evan Cheng
fc8feb184e Explicitly specify MOV32mi can only be used store 32-bit GV, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28390 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 07:30:36 +00:00
Rafael Espindola
dc124a234a implement movri
add a stub LowerFORMAL_ARGUMENTS


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28388 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-18 21:45:49 +00:00
Evan Cheng
ffd4364bb0 Added a Flags field to TargetOperandInfo. Currently the only flag is
M_LOOK_UP_PTR_REG_CLASS which allows the register class of the operand to be
resolved via a callback at runtime.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28387 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-18 20:44:26 +00:00
Evan Cheng
21d03f2de0 lib/Target/Target.td
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28386 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-18 20:42:07 +00:00
Chris Lattner
16abfdfc22 add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28384 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-18 18:26:13 +00:00
Chris Lattner
3f705e660a add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28383 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-18 17:38:16 +00:00
Andrew Lenharth
d56aa55358 Fix a bogus gcc warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28382 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-18 17:29:34 +00:00
Evan Cheng
751458dac9 ImmMask should be 3 for a two-bit field; Compact X86II
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28381 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-18 06:27:15 +00:00
Owen Anderson
ac4c75ba82 Fix some think-o's in my last commit. Thanks to Chris for pointing them out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28380 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-18 05:46:08 +00:00
Owen Anderson
1d8b8535ec Change Module to use TargetData-compatible strings internally.
This is part of the on-going work on PR 761.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28379 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-18 02:10:31 +00:00
Evan Cheng
0f3ac8d8d4 getCalleeSaveRegs and getCalleeSaveRegClasses are no long TableGen'd.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28378 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-18 00:12:58 +00:00
Evan Cheng
0cfd73a9c1 Remove CalleeSavedRegisters from class Target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28377 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-18 00:09:53 +00:00
Reid Spencer
dd1aac36a1 Make some changes suggested by Chris:
1. Remove the LLVM_DO_NOT_BUILD feature (not needed any more)
2. Ensure that lib/VMCore gets built first. This needs to be done because
   VMCore now uses tblgen to generate the Intrinsics header which are
   needed in other libraries. In parallel builds, this can cause problems.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28374 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 22:55:35 +00:00
Owen Anderson
84cc6dbd25 Fix a stupid bug when parsing TargetData strings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28373 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 21:56:02 +00:00
Chris Lattner
7044aac97c Use DIRS here instead of PARALLEL_DIRS, as VMCore has to be built before the
other dirs (for Intrinsics.gen).  :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28372 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 21:54:48 +00:00
Evan Cheng
af78ef526d Use generic iPTR instead i32 to represent pointer type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28371 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 21:21:41 +00:00
Evan Cheng
c8999f2a0a Another entry
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28370 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 21:20:51 +00:00
Evan Cheng
c01d497255 Remove PointerType from class Target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28368 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 21:20:27 +00:00
Chris Lattner
ed96fe8c79 Declare that lowerinvoke doesn't interact with other lowering passes.
Patch written by Domagoj Babic!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28367 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 21:05:27 +00:00
Chris Lattner
d202ca4d98 Fix the result of the call to use a correct vbitconvert. There is no need to
use getPackedTypeBreakdown at all here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28365 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 20:49:36 +00:00
Chris Lattner
1b8daae71b Correct a previous patch which broke CodeGen/PowerPC/vec_call.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28364 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 20:43:21 +00:00
Andrew Lenharth
65b889ffb5 Fix call_adj.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28360 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 19:24:49 +00:00
Andrew Lenharth
3aa92e4e00 Added sanity check for obviously bogus immediates
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28359 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 19:24:31 +00:00
Evan Cheng
4ac8974d02 Should pass by reference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28357 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 19:07:40 +00:00
Evan Cheng
4dfa85d1df Another entry
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28356 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 19:05:31 +00:00
Chris Lattner
9d62fa4d16 Add a note about a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28355 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 19:02:25 +00:00
Chris Lattner
c703a8fbf8 Make PPC call lowering more aggressive, making the isel matching code simple
enough to be autogenerated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28354 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 19:00:46 +00:00
Evan Cheng
7e399c14ab Another typo. Pointed out by Nate Begeman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28353 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 18:22:14 +00:00
Evan Cheng
6c43f35d74 Fixed a LowerCallTo and LowerArguments bug. They were introducing illegal
VBIT_VECTOR nodes. There were some confusion about the semantics of
getPackedTypeBreakdown(). e.g. for <4 x f32> it returns 1 and v4f32, not 4,
and f32.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28352 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 18:16:39 +00:00
Evan Cheng
e9b3da17cd Fix an obvious bug in getPackedTypeBreakdown. Return 1 if type is legal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28351 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 18:10:06 +00:00
Chris Lattner
782e60150e Add a CloneModule call that exposes the mapping of values from the old module
to the new module.  Patch provided by Nick Lewycky!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28349 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 18:05:35 +00:00
Chris Lattner
c5d7d7c715 When we legalize target nodes, do not use getNode to create a new node,
use UpdateNodeOperands to just update the operands!  This is important because
getNode will allocate a new node if the node returns a flag and this breaks
assumptions in the legalizer that you can legalize some things multiple times
and get exactly the same results.

This latent bug was exposed by my ppc patch last night, and this fixes
gsm/toast.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28348 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 18:00:08 +00:00
Chris Lattner
b248e16afd Add an assertion, avoid some unneeded work for each call. No functionality
change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28347 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 17:55:45 +00:00
Chris Lattner
9a2a497284 Switch PPC over to a call-selection model where the lowering code creates
the copyto/fromregs instead of making the PPCISD::CALL selection code create
them.  This vastly simplifies the selection code, and moves the ABI handling
parts into one place.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28346 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 06:01:33 +00:00
Chris Lattner
c8b682ca19 3 changes, 2 of which are cleanup one of which changes codegen:
1. Rearrange code a bit so that the special case doesn't require indenting lots
   of code.
2. Add comments describing PPC calling convention.
3. Only round up to 56-bytes of stack space for an outgoing call if the callee
   is varargs.  This saves a bit of stack space.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28342 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 00:15:40 +00:00
Chris Lattner
c04ba7a97d implement passing/returning vector regs to calls, at least non-varargs calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28341 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-16 23:54:25 +00:00
Chris Lattner
da098e7d10 Add support for calls that pass and return legal vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28340 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-16 23:39:44 +00:00
Chris Lattner
abde460d4f Instead of implementing LowerCallTo directly, let the default impl produce an
ISD::CALL node, then custom lower that.  This means that we only have to handle
LEGAL call operands/results, not every possible type.  This allows us to
simplify the call code, shrinking it by about 1/3.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28339 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-16 22:56:08 +00:00
Chris Lattner
f4ec817299 Add a new ISD::CALL node, make the default impl of TargetLowering::LowerCallTo
produce it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28338 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-16 22:53:20 +00:00
Chris Lattner
af4ec0c56d Simplify the argument counting logic by only incrementing the index.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28335 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-16 18:58:15 +00:00
Chris Lattner
b375b5e629 Simplify the dead argument handling code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28334 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-16 18:54:32 +00:00
Chris Lattner
be4849aabe Vector args passed in registers don't reserve stack space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28333 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-16 18:51:52 +00:00
Chris Lattner
8ab5fe574a Switch the PPC backend over to using FORMAL_ARGUMENTS for formal argument
handling.  This makes the lower argument code significantly simpler (we
only need to handle legal argument types).

Incidentally, this also implements support for vector argument registers,
so long as they are not on the stack.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28331 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-16 18:18:50 +00:00
Andrew Lenharth
3e348494bb this should be 128 I think
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28330 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-16 17:45:23 +00:00
Andrew Lenharth
dae9cbe8d4 Move this code to a common place
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28329 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-16 17:42:15 +00:00
Chris Lattner
aa9406b0c4 Implement the custom lowering hook right, returning values for all of the
arguments at once.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28327 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-16 17:14:26 +00:00
Chris Lattner
e7746c9084 Fix a bug I introduced yesterday, which broke functions with *no* arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28326 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-16 17:08:35 +00:00
Evan Cheng
069287d460 X86 integer register classes naming changes. Make them consistent with FP, vector classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28324 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-16 07:21:53 +00:00
Chris Lattner
f3af4ff005 Make this print the right start pointer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28321 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-16 06:45:50 +00:00
Chris Lattner
8c0c10c2b9 Add a chain to FORMAL_ARGUMENTS. This is a minimal port of the X86 backend,
it doesn't currently use/maintain the chain properly.  Also, make the
X86ISelLowering.cpp file 80-col clean.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28320 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-16 06:45:34 +00:00
Vladimir Prus
e438c2a466 Replace "../whatever.td" with "whatever.td", so that out-of-tree backends
can just add lib/Target to TableGen includes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28318 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-16 06:39:36 +00:00
Chris Lattner
966454129d Move function-live-in-handling code from the sdisel code to the scheduler.
This code should be emitted after legalize, so it can't be in sdisel.

Note that the EmitFunctionEntryCode hook should be updated to operate on the
DAG.  The X86 backend is the only one currently using this hook.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28315 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-16 06:10:58 +00:00
Chris Lattner
4e92027837 Print the vreg that livein physregs are live in
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28314 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-16 05:55:30 +00:00
Chris Lattner
e2e41730cc Legalize FORMAL_ARGUMENTS nodes correctly, we don't want to legalize them once
for each argument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28313 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-16 05:49:56 +00:00
Chris Lattner
00402c7ec3 Fit in 80 cols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28311 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-16 04:20:24 +00:00
Rafael Espindola
1c8f0536b3 add an abort after every assert(0)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28310 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-15 22:34:39 +00:00
Reid Spencer
c64f1488ed For PR777:
Add an additional catch block to ensure that this function can't throw any
exceptions, even one's we're not expecting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28309 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-15 22:12:42 +00:00
Chris Lattner
94ae9d3d2d Improve comment, patch provided by Vladimir Prus!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28307 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-15 18:35:02 +00:00
Chris Lattner
f1d2337be1 Remove some dead code, identified by coverity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28303 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-15 05:48:32 +00:00
Rafael Espindola
7bc59bc395 added a skeleton of the ARM backend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28301 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-14 22:18:28 +00:00
Chris Lattner
6f3ada51aa LoadLibraryPermanently can theoretically throw an exception. Do not propagate
it out of 'ExecutionEngine::create'.  This fixes a problem reported by coverity.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28293 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-14 19:01:55 +00:00
Chris Lattner
f883eb94e0 Bug noticed, by inspection. Filename can be null.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28292 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-14 19:00:53 +00:00
Chris Lattner
505f9c8839 This function is not documented as throwing an exception and callers don't
handle it.  Just silently fail.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28291 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-14 18:53:09 +00:00
Chris Lattner
5b5cc5f2a1 inverted logic, caught by coverity
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28290 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-14 18:46:52 +00:00
Chris Lattner
a0fcc3ee3f remove some dead code identified by coverity
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28289 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-14 18:45:44 +00:00
Chris Lattner
ff8953ae6d remove dead var
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28287 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-14 18:34:36 +00:00
Chris Lattner
36a169e1a3 remove dead variables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28286 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-14 18:33:57 +00:00
Evan Cheng
3e246dd084 Backing out last check-in for now. It's causing an infinite loop gccas lencode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28284 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-14 06:46:03 +00:00
Chris Lattner
506efdaef6 Update comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28283 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-14 02:05:19 +00:00
Evan Cheng
8820ad5154 Fixing 2006-05-01-SchedCausingSpills.ll; some clean up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28279 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-13 08:22:24 +00:00
Evan Cheng
ee00a1d12c Revert an un-intended change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28278 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-13 05:53:47 +00:00
Chris Lattner
033aaaf451 Add/Sub/Mul are safe to promote here as well. Incrementing a single-bit
bitfield now gives this code:

_plus:
        lwz r2, 0(r3)
        rlwimi r2, r2, 0, 1, 31
        xoris r2, r2, 32768
        stw r2, 0(r3)
        blr

instead of this:

_plus:
        lwz r2, 0(r3)
        srwi r4, r2, 31
        slwi r4, r4, 31
        addis r4, r4, -32768
        rlwimi r2, r4, 0, 0, 0
        stw r2, 0(r3)
        blr

this can obviously still be improved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28275 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-13 02:16:08 +00:00
Chris Lattner
a2d079a776 Merge identical code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28274 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-13 02:11:14 +00:00
Chris Lattner
70074e00a2 Implement simple promotion for cast elimination in instcombine. This is
currently very limited, but can be extended in the future.  For example,
we now compile:

uint %test30(uint %c1) {
        %c2 = cast uint %c1 to ubyte
        %c3 = xor ubyte %c2, 1
        %c4 = cast ubyte %c3 to uint
        ret uint %c4
}

to:

_xor:
        movzbl 4(%esp), %eax
        xorl $1, %eax
        ret

instead of:

_xor:
        movb $1, %al
        xorb 4(%esp), %al
        movzbl %al, %eax
        ret

More impressively, we now compile:

struct B { unsigned bit : 1; };
void xor(struct B *b) { b->bit = b->bit ^ 1; }

To (X86/PPC):

_xor:
        movl 4(%esp), %eax
        xorl $-2147483648, (%eax)
        ret
_xor:
        lwz r2, 0(r3)
        xoris r2, r2, 32768
        stw r2, 0(r3)
        blr

instead of (X86/PPC):

_xor:
        movl 4(%esp), %eax
        movl (%eax), %ecx
        movl %ecx, %edx
        shrl $31, %edx
        # TRUNCATE movb %dl, %dl
        xorb $1, %dl
        movzbl %dl, %edx
        andl $2147483647, %ecx
        shll $31, %edx
        orl %ecx, %edx
        movl %edx, (%eax)
        ret

_xor:
        lwz r2, 0(r3)
        srwi r4, r2, 31
        xori r4, r4, 1
        rlwimi r2, r4, 31, 0, 0
        stw r2, 0(r3)
        blr

This implements InstCombine/cast.ll:test30.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28273 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-13 02:06:03 +00:00
Chris Lattner
2144c25364 Remove some dead variables.
Fix a nasty bug in the memcmp optimizer where we used the wrong variable!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28269 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 23:35:26 +00:00
Chris Lattner
a87e9cd069 Remove dead stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28268 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 23:32:01 +00:00
Chris Lattner
12d8f2bafe Fix build breakage :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28267 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 23:26:11 +00:00
Chris Lattner
98d0d7d6f0 More coverity fixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28266 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 21:14:20 +00:00
Chris Lattner
03ea4c8326 Dead variable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28265 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 21:12:22 +00:00
Chris Lattner
b65e7256ed Remove dead var, fix bad override.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28264 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 21:09:57 +00:00
Evan Cheng
3b6d56cab3 If the register allocator cannot find a register to spill, try the aliases. If
that still fails (because all the register spill weights are inf), just grab
one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28262 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 19:07:46 +00:00
Evan Cheng
0bbac9ffd1 Remove dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28261 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 19:03:56 +00:00
Chris Lattner
095cc37e22 Fix accidentally committed patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28260 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 18:20:39 +00:00
Chris Lattner
666b042658 Actually override the right method. :)
Bug identified by coverity.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28259 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 18:19:25 +00:00
Chris Lattner
dd28ba2284 remove dead variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28258 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 18:17:25 +00:00
Chris Lattner
2b80e8d635 Fix iterator invalidation bug, identified by Coverity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28257 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 18:13:11 +00:00
Chris Lattner
bbea1245a1 Fix a hypothetical memory leak, identified by Coverity. In practice, this
object is never deleted though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28256 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 18:10:12 +00:00
Chris Lattner
b5d9319bc5 Remove dead vars
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28255 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 18:06:45 +00:00
Chris Lattner
f1343c1b79 remove dead vars
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28254 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 18:04:28 +00:00
Chris Lattner
c485e55c65 Remove dead variable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28253 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 18:02:04 +00:00
Chris Lattner
5eed34d208 Comment out dead variables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28252 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 17:57:54 +00:00
Reid Spencer
ffb4d62720 When reading the symbol table, make sure to delete the ArchiveMember
created by reading the symbol table.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28251 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 17:56:20 +00:00
Chris Lattner
9dcb780e23 Remove dead var
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28250 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 17:50:35 +00:00
Chris Lattner
82db0696a1 Remove dead variable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28249 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 17:41:45 +00:00
Chris Lattner
b57b516f6d remove dead variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28248 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 17:33:59 +00:00
Chris Lattner
27aaa398ee Remove dead variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28247 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 17:31:21 +00:00
Chris Lattner
e41102bb61 Compile:
%tmp152 = setgt uint %tmp144, %tmp149           ; <bool> [#uses=1]
        %tmp159 = setlt uint %tmp144, %tmp149           ; <bool> [#uses=1]
        %bothcond2 = or bool %tmp152, %tmp159           ; <bool> [#uses=1]

To setne, not setune, which causes an assertion fault.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28244 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 17:03:46 +00:00
Chris Lattner
0949ed5412 Fix PowerPC/2006-05-12-rlwimi-crash.ll
Nate, please verify that if InsertMask is 0, rlwimi shouldn't be used.
This fixes the crash and causes no PPC testsuite regressions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28243 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 16:29:37 +00:00
Owen Anderson
2577c22131 Add a method to generate a string representation from a TargetData.
This continues the work on PR 761.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28239 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 07:01:44 +00:00
Owen Anderson
07000c6f01 Refactor a bunch of includes so that TargetMachine.h doesn't have to include
TargetData.h.  This should make recompiles a bit faster with my current
TargetData tinkering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28238 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 06:33:49 +00:00
Owen Anderson
571a13f3e7 Fix some tabbing issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28237 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 06:06:55 +00:00
Evan Cheng
647c15e58e Backing out fix for PR770. Need to re-apply it after live range splitting is possible
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28236 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 06:06:34 +00:00
Evan Cheng
626da3d9ae Duh. That could take a long time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28235 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 06:05:18 +00:00
Owen Anderson
8f60c56a06 Add a new constructor to TargetData that builds a TargetData from its
string representation.

This is part of PR 761.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28234 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 05:49:47 +00:00
Chris Lattner
21a57dc751 Two simplifications for token factor nodes: simplify tf(x,x) -> x.
simplify tf(x,y,y,z) -> tf(x,y,z).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28233 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 05:01:37 +00:00
Evan Cheng
13d41b9d72 Add capability to scheduler to commute nodes for profit.
If a two-address code whose first operand has uses below, it should be commuted
when possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28230 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 01:58:24 +00:00
Evan Cheng
31ff1ff348 Typo! How did we commute nodes before?!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28229 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 01:46:26 +00:00
Chris Lattner
a5f0419b4e For extra sanity checking, fill free'd memory with garbage so we know that
people aren't reusing machine code buffers at all.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28228 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 00:03:12 +00:00
Chris Lattner
9f3d1ba9ad Fix some bugs in the freelist manipulation code.
Finally, implement ExecutionEngine::freeMachineCodeForFunction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28227 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-11 23:56:57 +00:00
Evan Cheng
e165a78551 Refactor scheduler code. Move register-reduction list scheduler to a
separate file. Added an initial implementation of top-down register pressure
reduction list scheduler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28226 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-11 23:55:42 +00:00
Chris Lattner
e993cc27ad 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! :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28225 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-11 23:08:08 +00:00
Chris Lattner
8c8c66a8cd 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28224 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-11 17:11:52 +00:00
Evan Cheng
f4df680ad4 Add MOV16_rm / MOV32_rm and MOV16_mr / MOV32_mr to isLoadFromStackSlot and isStoreToStackSlot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28223 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-11 07:33:49 +00:00
Evan Cheng
993141402f Set weight of zero length intervals to infinite to prevent them from being
spilled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28220 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-11 07:29:24 +00:00
Evan Cheng
5d02eafaf2 Backing out previous check-in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28219 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-11 07:28:16 +00:00
Evan Cheng
1f300190f3 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28217 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-10 22:30:41 +00:00
Chris Lattner
f4f5a77fdc 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28215 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-10 19:00:36 +00:00
Chris Lattner
3e6a35076e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28213 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-10 06:38:32 +00:00
Evan Cheng
90db0358bb Templatify RegReductionPriorityQueue
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28212 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-10 06:16:44 +00:00
Chris Lattner
e46749cce0 Add an assertion for a common error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28210 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-10 04:32:43 +00:00
Nate Begeman
ec57fd91af Fix PR773
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28207 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 18:20:51 +00:00
Chris Lattner
c8d37c6e14 Fix a regression in my patch from last night that broke the llvmgcc4 build on
ppc


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28205 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 16:41:59 +00:00
Chris Lattner
219f1b535d Indent .data/.text in the .s file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28204 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 16:15:00 +00:00
Evan Cheng
b63b067925 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".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28201 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 07:13:34 +00:00
Evan Cheng
60e8c71c9f Debugging info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28200 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 06:55:15 +00:00
Evan Cheng
8399c5cbe4 Remove a completed entry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28199 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 06:54:05 +00:00
Evan Cheng
e73701df94 PR 770 - permit coallescing of registers in subset register classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28197 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 06:37:48 +00:00
Chris Lattner
7faec9b93a Implement MASM sections correctly, without a "has masm sections flag" and a bunch of special case code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28194 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 05:33:48 +00:00
Chris Lattner
a7090ae7a3 Oh yeah, there are two of these now, unify both.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28192 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 05:24:50 +00:00
Chris Lattner
b81cb6133e Setting SwitchToSectionDirective properly in the MASM backend permits a bunch
of code to be unified.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28191 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 05:23:12 +00:00
Chris Lattner
c9260a1556 MASM doesn't have one of these.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28190 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 05:21:47 +00:00
Chris Lattner
23b9eac4cb Don't prefix section directives with a tab. Doing so causes blank lines to
be emitted to the .s file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28189 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 05:19:59 +00:00
Chris Lattner
13f161c518 Make the masm codepath work like the normal code path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28188 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 05:15:58 +00:00
Chris Lattner
e7027d5339 Preserve prior behavior
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28187 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 05:15:24 +00:00
Chris Lattner
4ca4bb1ed2 The MASM asmprinter has been fixed, these hacks are no longer needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28186 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 05:13:34 +00:00
Chris Lattner
dad9c5a14f Fix the MASM asmprinter's lies. It does not want to emit code to .text/.data
it wants it emitted to _text/_data.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28185 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 05:12:53 +00:00
Chris Lattner
4632d7a570 Split SwitchSection into SwitchTo{Text|Data}Section methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28184 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 04:59:56 +00:00
Chris Lattner
4c15e33946 Some notes and thoughts to myself
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28182 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 04:58:46 +00:00
Chris Lattner
8d89e7bdbc Patch to make some xforms preserve each other. Patch contributed by
Domagoj Babic!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28181 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 04:13:41 +00:00
Chris Lattner
e7fd553b3b Move some methods out of line so that MutexGuard.h isn't needed in a public header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28179 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-08 22:00:52 +00:00
Chris Lattner
9fd868ae0a Another bad case I noticed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28177 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-08 21:39:45 +00:00
Chris Lattner
8ef67ac3c3 add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28176 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-08 21:24:21 +00:00
Chris Lattner
4b37e87ab9 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28175 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-08 21:18:59 +00:00
Chris Lattner
eaeda56649 Implement and_sext.ll:test3, generating:
_test4:
        srawi r3, r3, 16
        blr

instead of:

_test4:
        srwi r2, r3, 16
        extsh r3, r2
        blr

for:

short test4(unsigned X) {
  return (X >> 16);
}


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28174 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-08 20:59:41 +00:00
Nate Begeman
7514620052 Yet more readme updating
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28172 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-08 20:54:02 +00:00
Chris Lattner
a850446a0b Compile this:
short test4(unsigned X) {
  return (X >> 16);
}

to:

_test4:
        movl 4(%esp), %eax
        sarl $16, %eax
        ret

instead of:

_test4:
        movl $-65536, %eax
        andl 4(%esp), %eax
        sarl $16, %eax
        ret


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28171 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-08 20:51:54 +00:00
Nate Begeman
fcf64a91d6 New note about something bad happening in target independent optimizers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28170 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-08 20:08:28 +00:00
Nate Begeman
d8624ed07f Proving once again that I am not as smart as the compiler
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28169 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-08 19:09:24 +00:00
Nate Begeman
4667f2cbad Fold more shifts into inserts, and update the README
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28168 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-08 17:38:32 +00:00
Chris Lattner
2cfd6746ae Fold shifts with undef operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28167 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-08 17:29:49 +00:00
Chris Lattner
1b7371331f When tracking demanded bits, if any bits from the sext of an SRA are demanded,
then so is the input sign bit.  This fixes mediabench/g721 on X86.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28166 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-08 17:22:53 +00:00