Commit Graph

39523 Commits

Author SHA1 Message Date
Matthijs Kooijman
7e43b3be88 80 column and trailing whitespace fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52539 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 15:34:07 +00:00
Matthijs Kooijman
df0891d2ff Don't let DeadArgumentElimination attempt to update callers when the return
type wasn't changed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52538 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 15:25:43 +00:00
Matthijs Kooijman
03d18569cb Don't let DeadArgElimination change the return type ({} into void and {T}
into T) when no return values are actually dead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52537 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 15:16:45 +00:00
Matthijs Kooijman
9cb6ec26b3 Explicitely track if any arguments or return values were removed in
DeadArgumentElimination and assert that the function type does not change if
nothing was changed. This should catch subtle changes in function type that are
not intended.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52536 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 14:28:52 +00:00
Matthijs Kooijman
1b492b2f8d Remove debug output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52535 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 14:03:35 +00:00
Matthijs Kooijman
c95e44b4e0 Recommit r52459, rewriting of the dead argument elimination pass.
This is a fixed version that no longer uses multimap::equal_range, which
resulted in a pointer invalidation problem.

Also, DAE::InspectedFunctions was not really necessary, so it got removed.

Lastly, this version no longer applies the extra arg hack on functions who did
not have any arguments to start with.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52532 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 09:36:16 +00:00
Owen Anderson
f2204d7bb1 Really disable PRE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52531 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 08:59:13 +00:00
Chris Lattner
f6af087cb9 "Just a small update for the project files for adding a missing preprocessor
definition for VS2005 (without SP1). It suppress the (bogus) M$ deprecated
warning."

