1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

2448 Commits

Author SHA1 Message Date
Andrew Trick
bbb5c7b0aa SCEV: Use AssertingVH to catch dangling BasicBlock* when passes forget
to notify SCEV of a change. Add forgetLoop in a couple of those places.

llvm-svn: 136797
2011-08-03 18:32:11 +00:00
Chris Lattner
d4b0ee77a9 fix PR10286, a problem with the .ll printer handling block addresses that are out-of-scope.
llvm-svn: 136768
2011-08-03 06:15:41 +00:00
Nick Lewycky
82418c24b8 Fix logical error when detecting lifetime intrinsics.
Don't replace a gep/bitcast with 'undef' because that will form a "free(undef)"
which in turn means "unreachable". What we wanted was a no-op. Instead, analyze
the whole tree and look for all the instructions we need to delete first, then
delete them second, not relying on the use_list to stay consistent.

llvm-svn: 136752
2011-08-03 00:43:35 +00:00
Nick Lewycky
05fed81aa9 Teach InstCombine that lifetime intrincs aren't a real user on the result of a
malloc call.

llvm-svn: 136732
2011-08-02 22:08:01 +00:00
Nick Lewycky
2f04a6b411 Lifetime intrinsics on undef are dead.
llvm-svn: 136722
2011-08-02 21:19:27 +00:00
Benjamin Kramer
5aff5a9498 Remove empty test.
llvm-svn: 136675
2011-08-02 02:47:45 +00:00
Owen Anderson
1d291c9425 Revert r136503 and r136480 in an effort to fix non-determinism in the llvm-gcc buildbots on i386. Devang is looking into the root cause.
llvm-svn: 136674
2011-08-02 02:23:42 +00:00
Rafael Espindola
92b7e5d6e5 Add a small gep optimization I noticed was missing while reading some IL.
llvm-svn: 136585
2011-07-31 04:43:41 +00:00
Devang Patel
3750561b36 Clean up debug info after reassociation.
llvm-svn: 136480
2011-07-29 19:00:35 +00:00
Eli Friedman
a07aa98eff Make sure to correctly clear the exact/nuw/nsw flags off of shifts when they are combined together. <rdar://problem/9859829>
llvm-svn: 136435
2011-07-29 00:18:19 +00:00
Nick Lewycky
59edfce6f7 Teach the ConstantMerge pass about alignment. Fixes PR10514!
llvm-svn: 136250
2011-07-27 19:47:34 +00:00
Nick Lewycky
271216a67b Finish adding support for lifetime intrinsics to SROA. Fixes PR10121!
llvm-svn: 136008
2011-07-25 23:14:22 +00:00
Dan Gohman
1c4dff0ab3 Move the last uses of RetainFunc etc. over to using getRetainCallee() etc.
so that a declaration for objc_retain is created when needed if it doesn't
already exist. rdar://9825114.

llvm-svn: 135821
2011-07-22 22:29:21 +00:00
Dan Gohman
b320950f65 Fix MergeInVectorType to check for vector types with the same alloc
size but different element types, so that it filters out the cases
that CreateShuffleVectorCast doesn't handle. This fixes rdar://9786827.

llvm-svn: 135721
2011-07-21 23:30:09 +00:00
Andrew Trick
1f9b4f8617 LSR, correct fix for rdar://9786536. Silly casting bug.
llvm-svn: 135654
2011-07-21 01:45:54 +00:00
Andrew Trick
ebf9ee5200 LSR must sometimes sign-extend before generating double constants.
rdar://9786536

llvm-svn: 135650
2011-07-21 01:05:01 +00:00
Andrew Trick
4b641bba84 LSR crashes on an empty IVUsers list.
rdar://9786536

