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

387 Commits

Author SHA1 Message Date
Dan Gohman
b84f5a3421 Add a properlyDominates member function to ScalarEvolution.
llvm-svn: 82898
2009-09-27 15:26:03 +00:00
Dan Gohman
723717853b Teach ScalarEvolution how to reason about no-wrap flags on loops
where the induction variable has a non-unit stride, such as {0,+,2}, and
there are expressions such as {1,+,2} inside the loop formed with
or or add nsw operators.

llvm-svn: 82151
2009-09-17 18:05:20 +00:00
Dan Gohman
d32bdb4c58 Remove references to expression "handles", which are no longer used.
llvm-svn: 80918
2009-09-03 15:00:26 +00:00
Dan Gohman
8e6871aa01 Don't use an iterator which is potentially invalidated.
llvm-svn: 80632
2009-08-31 21:58:28 +00:00
Dan Gohman
297360e2b1 Extend the ValuesAtScope cache to cover all expressions, not just
SCEVUnknowns, as the non-SCEVUnknown cases in the getSCEVAtScope code
can also end up repeatedly climing through the same expression trees,
which can be unusably slow when the trees are very tall.

Also, add a quick check for SCEV pointer equality to the main
SCEV comparison routine, as the full comparison code can be expensive
in the case of large expression trees.

These fix compile-time problems in some pathlogical cases.

llvm-svn: 80623
2009-08-31 21:15:23 +00:00
Dan Gohman
4010353fac Don't assume that two identical instructions that read from memory
will always return the same value. This isn't currently necessary,
since this code doesn't currently ever get called under circumstances
where it would matter, but it may some day.

llvm-svn: 80017
2009-08-25 17:56:57 +00:00
Dan Gohman
fdaeb17036 Teach ScalarEvolution about GlobalAliases.
llvm-svn: 80014
2009-08-25 17:49:57 +00:00
Chris Lattner
02d305910e remove a few dead insertion methods.
llvm-svn: 79882
2009-08-24 02:39:26 +00:00
Chris Lattner
1c0452caeb Change Pass::print to take a raw ostream instead of std::ostream,
update all code that this affects.

llvm-svn: 79830
2009-08-23 06:03:38 +00:00
Dan Gohman
6ec8176e22 Rename hasNoUnsignedOverflow and hasNoSignedOverflow to hasNoUnsignedWrap
and hasNoSignedWrap, for consistency with the nuw and nsw properties.

llvm-svn: 79539
2009-08-20 17:11:38 +00:00
Dan Gohman
d9766dcb85 Various comment and whitespace cleanups.
llvm-svn: 79533
2009-08-20 16:42:55 +00:00
Dan Gohman
ba656de4a4 Use hasDefinitiveInitializer() instead of testing the same thing
by hand, and fix a few places that were using hasInitializer() that
appear to depend on the initializer value.

llvm-svn: 79441
2009-08-19 18:20:44 +00:00
Dan Gohman
b0cf049a1e Generalize ScalarEvolution to be able to analyze GEPs when
TargetData is not present. It still uses TargetData when available.
This generalization also fixed some limitations in the TargetData
case; the attached testcase covers this.

llvm-svn: 79344
2009-08-18 16:46:41 +00:00
Owen Anderson
9df206d02d Push LLVMContexts through the IntegerType APIs.
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Andreas Bolka
5356a5f16b Fix copy-pasto.
llvm-svn: 78426
2009-08-07 22:55:26 +00:00
Owen Anderson
1dc40e205b Move a few more APIs back to 2.5 forms. The only remaining ones left to change back are
metadata related, which I'm waiting on to avoid conflicting with Devang.

llvm-svn: 77721
2009-07-31 20:28:14 +00:00
Owen Anderson
881d928f9b Move types back to the 2.5 API.
llvm-svn: 77516
2009-07-29 22:17:13 +00:00
Owen Anderson
0ce2151b36 Move ConstantExpr to 2.5 API.
llvm-svn: 77494
2009-07-29 18:55:55 +00:00
Dan Gohman
e999569f50 Fix wording in comments.
llvm-svn: 77193
2009-07-27 16:09:48 +00:00
Dan Gohman
0781059503 SCEV objects are no longer reference-counted.
llvm-svn: 77080
2009-07-25 16:18:07 +00:00
Dan Gohman
c126330ef1 When attempting to sign-extend an addrec by interpreting
the step value as unsigned, the start value and the addrec
itself still need to be treated as signed.

llvm-svn: 77078
2009-07-25 16:03:30 +00:00
Dan Gohman
13aabe2ba4 Teach ScalarEvolution to make use of no-overflow flags when
analyzing add recurrences.

llvm-svn: 77034
2009-07-25 01:22:26 +00:00
Dan Gohman
a823846bd1 Instead of eagerly creating new SCEVs to replace all SCEVs that are
affected after a PHI node has been analyzed, just remove affected
SCEVs from the Scalars map, so that they'll be (lazily) recreated as
needed. This avoids creating SCEV objects that aren't actually needed.

Also, rewrite the associated def-use walking code to be non-recursive
and to continue traversing past Instructions that don't have an
entry in the Scalars map.