Patch by Cédric Venet!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52530 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 05:35:58 +00:00
Chris Lattner
a3de6e9ab8 Fix a warning, closing PR2452
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52529 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 05:33:29 +00:00
Chris Lattner
3e64ff6832 Fix a warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52528 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 05:31:04 +00:00
Chris Lattner
ec91ccba3c Fix an error handling redefinition of linkonce functions where the
types differ.  Patch by Nathan Keynes!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52527 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 05:29:39 +00:00
Chris Lattner
6624602197 fix a warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52526 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 05:28:56 +00:00
Chris Lattner
2de3fec61c Fix PR2471, which is a bug involving an invalid promotion from a conditional load.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52525 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 05:12:56 +00:00
Chris Lattner
28e6ff57d4 Fix typo, fix suggested by Nicholas Olsen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52524 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 05:03:17 +00:00
Gordon Henriksen
54227f6752 Add C binding for ExecutionEngine::addGlobalMapping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52523 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 02:16:11 +00:00
Dan Gohman
ab8ec0a26c Teach ReturnInst lowering about aggregate return values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52522 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 01:29:26 +00:00
Owen Anderson
6fafe847b2 Change around the data structures used to store availability sets, resulting in a GVN+PRE that is faster that GVN alone was before.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52521 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 01:15:47 +00:00
Dan Gohman
c4b65ea56b Teach SCCP about insertvalue and extractvalue, and about
propagating constants across aggregate return values when
insertvalue and extractvalue are used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52520 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 01:15:44 +00:00
Dan Gohman
2c31750cd0 Teach InlineFunction how to differentiate between multiple-value
return statements and aggregate returns so that it handles both
correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52519 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 01:03:44 +00:00
Evan Cheng
88d11c03cd Disable PRE for now. It seems to be breaking llvm-gcc bootstrapping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52518 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 01:01:07 +00:00
Dan Gohman
dded0fd398 Fix the index calculations for the extractvalue lowering code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52517 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 00:54:19 +00:00
Dan Gohman
8f36f6d117 Simplify the ComputeLinearIndex logic and fix a few bugs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52516 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 00:53:00 +00:00
Dan Gohman
65c6795af4 It's invalid to take the one-past-the-end address of a non-array
object.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52515 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 00:49:21 +00:00
Dan Gohman
09ef00f979 Simplify this code. Thanks Chris!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52514 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 00:47:44 +00:00
Evan Cheng
c8af52c898 ISD::UNDEF should be expanded recursively / iteratively.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52508 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 22:01:11 +00:00
Owen Anderson
aa0b63422a Add a hidden -disable-pre flag for testing purposes. This should be removed
once benchmarking is completed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52506 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 19:57:25 +00:00
Owen Anderson
5c274eebc6 PRE requires that critical edges be split.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52505 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 19:54:19 +00:00
Bill Wendling
ac151da204 Remove dead code causing a warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52502 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 18:00:44 +00:00
Dan Gohman
52d36e6f87 Use the common API for adding instructions to basic blocks instead of
using BasicBlock::getInstList.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52500 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 17:53:32 +00:00
Owen Anderson
9da52dce89 Be sure to remove values from the value numbering table after we delete them.
This fixes a failure on povray.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52499 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 17:53:26 +00:00
Dan Gohman
d02d917c72 Use Instruction::moveBefore instead of manipulating the instruction list
directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52498 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 17:47:47 +00:00
Dan Gohman
610c0e2b40 Avoid using BasicBlock::getInstList directly in a few places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52497 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 17:37:25 +00:00
Owen Anderson
3cd8eb314a Revert support for insertvalue and extractvalue instructions for the moment.
GVN expects that all inputs which to an instruction fall somewhere in the value
hierarchy, which isn't true for these.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52496 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 17:25:39 +00:00
Dan Gohman
04478e56f7 Use the transferSuccessors helper function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52495 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 17:22:29 +00:00
Dan Gohman
f3dc70092c Delete dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52494 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 17:18:39 +00:00
Owen Anderson
5678d6e8d3 Add an idx_iterator to the insertvalue and extractvalue instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52493 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 17:15:57 +00:00
Dan Gohman
e6807551cb The inline keyword goes before the return type. This fixes a compiler warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52492 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 16:16:06 +00:00
Matthijs Kooijman
3d2ff5f939 Modify some ipconstprop tests to also test with invokes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52491 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 09:27:44 +00:00
Matthijs Kooijman
f0da2039d1 Use a CallSite to find the nth argument of a call/invoke instruction instead of
using getOperand() directly. This makes things work with invoke instructions as
well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52489 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 08:53:24 +00:00
Duncan Sands
9954c76f2c Fix some warnings reported by gcc-4.3. Hopefully
this still compiles on windows - I can't test!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52488 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 08:47:31 +00:00
Evan Cheng
32a3ac7911 Missed a check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52487 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 06:17:19 +00:00
Eli Friedman
2c8e64d3e4 Fix a bug with <8 x i16> shuffle lowering on X86 where parts of the
shuffle could be skipped.  The check is invalid because the loop index i 
doesn't correspond to the element actually inserted. The correct check is
already done a few lines earlier, for whether the element is already in 
the right spot, so this shouldn't have any effect on the codegen for 
code that was already correct.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52486 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 06:09:51 +00:00
Owen Anderson
29b039976f Revert my last patch, which was causing regression test failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52485 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 05:29:34 +00:00
Evan Cheng
0d46d753f9 New test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52483 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 01:50:24 +00:00
Evan Cheng
72d255aff9 This also got better (55 - 51 instructions). But doing one more re-materialization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52482 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 01:50:13 +00:00
Evan Cheng
81d39e63e2 This got better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52481 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 01:46:43 +00:00
Evan Cheng
e00f5de361 Coalesce copy from one register class to a sub register class. e.g. X86::MOV16to16_.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52480 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 01:39:21 +00:00
Evan Cheng
1b38ec83f0 Cosmetic changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52479 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 01:21:26 +00:00
Evan Cheng
082e7c12a1 Unneeded include's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52478 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 01:21:02 +00:00
Evan Cheng
bdf34bc12b Minor spiller tweak to unfavor reload into load/store instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52477 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 01:16:17 +00:00