Commit Graph

43093 Commits

Author SHA1 Message Date
Dan Gohman
15511cf166 Rename isSimpleLoad to canFoldAsLoad, to better reflect its meaning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60487 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 18:15:48 +00:00
Dan Gohman
8cf7713753 Extend X86's addFrameReference to add a MachineMemOperand for
the frame reference. This will help post-RA scheduling determine
that spills to distinct stack slots are independent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60486 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 18:11:40 +00:00
Rafael Espindola
3eda88ed9f Fix some tests. The grep for "il" was matching "file".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60485 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 17:14:56 +00:00
Dan Gohman
f033b5a393 Update a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60484 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 17:10:41 +00:00
Duncan Sands
8b8e5a7f96 Only check that the result of the mapping was not
a new node if the node was actually remapped.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60482 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 12:36:16 +00:00
Rafael Espindola
952b839ce9 Fix bug 3140.
Print a single parameter .file directive if we have an ELF target.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60480 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 11:01:37 +00:00
Richard Osborne
269bc0042f Add support for ISD::TRAP to the XCore backend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60479 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 10:59:16 +00:00
Evan Cheng
370e5340a5 Refactor code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60478 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 08:38:43 +00:00
Bill Wendling
0ea25cb941 CC should only be a ConstantSDNode at this point. Just use 'cast' instead of 'dyn_cast'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60477 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 08:32:02 +00:00
Evan Cheng
c19065150b Fix test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60476 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 08:20:45 +00:00
Chris Lattner
2a5dc33c57 testcase for br undef folding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60471 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 07:48:27 +00:00
Chris Lattner
421fa9e32e Teach jump threading some more simple tricks:
1) have it fold "br undef", which does occur with
   surprising frequency as jump threading iterates.
2) teach j-t to delete dead blocks.  This removes the successor
   edges, reducing the in-edges of other blocks, allowing 
   recursive simplification.
3) Fold things like:
     br COND, BBX, BBY
  BBX:
     br COND, BBZ, BBW

   which also happens because jump threading iterates.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60470 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 07:48:08 +00:00
Chris Lattner
2973a25dbc third time is the charm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60469 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 07:45:15 +00:00
Chris Lattner
15efa1a1fd fix assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60468 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 07:43:05 +00:00
Chris Lattner
1ea7771e09 don't spew tons of stuff to the output. This testcase is *not* for
loop deletion (it is for a ton of passes), which is very bad.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60465 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 06:41:50 +00:00
Chris Lattner
71af9b07a5 Rename DeleteBlockIfDead to DeleteDeadBlock and make it
unconditionally delete the block.  All likely clients will
do the checking anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60464 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 06:40:52 +00:00
Chris Lattner
2b1ba24fb7 Factor some code out of SimplifyCFG, forming a new
DeleteBlockIfDead method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60463 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 06:37:44 +00:00
Dan Gohman
62c939d7d5 Mark x86's V_SET0 and V_SETALLONES with isSimpleLoad, and teach X86's
foldMemoryOperand how to "fold" them, by converting them into constant-pool
loads. When they aren't folded, they use xorps/cmpeqd, but for example when
register pressure is high, they may now be folded as memory operands, which
reduces register pressure.

Also, mark V_SET0 isAsCheapAsAMove so that two-address-elimination will
remat it instead of copying zeros around (V_SETALLONES was already marked).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60461 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 05:21:24 +00:00
Bill Wendling
b3cf03cee1 Change label to 'carry' for unsigned adds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60460 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 02:43:12 +00:00
Dan Gohman
41474baac8 Add a sanity-check to tablegen to catch the case where isSimpleLoad
is set but mayLoad is not set. Fix all the problems this turned up.

