Commit Graph

3323 Commits

Author SHA1 Message Date
Dan Gohman
ddd3a8899a Fix a minor bug which resulted in intermediate calculations
using wider types than are necessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110241 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 19:52:50 +00:00
Torok Edwin
e89652ccad Add a missing function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110195 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 11:42:45 +00:00
Dan Gohman
a41af344c2 Remove PointerAccessInfo, which nothing was using.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110167 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 23:08:10 +00:00
Dan Gohman
79fca6fea8 Thread const correctness through a bunch of AliasAnalysis interfaces and
eliminate several const_casts.

Make CallSite implicitly convertible to ImmutableCallSite.

Rename the getModRefBehavior for intrinsic IDs to
getIntrinsicModRefBehavior to avoid overload ambiguity with CallSite,
which happens to be implicitly convertible to bool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110155 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 21:48:53 +00:00
Dan Gohman
6fc24467e9 The singular of "indices" is "index".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110135 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 20:23:52 +00:00
Dan Gohman
17f647d332 Delete an unused function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110134 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 20:20:56 +00:00
Dan Gohman
14a498a486 Make AliasAnalysis::getModRefInfo conservative in the face of volatility.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110120 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 17:27:43 +00:00
Dan Gohman
84b8ad321b Fix a typo Devang noticed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110115 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 16:48:31 +00:00
Michael J. Spencer
4473b37018 Fix CMake build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110097 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 02:38:20 +00:00
Dan Gohman
ef1cfac9e5 Introduce a symbolic constant for ~0u for use with AliasAnalysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110091 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 01:03:11 +00:00
Dan Gohman
847a84efd2 Add a convenient form of AliasAnalysis::alias for the case where the sizes
are unknown.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110090 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 00:56:30 +00:00
Dan Gohman
ab37f50838 Make SCEVUnknown a CallbackVH, so that it can be notified directly
of Value deletions and RAUWs, instead of relying on ScalarEvolution's
Scalars map being notified, as that's complicated at best, and
insufficient in general.

This means SCEVUnknown needs a non-trivial destructor, so introduce
a mechanism to allow ScalarEvolution to locate all the SCEVUnknowns.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110086 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 23:49:30 +00:00
Dan Gohman
c182cb5784 Sketch up a preliminary Type-Based Alias Analysis implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110077 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 23:11:01 +00:00
Dan Gohman
a8afb2a623 Add a lint check for indirectbr with no successors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110074 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 23:06:43 +00:00
Devang Patel
5b164b5a5c Add explicit constructors. Patch by Renato Golin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110072 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 22:51:46 +00:00
Dan Gohman
811edc1f1a Fix namespace polution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110056 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 18:50:06 +00:00
Oscar Fuentes
ee56c42168 Prefix next' iterator operation with llvm::'.
Fixes potential ambiguity problems on VS 2010.

Patch by nobled!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110029 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 06:00:15 +00:00
Owen Anderson
7f9cb744f2 Add an initial implementation of PHI translation for LazyValueInfo. This involves rolling back some
of my earlier data structure improvements until I can ensure that there are no iterator invalidation problems.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109935 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 23:59:40 +00:00
Owen Anderson
81881bcd35 Revert my last two patches to LVI, which recent changes have exposed a miscompilation in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109889 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 20:56:07 +00:00
Eric Christopher
e6cbfa6b09 Speculatively revert r109705 since it seems to be causing some build bot
angst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109718 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 01:25:38 +00:00
Dan Gohman
c6743207e2 Factor out some of the code for updating old SCEVUnknown values, and
extend it to handle the case where multiple RAUWs affect a single
SCEVUnknown.