llvm-svn: 135644
2011-07-21 00:40:04 +00:00
Eli Friedman
f98434b2c7 Bring LICM into compliance with the new "Memory Model for Concurrent Operations" in LangRef.
llvm-svn: 135625
2011-07-20 21:37:47 +00:00
Andrew Trick
57280c0f11 indvars: Added getInsertPointForUses to find a valid place to truncate the IV.
llvm-svn: 135568
2011-07-20 05:32:06 +00:00
Andrew Trick
d2b268558b indvars test case for r135558.
llvm-svn: 135559
2011-07-20 02:14:37 +00:00
Andrew Trick
ee2d72e5f1 indvars -disable-iv-rewrite fix: derived GEP IVs
llvm-svn: 135558
2011-07-20 02:08:58 +00:00
Eli Friedman
f809f44cf5 PR10386: Don't try to split an edge from an indirectbr.
llvm-svn: 135534
2011-07-19 22:59:41 +00:00
Nick Lewycky
7c36f4590e Remove bogus test: for all possible inputs of %X, the 'sub nsw' is guaranteed
to perform a signed wrap. Don't rely on any particular handling of that case.

llvm-svn: 135471
2011-07-19 08:22:57 +00:00
Andrew Trick
ba37b6516a indvars: LinearFunctionTestReplace for non-canonical IVs.
For -disable-iv-rewrite, perform LFTR without generating a new
"canonical" induction variable. Instead find the "best" existing
induction variable for use in the loop exit test and compute the final
value of that IV for use in the new loop exit test. In short,
convert to a simple eq/ne exit test as long as it's cheap to do so.

llvm-svn: 135420
2011-07-18 20:32:31 +00:00
Chad Rosier
936a952c82 A real testcase for r135286.
llvm-svn: 135299
2011-07-15 20:58:38 +00:00
Chad Rosier
1b9b65f30a Add testcase for r135286.
llvm-svn: 135291
2011-07-15 19:06:58 +00:00
Evan Cheng
13c2a2dac3 Change test case, one that actually failed before my commit.
llvm-svn: 135064
2011-07-13 19:19:44 +00:00
Evan Cheng
ba4a50f10c It's not safe to fold (fptrunc (sqrt (fpext x))) to (sqrtf x) if there is another use of sqrt. rdar://9763193
llvm-svn: 135058
2011-07-13 19:08:16 +00:00
Rafael Espindola
b42084315a Don't duplicate the work done by a gep into a "bitcast" if the gep has
more than one use.

Fixes PR10322.

llvm-svn: 134883
2011-07-11 03:43:47 +00:00
Chris Lattner
a106725fc5 Land the long talked about "type system rewrite" patch. This
patch brings numerous advantages to LLVM.  One way to look at it
is through diffstat:
 109 files changed, 3005 insertions(+), 5906 deletions(-)

Removing almost 3K lines of code is a good thing.  Other advantages
include:

1. Value::getType() is a simple load that can be CSE'd, not a mutating
   union-find operation.
2. Types a uniqued and never move once created, defining away PATypeHolder.
3. Structs can be "named" now, and their name is part of the identity that
   uniques them.  This means that the compiler doesn't merge them structurally
   which makes the IR much less confusing.
4. Now that there is no way to get a cycle in a type graph without a named
   struct type, "upreferences" go away.
5. Type refinement is completely gone, which should make LTO much MUCH faster
   in some common cases with C++ code.
6. Types are now generally immutable, so we can use "Type *" instead 
   "const Type *" everywhere.

Downsides of this patch are that it removes some functions from the C API,
so people using those will have to upgrade to (not yet added) new API.  
"LLVM 3.0" is the right time to do this.

There are still some cleanups pending after this, this patch is large enough
as-is.

