Commit Graph

1603 Commits

Author SHA1 Message Date
Tanya Lattner
ce7d5db4d8 Upgrade tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48536 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 05:39:35 +00:00
Tanya Lattner
7f40dea2f1 Upgrade tests to not use llvm-upgrade.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48530 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 04:36:04 +00:00
Tanya Lattner
f396cc8730 Upgrade tests to not use llvm-upgrade.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48529 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 04:14:49 +00:00
Tanya Lattner
3a4c856323 Remove llvm-upgrade and update tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48527 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 03:47:13 +00:00
Tanya Lattner
683283763f Upgrade tests to not use llvm-upgrade.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48484 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-18 04:14:37 +00:00
Tanya Lattner
f04d8d1593 Upgrade tests to not use llvm-upgrade.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48483 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-18 03:45:45 +00:00
Bill Wendling
b9d4f8df70 The inst combining of inttoptr into GEP with one index was using the bit size of
the type instead of the byte size. This was causing troublesome mis-compilations.

True to form, this took 2 days to find and is a one-line fix. :-P


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48354 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-14 05:12:19 +00:00
Owen Anderson
8a97fddbc2 Fix a bug in GVN that Duncan noticed, where we potentially need to insert a
pointer bitcast when performing return slot optimization.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48343 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-13 22:07:10 +00:00
Owen Anderson
6bb0bd52ec Improve the return slot optimization to be both more aggressive (not limited to sret parameters), and
safer (when the passed pointer might be invalid).  Thanks to Duncan and Chris for the idea behind this, 
and extra thanks to Duncan for helping me work out the trap-safety.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48280 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-12 07:37:44 +00:00
Devang Patel
8f9b551147 Fix attribute handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48262 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-12 00:07:03 +00:00
Devang Patel
7db30ba701 Handle multiple ret values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48254 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-11 22:24:29 +00:00
Dan Gohman
882d87d168 Check to see if a two-entry PHI block can be simplified
before trying to merge the block into its predecessors.
This allows two-entry-phi-return.ll to be simplified
into a single basic block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48252 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-11 21:53:06 +00:00
Dan Gohman
a8ab8938a7 Make this test more challenging to help it avoid being
optimized away before it tests what it is intended to test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48251 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-11 21:47:57 +00:00
Devang Patel
7c490d4104 Initial multiple return values support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48210 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-11 05:46:42 +00:00
Dan Gohman
43ca31e3dc Upgrade this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48207 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-11 02:19:59 +00:00
Devang Patel
3e030e41ae Simplify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48163 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10 18:38:30 +00:00
Tanya Lattner
ceca194c43 Remove llvm-upgrade and update tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48137 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10 07:21:50 +00:00
Nick Lewycky
9be3c97183 Turn unwind_to into "unwinds to".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48123 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10 02:20:00 +00:00
Tanya Lattner
76806b6a43 Remove llvm-upgrade and update tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48103 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09 08:16:40 +00:00
Nick Lewycky
3f4cc3101e Firstly, having a BranchInst isn't exclusive with having an unwind_to.
Secondly, we have to check whether the branch is actually pointing to the block
with the unwind in it. We could have gotten here because of the unwind_to alone.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48099 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09 07:50:37 +00:00
Nick Lewycky
db96ae9607 A BB that unwind_to an "unwind" inst is that same as one that doesn't unwind_to
at all.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48096 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09 07:36:38 +00:00
Nick Lewycky
6af31aab63 Update the inliner and simplifycfg to handle unwind_to.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48086 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09 05:10:13 +00:00
Nick Lewycky
c0d025f54f Prune the unwind_to labels on BBs that don't need them. Another step in the
removal of invoke, PR1269.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48084 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09 04:55:16 +00:00
Devang Patel
12a466b9d0 Update inliner to handle functions that return multiple values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48020 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-07 20:06:16 +00:00
Devang Patel
160e08fb3e Place for sret promotion tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48016 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-07 20:00:15 +00:00
Nick Lewycky
64df3bc625 Commit the testcase too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47988 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-06 06:50:03 +00:00
Nick Lewycky
c1a2a61201 Don't try to simplify urem and srem using arithmetic rules that don't work
under modulo (overflow). Fixes PR1933.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47987 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-06 06:48:30 +00:00
Devang Patel
37963556e3 Use cast instead of dyn_cast.
Update test to use multiple return value directly, instead of relying on -sretpromotion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47907 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-04 21:45:28 +00:00
Devang Patel
dc00d42bb1 Handle multiple return values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47904 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-04 21:15:15 +00:00
Tanya Lattner
ec9a35a6f9 Remove llvm-upgrade and update test cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47793 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-01 09:15:35 +00:00
Chris Lattner
9d34c4d678 fix a bug Anders ran into where scalarrepl would crash when promoting
a union containing a vector and an array whose elements were smaller than
the vector elements.  this means we need to compile the load of the 
array elements into an extract element plus a truncate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47752 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-29 07:12:06 +00:00
Chris Lattner
5ebd93630b Folding or(fcmp,fcmp) only works if the operands of the fcmps are the same fp type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47750 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-29 06:09:11 +00:00
Owen Anderson
bf931bb094 Add PR number to testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47640 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 23:16:11 +00:00
Owen Anderson
77db50f68f Fix an issue where GVN had the sizes of the two memcpy's reverse, resulting
in an invalid transformation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47639 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 23:06:17 +00:00
Chris Lattner
36ab30102a fix this test so that the fn name doesn't match the regex
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47608 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 18:13:51 +00:00
Gabor Greif
72c8f0d156 Really feed llvm-as with the testcase, do not let it read from stdin. This fixes the hangs seen on solaris10.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47604 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 13:37:13 +00:00
Owen Anderson
c0808a7e1d Fix an issue where GVN was performing the return slot optimization when it was
not safe.  This is fixed by more aggressively checking that the return slot is
not used elsewhere in the function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47544 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 04:08:09 +00:00
Owen Anderson
0f7ea1ab10 Fix an issue where GVN would try to use an instruction before its definition when performing return slot optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47541 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 00:40:41 +00:00
Zhou Sheng
f65a0f7860 Testcase for Revision 47478.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47531 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 10:59:51 +00:00
Nick Lewycky
e0cfecf47d Correctly fold divide-by-constant, even when faced with overflow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47287 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 22:48:05 +00:00
Chris Lattner
ea0415957d make this just a bit more strict.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47274 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 17:33:10 +00:00
Owen Anderson
5aa4f2a085 Add support to GVN for performing sret return slot optimization. This means that, if an sret function tail calls
another sret function, it should pass its own sret parameter to the tail callee, allowing it to fill in the correct
return value.  llvm-gcc does not emit this by default.  Instead, it allocates space in the caller for the sret of
the tail call and then uses memcpy to copy the result into the caller's sret parameter.  This optimization detects
and optimizes that case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47265 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 09:24:53 +00:00
Chris Lattner
bf1d8a7099 optimize away stackrestore calls that have no intervening alloca or call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47258 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 06:12:38 +00:00
Chris Lattner
28cb2051c8 upgrade this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47257 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 06:11:00 +00:00
Chris Lattner
dd12f96c5e Fold (-x + -y) -> -(x+y) which promotes better association, fixing
the second half of PR2047


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47244 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-17 21:03:36 +00:00
Chris Lattner
0b0803ae15 Split up subtracts into add+negate if they have a reassociable use or operand
that is also a subtract.  This implements PR2047 and Transforms/Reassociate/subtest2.ll 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47241 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-17 20:51:26 +00:00
Chris Lattner
f06c3c29ac upgrade and simplify this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47240 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-17 20:48:43 +00:00
Duncan Sands
3d5378ff8e Remove any 'nest' parameter attributes if the function
is not passed as an argument to a trampoline intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47220 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-16 20:56:04 +00:00
Devang Patel
9b03daa2a3 If loop header is also loop exiting block then OrigPN is incoming value for B loop header.
Fixes PR 2030.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47141 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 23:18:47 +00:00
Chris Lattner
8c5c22f610 Fix PR2029
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47129 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 19:18:13 +00:00