Add a ScalarEvolution unittest to test for this situation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109705 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 00:17:55 +00:00
Owen Anderson
e2fb451dbb Pass the queried value by argument rather than in a member, in preparation for supporting PHI translation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109701 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 23:50:08 +00:00
Owen Anderson
9da5c997c0 Get rid of LVIQuery as a distinct data structure, so that we don't have to initialize a new set of maps on every query.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109679 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 22:07:25 +00:00
Daniel Dunbar
329878f4dd RegionInfo: Make sure to free cached nodes; Tobias, please check!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109650 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 20:28:50 +00:00
Gabor Greif
5d4b32ef96 simplify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109585 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 15:31:37 +00:00
Gabor Greif
ce4a62639f use Value* constructor of CallSite to create potentially improper site, and test that
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109580 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 12:35:54 +00:00
Gabor Greif
3737984e95 use Value* constructor of CallSite to create potentially improper site
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109579 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 12:19:46 +00:00
Gabor Greif
30ae792f06 simplify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109578 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 10:57:28 +00:00
Gabor Greif
b0686ea808 simplify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109577 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 10:46:09 +00:00
Dan Gohman
81f9121cda Make SCEVCallbackVH::allUsesReplacedWith update the old SCEVUnknown
object, as it may still be referenced by SCEVs not cleaned up by the
use list traversal.

Also, in ScalarEvolution::forgetValue, only check for a SCEVUnknown
object for the original value, not for any value in the use list,
because other SCEVUnknown values aren't necessary obsolete at that
point.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109570 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 01:09:07 +00:00
Dan Gohman
59846aced2 Make SCEVCallbackVH::allUsesReplacedWith unconditionally delete
the old value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109567 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 00:28:25 +00:00
Owen Anderson
9a65dc9968 Rearrange several datastructures in LazyValueInfo to improve compile time.
This is still not perfect, but better than it was before.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109563 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 23:58:11 +00:00
Gabor Greif
b344a346f1 reintroduce original (asserting) semantics of CallSite(Instruction *II)
add instead a CallSite(Value* V) constructor that is consistent with ImmutableCallSize
and use that one in client code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109553 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 22:53:28 +00:00
Gabor Greif
622b7cf147 recommit simplification (originally r109504, backed out in r109508) now that problem in CallSiteBase is fixed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109547 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 22:02:00 +00:00
Gabor Greif
49d0bca86c back out r109504, breaks the bots
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109508 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 15:18:11 +00:00
Gabor Greif
c0d4aed6f7 simplify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109504 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 14:38:38 +00:00
Gabor Greif
0de11e0e66 use ImmutableCallSite for const-corrgoodness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109503 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 14:15:29 +00:00
Tobias Grosser
0e6fcf4be3 RegionInfo: Add getMaxRegionExit()
getMaxRegionExit returns the exit of the maximal refined region starting
at a specific basic block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109496 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 08:39:43 +00:00
Tobias Grosser
082d587d35 Add function to query RegionInfo about loops.
* contains(Loop), * getOutermostLoop()
* Improve getNameStr() to return a sensible name, if basic blocks are not named.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109490 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 04:17:13 +00:00
Owen Anderson
cfa7fb6df5 Add an initial implementation of LazyValueInfo updating for JumpThreading. Disabled for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109424 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 18:48:03 +00:00
Dan Gohman
6ebfd72f37 Fix SCEVExpander::visitAddRecExpr so that it remembers the induction variable
it inserted rather than using LoopInfo::getCanonicalInductionVariable to
rediscover it, since that doesn't work on non-canonical loops. This fixes
infinite recurrsion on such loops; PR7562.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109419 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 18:28:14 +00:00
Dan Gohman
a29dbd2dcc Use DominatorTree::properlyDominates instead of dominates with an
explicit inequality check.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109398 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 17:34:05 +00:00
Dan Gohman
f8336a75c2 Eliminate getCanonicalInductionVariableIncrement's last user and
eliminate it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109270 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23 21:34:51 +00:00
Dan Gohman
63137d5681 Simplify this code; it can use the regular CFG utlities rather than
the BlockTraits abstractions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109268 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23 21:25:16 +00:00
Dan Gohman
304a7a6242 Micro-optimize SCEVComplexityCompare.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109267 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23 21:20:52 +00:00
Dan Gohman
e72079ac69 Add a const qualifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109266 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23 21:18:55 +00:00
Gabor Greif
f95eef695d use cascading operator-> feature
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109104 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 13:49:27 +00:00
Gabor Greif
96f1d8ebdd mass elimination of reliance on automatic iterator dereferencing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109103 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 13:36:47 +00:00
Gabor Greif
11aa60d05a use -> instead of (*).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109094 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 11:12:32 +00:00
Gabor Greif
3d8586eb63 cache dereferenced iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109093 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 11:07:46 +00:00