llvm-svn: 134829
2011-07-09 17:41:24 +00:00
Chris Lattner
4ddffa2acc more tests not making the jump into the brave new world.
llvm-svn: 134820
2011-07-09 16:57:10 +00:00
Lang Hames
8971e4c595 Added test cases for GVN signed intrinsics recognition, r134777.
llvm-svn: 134778
2011-07-09 00:36:54 +00:00
Lang Hames
841a1fce67 Make GVN look through extractvalues for recognised intrinsics. GVN can then CSE ops that match values produced by the intrinsics.
llvm-svn: 134677
2011-07-08 01:50:54 +00:00
Andrew Trick
641b6e4222 indvars -disable-iv-rewrite: Added SimplifyCongruentIVs.
llvm-svn: 134530
2011-07-06 20:50:43 +00:00
Tobias Grosser
97b1ec50e3 LICM: Do not loose alignment on promotion
The promotion code lost any alignment information, when hoisting loads and
stores out of the loop. This lead to incorrect aligned memory accesses. We now
use the largest alignment we can prove to be correct.

llvm-svn: 134520
2011-07-06 19:19:55 +00:00
Jakub Staszak
28bcc8673e Introduce "expect" intrinsic instructions.
llvm-svn: 134516
2011-07-06 18:22:43 +00:00
Benjamin Kramer
2d266249a6 PR10267: Don't combine an equality compare with an AND into an inequality compare when the AND has more than one use.
This can pessimize code, inequalities are generally more expensive.

llvm-svn: 134379
2011-07-04 20:16:36 +00:00
Andrew Trick
ac38d56661 indvars -disable-iv-rewrite: bug fix involving weird geps and related cleanup.
llvm-svn: 134306
2011-07-02 02:34:25 +00:00
Dan Gohman
ba1afd789e Improve constant folding of undef for cmp and select operators.
llvm-svn: 134223
2011-07-01 01:03:43 +00:00
Dan Gohman
b4be67ddb0 Improve constant folding of undef for binary operators.
llvm-svn: 134221
2011-07-01 00:42:17 +00:00
Rafael Espindola
03cd7c7b76 Add r134057 back, but splice the predecessor after the successors phi
nodes.

Original message:
Let simplify cfg simplify bb with only debug and lifetime intrinsics.

llvm-svn: 134182
2011-06-30 20:14:24 +00:00
Andrew Trick
bcaaa0ae73 indvars -disable-iv-rewrite: handle cloning binary operators that cannot overflow.
llvm-svn: 134177
2011-06-30 19:02:17 +00:00
Andrew Trick
b074aa9e26 indvars -disable-iv-rewrite: handle an edge case involving identity phis.
llvm-svn: 134124
2011-06-30 01:27:23 +00:00
Andrew Trick
a79ebc3dbd indvars -disable-iv-rewrite: insert new trunc instructions carefully.
llvm-svn: 134112
2011-06-29 23:03:57 +00:00
Chad Rosier
fc7dc596a4 Temporarily revert r134057: "Let simplify cfg simplify bb with only debug and
lifetime intrinsics" due to buildbot failures.

llvm-svn: 134071
2011-06-29 16:22:11 +00:00
Rafael Espindola
e9e560eb37 Let simplify cfg simplify bb with only debug and lifetime intrinsics.
llvm-svn: 134057
2011-06-29 05:25:47 +00:00
Andrew Trick
bc666880ad indvars -disable-iv-rewrite: just because SCEV ignores casts doesn't
mean they can be removed.

llvm-svn: 134054
2011-06-29 03:13:40 +00:00
Andrew Trick
48f76db97a FileCheckify and prepare for -disable-iv-rewrite.
llvm-svn: 133998
2011-06-28 06:34:10 +00:00
Nick Lewycky
0a59da4c5f Teach one piece of scalarrepl to handle lifetime markers. When transforming an
alloca that only holds a copy of a global and we're going to replace the users
of the alloca with that global, just nuke the lifetime intrinsics. Part of
PR10121.

llvm-svn: 133905
2011-06-27 05:40:02 +00:00
Eli Friedman
8f3af361ac PR10180: Fix a instcombine crash with FP vectors.
llvm-svn: 133756
2011-06-23 20:40:23 +00:00