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

3401 Commits

Author SHA1 Message Date
Owen Anderson
e15120e561 Clean up some of the PassRegistry implementation, and pImpl-ize it to reduce #include clutter
and exposing internal details.

llvm-svn: 113252
2010-09-07 19:16:25 +00:00
Nick Lewycky
9698dae1df Add completely hokey binary-and and binary-or operations to ConstantRange and
teach LazyValueInfo to use them.

llvm-svn: 113196
2010-09-07 05:39:02 +00:00
Chris Lattner
cec733bec6 cleanup some of the lifetime/invariant marker stuff, add a big fixme.
llvm-svn: 113144
2010-09-06 03:58:04 +00:00
Chris Lattner
7576ffb974 speed up -gvn 3.4% on the testcase in PR7023
llvm-svn: 113135
2010-09-06 01:26:29 +00:00
Chris Lattner
818045f208 pull a simple method out of LICM into a new
Loop::hasLoopInvariantOperands method. Remove
a useless and confusing Loop::isLoopInvariant(Instruction)
method, which didn't do what you thought it did.

No functionality change.

llvm-svn: 113133
2010-09-06 01:05:37 +00:00
Chris Lattner
4dccd368f3 fix PR8063, a crash in globalopt in the malloc analysis code.
llvm-svn: 113109
2010-09-05 17:20:46 +00:00
Chris Lattner
238e7c2fbe dead method.
llvm-svn: 113077
2010-09-04 18:19:16 +00:00
Chris Lattner
8df3ffd7ac zap dead code.
llvm-svn: 113073
2010-09-04 18:12:00 +00:00
Dan Gohman
96e1af24f6 Disable the asserts that check that normalization is perfectly
invertible. ScalarEvolution's folding routines don't always succeed
in canonicalizing equal expressions to a single canonical form, and
this can cause these asserts to fail, even though there's no actual
correctness problem. This fixes PR8066.

llvm-svn: 113021
2010-09-03 22:12:56 +00:00
Owen Anderson
9161c79ffe Add support for simplifying a load from a computed value to a load from a global when it
is provable that they're equivalent.  This fixes PR4855.

llvm-svn: 112994
2010-09-03 19:08:37 +00:00
Chris Lattner
d0dce46416 stop forcing a noop AssemblyAnnotationWriter to silence #uses
comments, these don't happen anymore.

llvm-svn: 112901
2010-09-02 23:03:10 +00:00
Owen Anderson
1abc937731 Remove incorrect and poorly tested code for trying to reason about values on default edges of
switches.  Just return the conservatively correct answer.

llvm-svn: 112876
2010-09-02 22:16:52 +00:00
Owen Anderson
3206920eb2 Fix a bug in LazyValueInfo that CorrelatedValuePropagation exposed: In the LVI lattice, undef and the full set ConstantRange should not
be treated as equivalent.

llvm-svn: 112843
2010-09-02 18:23:58 +00:00
Dan Gohman
ad593f9d93 Revert 112442 and 112440 until the compile time problems introduced
by 112440 are resolved.

llvm-svn: 112692
2010-09-01 01:45:53 +00:00
Dan Gohman
fb64948296 Reapply r112432, now that the real problem is addressed.
llvm-svn: 112667
2010-08-31 22:53:17 +00:00
Dan Gohman
cadc463790 Reapply r112433, now that the real problem is addressed.
llvm-svn: 112666
2010-08-31 22:52:12 +00:00
Dan Gohman
a9b5b6bd36 Revert r110916. This patch is buggy because the code inside the
inner loop doesn't update all the variables in the outer loop.

llvm-svn: 112665
2010-08-31 22:50:31 +00:00
Dan Gohman
6822b9d177 Revert r112432. It appears to be exposing a problem in the emacs build.
llvm-svn: 112638
2010-08-31 20:58:44 +00:00
Dan Gohman
47865eb626 Speculatively revert r112433.
llvm-svn: 112608
2010-08-31 17:56:47 +00:00
Owen Anderson
d29fb4b991 It is possible to try to merge a not-constant with a constantrage, when dealing with ptrtoint ConstantExpr's.
Unfortunately, the only testcase I have for this is huge and doesn't reduce well because the error is
sensitive to iteration-order issues, since the problem only occurs when merging values in a particular order.

llvm-svn: 112489
2010-08-30 17:03:45 +00:00
Benjamin Kramer
b63bf8cf9b Don't print two "0x" prefixes. Use a raw_ostream overload instead of llvm::format.
llvm-svn: 112479
2010-08-30 14:46:53 +00:00
Chris Lattner
9e35d96cea two changes: 1) make AliasSet hold the list of call sites with an
assertingvh so we get a violent explosion if the pointer dangles.

2) Fix AliasSetTracker::deleteValue to remove call sites with
   by-pointer comparisons instead of by-alias queries.  Using
   findAliasSetForCallSite can cause alias sets to get merged
   when they shouldn't, and can also miss alias sets when the
   call is readonly.

#2 fixes PR6889, which only repros with a .c file :(

llvm-svn: 112452
2010-08-29 18:42:23 +00:00
Dan Gohman
9ea315c5ca Make IVUsers iterative instead of recursive.
This has the side effect of reversing the order of most of
IVUser's results.

