Commit Graph

1614 Commits

Author SHA1 Message Date
Chris Lattner
f83e13ae0a add a testcase for forming memset from noncontiguous stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48938 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-29 04:51:35 +00:00
Evan Cheng
d34af7875b Handle a special case xor undef, undef -> 0. Technically this should be transformed to undef. But this is such a common idiom (misuse) we are going to handle it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48791 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 20:07:13 +00:00
Tanya Lattner
6f729d601c Byebye llvm-upgrade!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48762 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 04:26:08 +00:00
Devang Patel
60a12907c3 Add incoming value from header only if phi node has any use inside the loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48738 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-24 20:16:14 +00:00
Chris Lattner
0b26a31ae6 apparently tclsh doesn't lex like bash. Weird.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48732 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-24 17:41:57 +00:00
Chris Lattner
263250b131 pass the option so this test tests the right thing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48731 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-24 17:36:38 +00:00
Evan Cheng
b98a10e8a3 Transform (zext (or (icmp), (icmp))) to (or (zext (cimp), (zext icmp))) if at least one of the (zext icmp) can be transformed to eliminate an icmp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48715 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-24 00:21:34 +00:00
Owen Anderson
856254026f Use normal naming convention for test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48693 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-22 21:08:33 +00:00
Chris Lattner
b017c9e89c implement an initial hack at a straight-line store -> memset optimization.
This fires dozens of times across spec and multisource, but I don't know
if it actually speeds stuff up.  Hopefully the testers will show something
nice :)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48680 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-22 05:37:16 +00:00
Chris Lattner
41dc0fcb68 Teach masked value is zero about add and sub, and use MVIZ to
simplify things like (X & 4) >> 1 == 2  --> (X & 4) == 4.

since it is obvious that the shift doesn't remove any bits.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48631 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-21 05:19:58 +00:00
Tanya Lattner
e6d5d39c07 Upgrade tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48538 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 07:28:33 +00:00
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