llvm-svn: 77032
2009-07-25 01:13:03 +00:00
Owen Anderson
cc33e89571 Revert the ConstantInt constructors back to their 2.5 forms where possible, thanks to contexts-on-types. More to come.
llvm-svn: 77011
2009-07-24 23:12:02 +00:00
Dan Gohman
4c5b26a78e Fix whitespace.
llvm-svn: 76929
2009-07-24 01:03:59 +00:00
Owen Anderson
cc287b28c9 Get rid of the Pass+Context magic.
llvm-svn: 76702
2009-07-22 00:24:57 +00:00
Dan Gohman
190d29cb5c Replace the original ad-hoc code for determining whether (v pred w) implies
(x pred y) with more thorough code that does more complete canonicalization
before resorting to range checks. This helps it find more cases where
the canonicalized expressions match.

llvm-svn: 76671
2009-07-21 23:03:19 +00:00
Dan Gohman
00fa00fec8 Make the range calculations for addrecs to be more conservative,
as they aren't currently prepared to handle complicated overflow
cases.

llvm-svn: 76524
2009-07-21 00:42:47 +00:00
Dan Gohman
4100aea6ad Whitespace cleanups.
llvm-svn: 76523
2009-07-21 00:38:55 +00:00
Dan Gohman
a37a433693 Minor code simplification.
llvm-svn: 76521
2009-07-21 00:37:45 +00:00
Dan Gohman
47100f32c0 Add a comment to clarify why there isn't any code in this spot.
llvm-svn: 76505
2009-07-20 23:54:43 +00:00
Dan Gohman
857ccb8149 Remove the code that tried to evaluate whether (A pred B) is known
by determining if (B pred (B-A)) is known, as it doesn't handle
overflow correctly.

llvm-svn: 76504
2009-07-20 23:53:35 +00:00
Dan Gohman
b92b14f20b Minor code simplification.
llvm-svn: 76496
2009-07-20 22:41:51 +00:00
Dan Gohman
74a435e9f1 The upper argument of ConstantRange is exclusive, not inclusive.
llvm-svn: 76492
2009-07-20 22:34:18 +00:00
Dan Gohman
00b05492f1 Revert the addition of hasNoPointerOverflow to GEPOperator.
Getelementptrs that are defined to wrap are virtually useless to
optimization, and getelementptrs that are undefined on any kind
of overflow are too restrictive -- it's difficult to ensure that
all intermediate addresses are within bounds. I'm going to take
a different approach.

Remove a few optimizations that depended on this flag.

llvm-svn: 76437
2009-07-20 17:43:30 +00:00
Dan Gohman
25a722cc45 Add a new Operator class, for handling Instructions and ConstantExprs
in a convenient manner, factoring out some common code from
InstructionCombining and ValueTracking. Move the contents of
BinaryOperators.h into Operator.h and use Operator to generalize them
to support ConstantExprs as well as Instructions.

llvm-svn: 76232
2009-07-17 20:47:02 +00:00
Owen Anderson
21d2d69727 Move the ConstantInt uniquing table into LLVMContextImpl. This exposed a number of issues in
our current context-passing stuff, which is also fixed here

llvm-svn: 76089
2009-07-16 18:04:31 +00:00
Dan Gohman
50e65d8c93 Fill in some holes in ScalarEvolution's loop iteration condition
analysis. This allows indvars to emit a simpler loop trip count
expression.

llvm-svn: 76085
2009-07-16 17:34:36 +00:00
Owen Anderson
8c85061ee6 Move EVER MORE stuff over to LLVMContext.
llvm-svn: 75703
2009-07-14 23:09:55 +00:00
Torok Edwin
f955a6ef49 llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").

llvm-svn: 75640
2009-07-14 16:55:14 +00:00
Dan Gohman
5069f6b40f Make SCEVCallbackVH::allUsesReplacedWith more thorough in removing
users from the Scalars map.

llvm-svn: 75634
2009-07-14 14:34:04 +00:00
Dan Gohman
e69947ca6e Add a comment about why ScalarEvolution doesn't recognize non-loop PHIs
even when they're obvious.

llvm-svn: 75632
2009-07-14 14:06:25 +00:00
Owen Anderson
1404d6e7d1 Move more functionality over to LLVMContext.
llvm-svn: 75559
2009-07-13 23:50:59 +00:00
Dan Gohman
fd3cc860ec Print a newline after printing a Value, now that Value's operator<<
doesn't print a newline.

llvm-svn: 75543
2009-07-13 23:03:05 +00:00
Dan Gohman
5c3d16883e Fix a few assertion strings.
llvm-svn: 75530
2009-07-13 22:20:53 +00:00
Dan Gohman
b8ec6716fd Whitespace cleanups.
llvm-svn: 75525
2009-07-13 22:05:32 +00:00
Dan Gohman
370f5f3116 Fix an 80-column violation.
llvm-svn: 75524
2009-07-13 22:04:06 +00:00
Dan Gohman
a9953c0a28 Reapply 75252, with a fix to avoid the infinite recursion case. The
check for avoiding re-analyzing a widening cast needed to happen
earlier, as getSCEV itself may result in a isLoopGuardedByCond query.

llvm-svn: 75511
2009-07-13 21:35:55 +00:00
Owen Anderson
1e5155161a Move more functionality over to LLVMContext.
llvm-svn: 75497
2009-07-13 20:58:05 +00:00
Dan Gohman
1a780ad8db Move the memoization check for SCEVSignExtendExpr and
SCEVZeroExtendExpr ahead of the most expensive analysis. This
speeds up analysis and helps avoid pathologically bad behavior
on the testcase in PR4534.

llvm-svn: 75496
2009-07-13 20:55:53 +00:00