llvm-svn: 112442
2010-08-29 16:40:03 +00:00
Dan Gohman
4e9013673c Restructure the {A,+,B}<L> * {C,+,D}<L> folding so that it folds
all applicable addrecs before recursing on getMulExpr, instead of
recursing on getMulExpr for each one.

llvm-svn: 112433
2010-08-29 15:16:58 +00:00
Dan Gohman
88b40ae04a Batch up subtracts along with adds, when analyzing long chains of
operations.

llvm-svn: 112432
2010-08-29 15:10:06 +00:00
Dan Gohman
988c90a5e1 Micro-optimize GroupByComplexity.
llvm-svn: 112431
2010-08-29 15:07:13 +00:00
Dan Gohman
690916c085 Hold AddRec->getLoop() in a variable, to make the Mul code more consistent
with the Add code.

llvm-svn: 112430
2010-08-29 14:55:19 +00:00
Dan Gohman
5a3ad9c218 Rename a variable, for consistency.
llvm-svn: 112429
2010-08-29 14:53:34 +00:00
Dan Gohman
d581ece72a Use iterators instead of indices.
llvm-svn: 112428
2010-08-29 14:52:02 +00:00
Chris Lattner
c8947a83e3 when merging two alias sets, the result set is volatile if either
of the sets is volatile.  We were dropping the volatile bit of the
merged in set, leading (luckily) to assertions in cases like 
PR7535.  I cannot produce a testcase that repros with opt, but this
is obviously correct.

llvm-svn: 112402
2010-08-29 04:14:47 +00:00
Chris Lattner
741da104b4 more cleanup
llvm-svn: 112401
2010-08-29 04:13:43 +00:00
Chris Lattner
db816c533c clean this up
llvm-svn: 112400
2010-08-29 04:06:55 +00:00
Dan Gohman
aa972a1ee3 Fix an index calculation thinko.
llvm-svn: 112337
2010-08-28 00:39:27 +00:00
Owen Anderson
f2255ee253 Improve the precision of getConstant().
llvm-svn: 112323
2010-08-27 23:29:38 +00:00
Dan Gohman
ee0a450648 When merging adjacent operands, scan ahead and merge all equal
adjacent operands at once, instead of just two at a time.

llvm-svn: 112299
2010-08-27 21:39:59 +00:00
Dan Gohman
f950201d01 Make the {A,+,B}<L> + {C,+,D}<L> --> Other + {A+C,+,B+D}<L>
transformation collect all the addrecs with the same loop
add combine them at once rather than starting everything over
at the first chance.

llvm-svn: 112290
2010-08-27 20:45:56 +00:00
Dan Gohman
636c57c5de Switch ScalarEvolution's main Value*->SCEV* map from std::map
to DenseMap.

llvm-svn: 112281
2010-08-27 18:55:03 +00:00
Owen Anderson
35ff7a208e Use LVI to eliminate conditional branches where we've tested a related condition previously. Update tests for this change.
This fixes PR5652.

llvm-svn: 112270
2010-08-27 17:12:29 +00:00
Dan Gohman
e1fcf40b52 Optimize SCEVComplexityCompare. Use a 3-way return instead of a 2-way
return to avoid needing two calls to test for equivalence, and sort
addrecs by their degree before examining their operands.

llvm-svn: 112267
2010-08-27 15:26:01 +00:00
Owen Anderson
e0cdfa265a In the default address space, any GEP off of null results in a trap value if you try to load it. Thus,
any load in the default address space that completes implies that the base value that it GEP'd from
was not null.

llvm-svn: 112015
2010-08-25 01:16:47 +00:00
Owen Anderson
5362513cf2 NULL loads are only invalid in the default address space.
llvm-svn: 111972
2010-08-24 22:00:55 +00:00
Owen Anderson
5acb4e1218 Add support for inferring values for the default cases of switches.
llvm-svn: 111971
2010-08-24 21:59:42 +00:00
Owen Anderson
4db6284783 Add support for inferring that a load from a pointer implies that it is not null.
llvm-svn: 111959
2010-08-24 20:47:29 +00:00
Owen Anderson
cb599851f2 Don't assume that all constants with integer types are ConstantInts.
llvm-svn: 111906
2010-08-24 07:55:44 +00:00
Devang Patel
45a818bea5 Let FE use derived types for DW_TAG_friend.
Patch by Alexander Herz!

llvm-svn: 111861
2010-08-23 23:16:25 +00:00
Devang Patel
cf6c6b4038 Handle qualified constants that are directly folded by FE.
PR 7920.

llvm-svn: 111820
2010-08-23 18:25:56 +00:00
Owen Anderson
fe3d206e65 Now that PassInfo and Pass::ID have been separated, move the rest of the passes over to the new registration API.
llvm-svn: 111815
2010-08-23 17:52:01 +00:00
Dan Gohman
31ab7e6b8c CreateTemporaryType doesn't needs its Context argument.
llvm-svn: 111687
2010-08-20 22:39:47 +00:00
Dan Gohman
072e7bdcd4 Introduce a new temporary MDNode concept. Temporary MDNodes are
not part of the IR, are not uniqued, and may be safely RAUW'd.
This replaces a variety of alternate mechanisms for achieving
the same effect.

llvm-svn: 111681
2010-08-20 22:02:26 +00:00
Dan Gohman
1c24df6ecc Convert DbgInfoPrinter to use errs() instead of outs().
llvm-svn: 111659
2010-08-20 18:03:05 +00:00