Change code to not use isSimpleLoad instead of mayLoad unless it
really wants isSimpleLoad.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60459 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 02:30:17 +00:00
Dan Gohman
c70f329543 Fix a missing #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60458 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 02:10:00 +00:00
Dan Gohman
03e7d834d5 Add an explicit keyword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60457 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 01:55:47 +00:00
Dan Gohman
92faff2e4c Replace a #include with a forward-declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60456 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 01:53:18 +00:00
Dan Gohman
c5a1a220ea Fix this comment to reflect that it applies to types other
than just i32.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60455 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 01:39:44 +00:00
Dan Gohman
e4300e271a Fix byval arguments in the fastcc calling convention. The fastcc convention
delegates to the regular x86-32 convention which handles byval, but only
after it handles a few cases, and it's necessary to handle byval before
handling those cases. This fixes PR3122 (and rdar://6400815), llvm-gcc
miscompiling LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60453 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 01:28:04 +00:00
Dan Gohman
7f9b35200b Add nounwind attributes to this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60451 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 01:10:18 +00:00
Dale Johannesen
3cc1b8d9c6 testcases for recent dag combiner changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60449 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 00:52:41 +00:00
Chris Lattner
1d93b2e1b6 Fix isIntN to work with APInts > 64 bits. This method is only
used by clang apparently.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60446 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 23:33:29 +00:00
Evan Cheng
96da041949 Remove a (what appears to be) overly strict assertion. Here is what happened:
1. ppcf128 select is expanded to f64 select's.
2. f64 select operand 0 is an i1 truncate, it's promoted to i32 zero_extend.
3. f64 select is updated. It's changed back to a "NewNode" and being re-analyzed.
4. f64 select operands are being processed. Operand 0 is a "NewNode". It's being expunged out of ReplacedValues map.
5. ExpungeNode tries to remap f64 select and notice it's a "NewNode" and assert.
Duncan, please take a look. Thanks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60443 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 21:57:09 +00:00
Dale Johannesen
fb10cd4901 Minor rewrite per review feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60442 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 21:17:11 +00:00
Scott Michel
546d7b5c4a Non-functional change: make custom lowering for truncate stylistically
consistent with the way it's generally done in other places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60439 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 19:55:08 +00:00
Scott Michel
b30e8f6334 CellSPU:
- Incorporate Tilmann Scheller's ISD::TRUNCATE custom lowering patch
- Update SPU calling convention info, even if it's not used yet (but can be
  at some point or another)
- Ensure that any-extended f32 loads are custom lowered, especially when
  they're promoted for use in printf.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60438 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 19:53:53 +00:00
Dan Gohman
d118342b25 Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60434 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 19:27:20 +00:00
Owen Anderson
7b9d67c5bf Add support for folding spills into preceding defs when doing pre-alloc splitting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60433 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 18:53:47 +00:00
Dale Johannesen
34d7985927 One more transformation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60432 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 18:40:40 +00:00
Dale Johannesen
eccdd08d4c Make the code do what the comment says it does.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60431 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 18:40:09 +00:00
Chris Lattner
01c8e0233d Comment typeo fix, thanks Duncan!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60429 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 18:33:11 +00:00
Tilmann Scheller
b0a5cdd451 make it possible to custom lower TRUNCATE (needed for the CellSPU target)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60409 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 12:12:25 +00:00
Chris Lattner
c89c6a964c Implement PRE of loads in the GVN pass with a pretty cheap and
straight-forward implementation.  This does not require any extra
alias analysis queries beyond what we already do for non-local loads.

Some programs really really like load PRE.  For example, SPASS triggers
this ~1000 times, ~300 times in 255.vortex, and ~1500 times on 403.gcc.

The biggest limitation to the implementation is that it does not split
critical edges.  This is a huge killer on many programs and should be
addressed after the initial patch is enabled by default.

The implementation of this should incidentally speed up rejection of 
non-local loads because it avoids creating the repl densemap in cases 
when it won't be used for fully redundant loads.

This is currently disabled by default.
Before I turn this on, I need to fix a couple of miscompilations in
the testsuite, look at compile time performance numbers, and look at
perf impact.  This is pretty close to ready though.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60408 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 08:16:11 +00:00
Nick Lewycky
48dd644109 Add a new SCEV representing signed division.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60407 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 08:05:48 +00:00
Mon P Wang
fb13f008cb Removed some unnecessary code in widening.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60406 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 07:35:08 +00:00
Chris Lattner
c7f7c1dc50 add a little helper function that does PHI translation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60405 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 07:16:45 +00:00
Chris Lattner
88d84b245c add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60404 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 06:32:34 +00:00
Bill Wendling
286a054908 Remove some errors that crept in. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60403 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 06:24:20 +00:00
Bill Wendling
d16c6e9993 Merge two if-statements into one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60402 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 06:22:04 +00:00
Bill Wendling
29976b9e12 More styalistic changes. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60401 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 06:18:11 +00:00
Chris Lattner
b6bbe6320b add densemap range insertion method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60400 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 06:08:04 +00:00
Bill Wendling
3bdcda82a5 - Remove the buggy -X/C -> X/-C transform. This isn't valid when X isn't a
constant. If X is a constant, then this is folded elsewhere.

- Added a note to Target/README.txt to indicate that we'd like to implement
  this when we're able.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60399 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 05:12:47 +00:00
Bill Wendling
a8bb13f989 Improve comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60398 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 05:09:00 +00:00
Bill Wendling
dda74e0702 - Reduce nesting.
- No need to do a swap on a canonicalized pattern.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60397 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 05:06:43 +00:00