Dan Gohman
b0604c0b83
Use iterators instead of indices in a few more places.
...
llvm-svn: 111143
2010-08-16 16:27:53 +00:00
Dan Gohman
64c713c605
Micro-optimize SCEVConstant comparison.
...
llvm-svn: 111142
2010-08-16 16:25:35 +00:00
Dan Gohman
6d808db278
Move SCEVNAryExpr's virtual member functions out of line, and convert
...
them to iterators.
llvm-svn: 111140
2010-08-16 16:21:27 +00:00
Dan Gohman
d55de2457e
Use iterators instead of indices in simple cases.
...
llvm-svn: 111138
2010-08-16 16:16:11 +00:00
Dan Gohman
daec40b96d
Avoid gratuitous inefficiency in ifndef NDEBUG code.
...
llvm-svn: 111137
2010-08-16 16:13:54 +00:00
Dan Gohman
345dc8add7
Make one getAddExpr call when analyzing a+b+c+d+e+... instead of one
...
for each add instruction. Ditto for Mul.
llvm-svn: 111136
2010-08-16 16:03:49 +00:00
Dan Gohman
fec602e7c5
Delete an unused function.
...
llvm-svn: 111135
2010-08-16 15:57:14 +00:00
Dan Gohman
8ed4d1646e
Revert r111058, the lint check for indirectbr successors that aren't
...
address-taken. This can occur normally, if the code which took the
address got DCEd.
llvm-svn: 111121
2010-08-16 14:39:19 +00:00
Argyrios Kyrtzidis
75b69c1de3
Revert r111082. No warnings for this common pattern.
...
llvm-svn: 111102
2010-08-15 10:27:23 +00:00
Argyrios Kyrtzidis
70b248e3ac
Add ATTRIBUTE_UNUSED to methods that are not supposed to be used.
...
llvm-svn: 111082
2010-08-14 21:35:10 +00:00
Dan Gohman
422c164d8d
Add a lint check for an indirectbr destination which has not
...
had its address taken.
llvm-svn: 111058
2010-08-13 23:56:28 +00:00
Dan Gohman
076597a026
Various optimizations. Don't compare two loops' depths
...
when they are the same loop. Don't compare two instructions'
loop depths when they are in the same block.
llvm-svn: 111045
2010-08-13 21:24:58 +00:00
Dan Gohman
ecb279a1c2
When testing whether one loop contains another, test this directly
...
rather than testing whether the loop contains the other's header.
llvm-svn: 111039
2010-08-13 20:23:25 +00:00
Dan Gohman
02de74d4dc
Add a const.
...
llvm-svn: 111038
2010-08-13 20:17:27 +00:00
Dan Gohman
3650d2058f
When creating a symmetric SCEV with a constant operand, put
...
the constant operand on the left, as that's where ScalarEvolution
will end up canonicalizing to.
llvm-svn: 111037
2010-08-13 20:17:14 +00:00
Dan Gohman
de171ff360
An add recurrence is loop-invariant in any loop inside of its
...
associated loop. This avoids potentially expensive traversals
of the add recurrence's operands.
llvm-svn: 111034
2010-08-13 20:11:39 +00:00
Dan Gohman
8103471a35
Optimize ScalarEvolution::getAddExpr's operand factoring code by
...
having it finish processing all of the muliply operands before
starting the whole getAddExpr process over again, instead of
immediately after the first simplification.
llvm-svn: 110916
2010-08-12 15:00:23 +00:00
Dan Gohman
d7b79a35df
Hoist some loop-invariant code out of a hot loop.
...
llvm-svn: 110915
2010-08-12 14:52:55 +00:00
Dan Gohman
cc5fb07653
Optimize ScalarEvolution::getAddExpr's duplicate operand detection
...
by having it finish processing the whole operand list before
starting the whole getAddExpr process over again, instead of
immediately after the first duplicate is found.
llvm-svn: 110914
2010-08-12 14:46:54 +00:00
Devang Patel
d425ead3c8
Even if a variable has constant value all the time, it is still a variable in gdb's eyes.
...
Tested by scope.exp in gdb testsuite.
llvm-svn: 110876
2010-08-11 23:17:54 +00:00
Owen Anderson
97ce6f3223
Fix a subtle use-after-free issue.
...
llvm-svn: 110863
2010-08-11 22:36:04 +00:00
Dan Gohman
2d7bf8c073
Make LoopPass::getContainedPass return a LoopPass* instead of a Pass*
...
and remove casts from all its callers.
llvm-svn: 110848
2010-08-11 20:34:43 +00:00
Owen Anderson
0692635e68
Improve indentation.
...
llvm-svn: 110778
2010-08-11 04:24:25 +00:00
Dan Gohman
603e66618f
When analyzing loop exit conditions combined with and and or, don't
...
make any assumptions about when the two conditions will agree on when
to permit the loop to exit. This fixes PR7845.
llvm-svn: 110758
2010-08-11 00:12:36 +00:00
Dan Gohman
7e49302e9a
Rename and reorder the arguments to isImpliedCond, for consistency and clarity.
...
llvm-svn: 110750
2010-08-10 23:46:30 +00:00
Owen Anderson
a095d3fe73
Now that we're using ConstantRange to represent potential values, make use of that represenation to
...
create constraints from comparisons other than eq/neq.
llvm-svn: 110742
2010-08-10 23:20:01 +00:00
Devang Patel
17606414a4
Add missing argument. CreateCompositeTypeEx() users, please verify.
...
llvm-svn: 110717
2010-08-10 20:22:49 +00:00
Owen Anderson
a3a2b79f01
Switch over to using ConstantRange to track integral values.
...
llvm-svn: 110714
2010-08-10 20:03:09 +00:00
Devang Patel
9b12559c4f
Do not forget debug info for enums. Use named mdnode to keep track of these types.
...
llvm-svn: 110712
2010-08-10 20:01:20 +00:00
Tobias Grosser
7b96737b7f
RegionInfo: Do not assert if a BB is not part of the dominance tree.
...
llvm-svn: 110665
2010-08-10 09:54:35 +00:00
Devang Patel
84f48b5483
Handle TAG_constant for integers.
...
llvm-svn: 110656
2010-08-10 07:11:13 +00:00
Devang Patel
8d0c79694e
Refactor.
...
llvm-svn: 110607
2010-08-09 21:39:24 +00:00
Owen Anderson
cdd7cdc49a
Add ConstantRange information to the debugging output.
...
llvm-svn: 110598
2010-08-09 20:50:46 +00:00
Owen Anderson
f2fea95f2f
Reapply r110396, with fixes to appease the Linux buildbot gods.
...
llvm-svn: 110460
2010-08-06 18:33:48 +00:00
Dan Gohman
da3f592fb3
Implement a proper getModRefInfo for va_arg.
...
llvm-svn: 110458
2010-08-06 18:24:38 +00:00
Dan Gohman
ec36b4cd9c
Be more conservative in the face of volatile.
...
llvm-svn: 110456
2010-08-06 18:11:28 +00:00
Dan Gohman
a4a3f3b27b
Fix a comment.
...
llvm-svn: 110455
2010-08-06 18:10:45 +00:00
Dan Gohman
1c3a757427
Move all the logic for function attributes and call attributes out of the
...
AliasAnalysis base class and into BasicAliasAnalyais. This avoids confusion
about where such logic is happening when there are other AliasAnalysis
implementations present.
Move the logic for translating two-callsite getModRefInfo queries into
other AliasAnalysis queries out of BasicAliasAnalysis and into the
AliasAnalysis base class, as it is useful for other AliasAnalysis
implementations.
llvm-svn: 110421
2010-08-06 01:25:49 +00:00
Owen Anderson
8ec30386ee
Fix botched revert.
...
llvm-svn: 110416
2010-08-06 00:36:20 +00:00
Owen Anderson
aadd8a89ca
Revert r110396 to fix buildbots.
...
llvm-svn: 110410
2010-08-06 00:23:35 +00:00
Dan Gohman
c2e608a099
Fix 80-column violations.
...
llvm-svn: 110401
2010-08-05 23:48:14 +00:00
Owen Anderson
b9762c07cb
Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
...
ID member as the sole unique type identifier. Clean up APIs related to this change.
llvm-svn: 110396
2010-08-05 23:42:04 +00:00
Dan Gohman
9135b410fe
Implement AccessesArguments checking in the two-callsite form
...
of BasicAA::getModRefInfo. This allows BasicAA to say that two
memset calls to non-aliasing memory locations don't interfere.
llvm-svn: 110393
2010-08-05 23:34:50 +00:00
Dan Gohman
db40449189
Yes, we can do better, but this is not the place for it.
...
llvm-svn: 110391
2010-08-05 23:23:32 +00:00
Owen Anderson
86690fa988
Add the beginnings of infrastructure for range tracking.
...
llvm-svn: 110388
2010-08-05 22:59:19 +00:00
Owen Anderson
68ee87e057
Split the tag and value members of LVILatticeVal in preparation for expanding the lattice to something that won't fit in two bits.
...
llvm-svn: 110383
2010-08-05 22:10:46 +00:00
Dan Gohman
7260387710
Fix memdep's code for reasoning about dependences between two calls. A Ref
...
response from getModRefInfo is not useful here. Instead, check for identical
calls only in the NoModRef case.
Reapply r110270, and strengthen it to compensate for the memdep changes.
When both calls are readonly, there is no dependence between them.
llvm-svn: 110382
2010-08-05 22:09:15 +00:00
Dan Gohman
c42ed0aa91
Revert r110270 for now. It appears to uncover a memdep bug.
...
llvm-svn: 110293
2010-08-05 00:43:10 +00:00
Dan Gohman
fc6b043376
The trouble with testing for "ModRef" and "NoModRef" is that
...
one is a suffix of the other, and FileCheck accepts superstrings.
Adjust the output to avoid this problem.
llvm-svn: 110280
2010-08-04 23:37:55 +00:00
Dan Gohman
dcb6099f9e
The two-callsite form of AliasAnalysis::getModRefInfo is documented
...
to return Ref if the left callsite only reads memory read or written
by the right callsite; fix BasicAliasAnalysis to implement this.
Add AliasAnalysisEvaluator support for testing the two-callsite
form of getModRefInfo.
llvm-svn: 110270
2010-08-04 22:56:29 +00:00
Dan Gohman
bafce59252
Fix a minor bug which resulted in intermediate calculations
...
using wider types than are necessary.
llvm-svn: 110241
2010-08-04 19:52:50 +00:00
Torok Edwin
967fc5164f
Add a missing function.
...
llvm-svn: 110195
2010-08-04 11:42:45 +00:00
Dan Gohman
aac19e4ffe
Remove PointerAccessInfo, which nothing was using.
...
llvm-svn: 110167
2010-08-03 23:08:10 +00:00
Dan Gohman
a087b90950
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.
llvm-svn: 110155
2010-08-03 21:48:53 +00:00
Dan Gohman
3ea223305c
The singular of "indices" is "index".
...
llvm-svn: 110135
2010-08-03 20:23:52 +00:00
Dan Gohman
b0d9b03b13
Delete an unused function.
...
llvm-svn: 110134
2010-08-03 20:20:56 +00:00
Dan Gohman
10d085dcba
Make AliasAnalysis::getModRefInfo conservative in the face of volatility.
...
llvm-svn: 110120
2010-08-03 17:27:43 +00:00
Dan Gohman
03b02a1ee1
Fix a typo Devang noticed.
...
llvm-svn: 110115
2010-08-03 16:48:31 +00:00
Michael J. Spencer
5878996848
Fix CMake build
...
llvm-svn: 110097
2010-08-03 02:38:20 +00:00
Dan Gohman
6604a72154
Introduce a symbolic constant for ~0u for use with AliasAnalysis.
...
llvm-svn: 110091
2010-08-03 01:03:11 +00:00
Dan Gohman
e0489ffe8e
Add a convenient form of AliasAnalysis::alias for the case where the sizes
...
are unknown.
llvm-svn: 110090
2010-08-03 00:56:30 +00:00
Dan Gohman
68ac0492a4
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.
llvm-svn: 110086
2010-08-02 23:49:30 +00:00
Dan Gohman
9d80b87a4d
Sketch up a preliminary Type-Based Alias Analysis implementation.
...
llvm-svn: 110077
2010-08-02 23:11:01 +00:00
Dan Gohman
abb2503036
Add a lint check for indirectbr with no successors.
...
llvm-svn: 110074
2010-08-02 23:06:43 +00:00
Devang Patel
f18faa5945
Add explicit constructors. Patch by Renato Golin.
...
llvm-svn: 110072
2010-08-02 22:51:46 +00:00
Dan Gohman
213f64b54c
Fix namespace polution.
...
llvm-svn: 110056
2010-08-02 18:50:06 +00:00
Oscar Fuentes
4742c01c2a
Prefix next' iterator operation with
llvm::'.
...
Fixes potential ambiguity problems on VS 2010.
Patch by nobled!
llvm-svn: 110029
2010-08-02 06:00:15 +00:00
Owen Anderson
e1aed29cca
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.
llvm-svn: 109935
2010-07-30 23:59:40 +00:00
Owen Anderson
4e6f48d705
Revert my last two patches to LVI, which recent changes have exposed a miscompilation in.
...
llvm-svn: 109889
2010-07-30 20:56:07 +00:00
Eric Christopher
6a1da7b4a5
Speculatively revert r109705 since it seems to be causing some build bot
...
angst.
llvm-svn: 109718
2010-07-29 01:25:38 +00:00
Dan Gohman
ea1486b53c
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.
llvm-svn: 109705
2010-07-29 00:17:55 +00:00
Owen Anderson
712152a68e
Pass the queried value by argument rather than in a member, in preparation for supporting PHI translation.
...
llvm-svn: 109701
2010-07-28 23:50:08 +00:00
Owen Anderson
670fd343a5
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.
...
llvm-svn: 109679
2010-07-28 22:07:25 +00:00
Daniel Dunbar
111cf008aa
RegionInfo: Make sure to free cached nodes; Tobias, please check!
...
llvm-svn: 109650
2010-07-28 20:28:50 +00:00
Gabor Greif
4909c0a1f1
simplify
...
llvm-svn: 109585
2010-07-28 15:31:37 +00:00
Gabor Greif
9bb43864b1
use Value* constructor of CallSite to create potentially improper site, and test that
...
llvm-svn: 109580
2010-07-28 12:35:54 +00:00
Gabor Greif
f6966fafe3
use Value* constructor of CallSite to create potentially improper site
...
llvm-svn: 109579
2010-07-28 12:19:46 +00:00
Gabor Greif
e27a194ce5
simplify
...
llvm-svn: 109578
2010-07-28 10:57:28 +00:00
Gabor Greif
6dc7dec8c1
simplify
...
llvm-svn: 109577
2010-07-28 10:46:09 +00:00
Dan Gohman
2bea1e1572
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.
llvm-svn: 109570
2010-07-28 01:09:07 +00:00
Dan Gohman
9a6ea54d94
Make SCEVCallbackVH::allUsesReplacedWith unconditionally delete
...
the old value.
llvm-svn: 109567
2010-07-28 00:28:25 +00:00
Owen Anderson
2d39891e91
Rearrange several datastructures in LazyValueInfo to improve compile time.
...
This is still not perfect, but better than it was before.
llvm-svn: 109563
2010-07-27 23:58:11 +00:00
Gabor Greif
ec0c7b2427
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
llvm-svn: 109553
2010-07-27 22:53:28 +00:00
Gabor Greif
8c197e5dbb
recommit simplification (originally r109504, backed out in r109508) now that problem in CallSiteBase is fixed
...
llvm-svn: 109547
2010-07-27 22:02:00 +00:00
Gabor Greif
981f3d3a31
back out r109504, breaks the bots
...
llvm-svn: 109508
2010-07-27 15:18:11 +00:00
Gabor Greif
90a627cfaa
simplify
...
llvm-svn: 109504
2010-07-27 14:38:38 +00:00
Gabor Greif
aaf68e2e5a
use ImmutableCallSite for const-corrgoodness
...
llvm-svn: 109503
2010-07-27 14:15:29 +00:00
Tobias Grosser
ebc6c0cf50
RegionInfo: Add getMaxRegionExit()
...
getMaxRegionExit returns the exit of the maximal refined region starting
at a specific basic block.
llvm-svn: 109496
2010-07-27 08:39:43 +00:00
Tobias Grosser
16789d79fe
Add function to query RegionInfo about loops.
...
* contains(Loop), * getOutermostLoop()
* Improve getNameStr() to return a sensible name, if basic blocks are not named.
llvm-svn: 109490
2010-07-27 04:17:13 +00:00
Owen Anderson
12ab6162bf
Add an initial implementation of LazyValueInfo updating for JumpThreading. Disabled for now.
...
llvm-svn: 109424
2010-07-26 18:48:03 +00:00
Dan Gohman
9e0ae022d2
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.
llvm-svn: 109419
2010-07-26 18:28:14 +00:00
Dan Gohman
0627594a67
Use DominatorTree::properlyDominates instead of dominates with an
...
explicit inequality check.
llvm-svn: 109398
2010-07-26 17:34:05 +00:00
Dan Gohman
e6e38c1685
Eliminate getCanonicalInductionVariableIncrement's last user and
...
eliminate it.
llvm-svn: 109270
2010-07-23 21:34:51 +00:00
Dan Gohman
1d19d69faf
Simplify this code; it can use the regular CFG utlities rather than
...
the BlockTraits abstractions.
llvm-svn: 109268
2010-07-23 21:25:16 +00:00
Dan Gohman
188a4d7d53
Micro-optimize SCEVComplexityCompare.
...
llvm-svn: 109267
2010-07-23 21:20:52 +00:00
Dan Gohman
2de2b0713e
Add a const qualifier.
...
llvm-svn: 109266
2010-07-23 21:18:55 +00:00
Gabor Greif
346b13120a
use cascading operator-> feature
...
llvm-svn: 109104
2010-07-22 13:49:27 +00:00
Gabor Greif
96a9f8c7c6
mass elimination of reliance on automatic iterator dereferencing
...
llvm-svn: 109103
2010-07-22 13:36:47 +00:00
Gabor Greif
197322c365
use -> instead of (*).
...
llvm-svn: 109094
2010-07-22 11:12:32 +00:00
Gabor Greif
e826ece8c2
cache dereferenced iterator
...
llvm-svn: 109093
2010-07-22 11:07:46 +00:00
Tobias Grosser
604a50cd71
Add new RegionInfo pass.
...
The RegionInfo pass detects single entry single exit regions in a function,
where a region is defined as any subgraph that is connected to the remaining
graph at only two spots.
Furthermore an hierarchical region tree is built.
Use it by calling "opt -regions analyze" or "opt -view-regions".
llvm-svn: 109089
2010-07-22 07:46:31 +00:00
Dan Gohman
859ffd353e
Make NamedMDNode not be a subclass of Value, and simplify the interface
...
for creating and populating NamedMDNodes.
llvm-svn: 109061
2010-07-21 23:38:33 +00:00
Owen Anderson
b36d01c1b6
Add INSTANTIATE_AG_PASS, which combines RegisterPass<> with RegisterAnalysisGroup<> for pass registration.
...
llvm-svn: 109058
2010-07-21 23:07:00 +00:00
Owen Anderson
f8addbb0a1
Fix batch of converting RegisterPass<> to INTIALIZE_PASS().
...
llvm-svn: 109045
2010-07-21 22:09:45 +00:00
Jim Grosbach
4d3c808fd9
tidy up.
...
llvm-svn: 109038
2010-07-21 21:36:25 +00:00
Dan Gohman
fc3ee085a0
Disallow null as a named metadata operand.
...
Make MDNode::destroy private.
Fix the one thing that used MDNode::destroy, outside of MDNode itself.
One should never delete or destroy an MDNode explicitly. MDNodes
implicitly go away when there are no references to them (implementation
details aside).
llvm-svn: 109028
2010-07-21 18:54:18 +00:00
Dan Gohman
45ba7b5c5c
Fix SCEV denormalization of expressions where the exit value from
...
one loop is involved in the increment of an addrec for another
loop. This fixes rdar://8168938.
llvm-svn: 108863
2010-07-20 17:06:20 +00:00
Dan Gohman
61bb92a5ff
Add a fast path for x - x.
...
llvm-svn: 108855
2010-07-20 16:53:00 +00:00
Dan Gohman
ac63cc9b2e
Simplify this code; LoopInfo::getCanonicalInductionVariable will only
...
find integer induction variables.
llvm-svn: 108853
2010-07-20 16:46:58 +00:00
Dan Gohman
0bfc6146bf
Make getOrInsertCanonicalInductionVariable guarantee that its
...
result is a PHINode*.
llvm-svn: 108852
2010-07-20 16:44:52 +00:00
Dan Gohman
64ebb77660
Change an argument from an Instruction* to a Value*, which is all
...
that is needed here.
llvm-svn: 108850
2010-07-20 16:34:50 +00:00
Dan Gohman
6a45181120
Minor code cleanups.
...
llvm-svn: 108848
2010-07-20 16:32:11 +00:00
Owen Anderson
5f218b8612
Speculatively revert r108813, in an attempt to get the self-host buildbots working again. I don't see why this patch
...
would cause them to fail the way they are, but none of the other intervening patches seem likely either.
llvm-svn: 108818
2010-07-20 08:26:15 +00:00
Owen Anderson
cf625d0179
Reapply r108794, a fix for the failing test from last time.
...
llvm-svn: 108813
2010-07-20 06:52:42 +00:00
Daniel Dunbar
3280e3aebf
Revert r108794, "Separate PassInfo into two classes: a constructor-free
...
superclass (StaticPassInfo) and a constructor-ful subclass (PassInfo).", it is
breaking teh everything.
llvm-svn: 108805
2010-07-20 03:06:07 +00:00
Owen Anderson
3502f9a91b
Separate PassInfo into two classes: a constructor-free superclass (StaticPassInfo) and a constructor-ful subclass (PassInfo).
...
llvm-svn: 108794
2010-07-20 01:19:58 +00:00
Dan Gohman
3a3e97cdbd
Minor code simplification.
...
llvm-svn: 108793
2010-07-20 00:57:18 +00:00
Stuart Hastings
587ed4918c
Correct line info for declarations/definitions. Radar 8063111.
...
llvm-svn: 108784
2010-07-19 23:56:30 +00:00
Gabor Greif
17c48ecd68
eliminate CallInst::ArgOffset
...
llvm-svn: 108522
2010-07-16 09:38:02 +00:00
Dan Gohman
1705ac2740
Fix the order that SCEVExpander considers add operands in so that
...
it doesn't miss an opportunity to form a GEP, regardless of the
relative loop depths of the operands. This fixes rdar://8197217.
llvm-svn: 108475
2010-07-15 23:38:13 +00:00
Dan Gohman
04768aa9a5
Teach ScalarEvolution how to fold trunc(undef) and anyext(undef) to undef.
...
This helps LSR behave more consistently on bugpoint-reduced testcases.
llvm-svn: 108451
2010-07-15 20:02:11 +00:00
Gabor Greif
0b8d6a43c0
cache another dereferenced iterator
...
llvm-svn: 108421
2010-07-15 10:19:23 +00:00
Chris Lattner
2b2265a9c5
Fix PR7647, handling the case when 'To' ends up being
...
mutated by recursive simplification. This also enhances
ReplaceAndSimplifyAllUses to actually do a real RAUW
at the end of it, which updates any value handles
pointing to "From" to start pointing to "To". This
seems useful for debug info and random other VH users.
llvm-svn: 108415
2010-07-15 06:36:08 +00:00
Eli Friedman
f7ae898f2b
Revert r108401; it breaks bootstrap :(
...
llvm-svn: 108407
2010-07-15 05:09:31 +00:00
Eli Friedman
5d36d37a4a
Add AssertingVH which makes PR7647 break consistently.
...
llvm-svn: 108401
2010-07-15 04:46:14 +00:00
Dan Gohman
0af129aa1b
Add a lint check for mismatched return types, inspired by PR6944.
...
llvm-svn: 108162
2010-07-12 18:02:04 +00:00
Duncan Sands
f7b98e2b1e
Convert some tab stops into spaces.
...
llvm-svn: 108130
2010-07-12 08:16:59 +00:00
Chandler Carruth
6b1b1c63b9
Add parentheses around an || to correct the logic. Also silences a GCC warning
...
that was actually useful here.
Chris, please double check that this is the correct interpretation. I was
pretty sure, and ran it by Nick as well.
llvm-svn: 108129
2010-07-12 06:47:05 +00:00
Chris Lattner
d8288040c3
fix PR7429, a crash turning a load from a string into a float.
...
llvm-svn: 108113
2010-07-12 00:22:51 +00:00
Gabor Greif
0a544667f8
remove useless cast and fix typos in comment
...
llvm-svn: 107989
2010-07-09 16:42:04 +00:00
Gabor Greif
a2c75f904d
cache result of operator*
...
llvm-svn: 107988
2010-07-09 16:39:02 +00:00
Gabor Greif
e249fc8808
cache result of operator*
...
llvm-svn: 107982
2010-07-09 16:22:36 +00:00
Gabor Greif
1277447002
cache result of operator*
...
llvm-svn: 107978
2010-07-09 15:53:42 +00:00
Gabor Greif
9096841571
cache result of operator*
...
llvm-svn: 107977
2010-07-09 15:52:36 +00:00
Gabor Greif
6184b1a2fa
cache result of operator*
...
llvm-svn: 107976
2010-07-09 15:40:10 +00:00
Gabor Greif
6c80602356
cache result of operator*
...
llvm-svn: 107967
2010-07-09 14:28:41 +00:00
Gabor Greif
7bc80c7586
do not repeatedly dereference use_iterator
...
llvm-svn: 107963
2010-07-09 13:17:13 +00:00
Stuart Hastings
a3999081cf
Reverting r107918 and r107919. Radar 8063111.
...
llvm-svn: 107930
2010-07-08 23:25:39 +00:00
Stuart Hastings
b70d4e06e3
Fix decl/def debug info for template functions. Radar 8063111.
...
llvm-svn: 107919
2010-07-08 22:28:59 +00:00
Dan Gohman
dbfdd07710
Minore code simplification.
...
llvm-svn: 107777
2010-07-07 14:30:04 +00:00
Dan Gohman
2a08e2ce81
Remove interprocedural-basic-aa and associated code. The AliasAnalysis
...
interface needs implementations to be consistent, so any code which
wants to support different semantics must use a different interface.
It's not currently worthwhile to add a new interface for this new
concept.
Document that AliasAnalysis doesn't support cross-function queries.
llvm-svn: 107776
2010-07-07 14:27:09 +00:00
Gabor Greif
600c671ab6
conditionalize by CallInst::ArgOffset
...
llvm-svn: 107767
2010-07-07 10:34:03 +00:00
Dan Gohman
0cea029f14
Add some more TODO comments.
...
llvm-svn: 107657
2010-07-06 15:23:00 +00:00
Dan Gohman
fa0252225f
Add a comment.
...
llvm-svn: 107656
2010-07-06 15:21:57 +00:00
Dan Gohman
f9365363db
Remove context sensitivity concerns from interprocedural-basic-aa, and
...
make it more aggressive in cases where both pointers are known to live
in the same function.
llvm-svn: 107420
2010-07-01 20:08:40 +00:00
Dan Gohman
547c92af20
In ScalarEvolution::forgetValue, eliminate any SCEVUnknown
...
entries associated with the value being erased in the
folding set map. These entries used to be harmless, because
a SCEVUnknown doesn't store any information about its Value*,
so having a new Value allocated at the old Value's address
wasn't a problem. But now that ScalarEvolution is storing more
information about values, this is no longer safe.
llvm-svn: 107316
2010-06-30 20:21:12 +00:00
Dan Gohman
683a9e2498
Revert the part of r107257 which introduced new logic for using
...
nsw and nuw flags from IR Instructions. On further consideration,
this isn't valid.
llvm-svn: 107298
2010-06-30 17:27:11 +00:00
Dan Gohman
b7fc09a156
Improve ScalarEvolution's nsw and nuw preservation.
...
llvm-svn: 107257
2010-06-30 07:16:37 +00:00
Dan Gohman
7446416058
When computing a new ConservativeResult, intersect it with
...
the old one instead of replacing it, to be more precise.
llvm-svn: 107256
2010-06-30 06:58:35 +00:00
Dan Gohman
2112bbf184
Rework scev-aa's basic computation so that it doesn't depend
...
on ScalarEvolution successfully folding and preserving
range information for both A-B and B-A. Now, if it gets
either one, it's sufficient.
llvm-svn: 107249
2010-06-30 06:12:16 +00:00
Dan Gohman
01304ebfad
Simplify.
...
llvm-svn: 107248
2010-06-30 06:09:46 +00:00
Dan Gohman
32534063c7
Fix ScalarEvolution's tripcount computation for chains of loops
...
where each loop's induction variable's start value is the exit
value of a preceding loop.
llvm-svn: 107224
2010-06-29 23:43:06 +00:00
Dan Gohman
1c9ce3e66d
Fix whitespace style.
...
llvm-svn: 107175
2010-06-29 18:12:34 +00:00
Duncan Sands
b367b1e428
Remove a pointless variable.
...
llvm-svn: 107128
2010-06-29 11:39:45 +00:00
Benjamin Kramer
acb45b427b
Use a more obvious way to avoid compiling functions which are only used when XDEBUG is enabled.
...
llvm-svn: 107125
2010-06-29 10:03:11 +00:00
Chandler Carruth
e9bf8c4ee8
Jump through some silly hoops to make GCC accept that a function may not always
...
be called.
llvm-svn: 107124
2010-06-29 06:46:00 +00:00
Dan Gohman
f5dfb360be
Just as its not safe to blindly transfer the nsw bit from an add
...
instruction to an add scev, it's not safe to blindly transfer the
inbounds flag from a gep instruction to an nsw on the scev for the
gep.
llvm-svn: 107117
2010-06-29 01:41:41 +00:00
Dan Gohman
37bf33ccff
Add an Intraprocedural form of BasicAliasAnalysis, which aims to
...
properly handles instructions and arguments defined in different
functions, or across recursive function iterations.
llvm-svn: 107109
2010-06-29 00:50:39 +00:00
Dan Gohman
bd121d9b9f
Fix Value::stripPointerCasts and BasicAA to avoid trouble on
...
code in unreachable blocks, which have have use-def cycles.
This fixes PR7514.
llvm-svn: 107071
2010-06-28 21:16:52 +00:00
Dan Gohman
d454f5c234
Generalize AAEval so that it can be used both per-function and
...
interprocedurally. Note that as of this writing, existing alias
analysis passes are not prepared to be used interprocedurally.
llvm-svn: 107013
2010-06-28 16:01:37 +00:00
Devang Patel
fdca552823
Use named MDNode, llvm.dbg.sp, to collect subprogram info. This will be used to emit local variable's debug info of deleted functions.
...
llvm-svn: 106989
2010-06-28 05:53:08 +00:00
Devang Patel
858a0f3664
Do not forget last element, function, while creating Subprogram definition MDNode from subprogram declare MDNode.
...
llvm-svn: 106985
2010-06-27 21:04:31 +00:00
Dan Gohman
01de3704f9
Eliminate a redundant FoldingSet lookup.
...
llvm-svn: 106872
2010-06-25 18:47:08 +00:00
Dan Gohman
bfbfa95b51
Don't try to preserve pointer types in SCEVConstants; the old code
...
was over-complicated.
llvm-svn: 106760
2010-06-24 16:47:03 +00:00
Dan Gohman
35a5a7285a
Make the trunc code consistent with the zext and sext code in its
...
handling of pointer types.
llvm-svn: 106757
2010-06-24 16:33:38 +00:00
Gabor Greif
b86c04f740
use ArgOperand accessors
...
llvm-svn: 106697
2010-06-23 23:38:07 +00:00
Gabor Greif
bfb7386690
use the new isFreeCall API and ArgOperand accessors
...
llvm-svn: 106692
2010-06-23 22:48:06 +00:00
Gabor Greif
4615fc1c93
minor enhancement to llvm::isFreeCall API: return CallInst; no functional change
...
llvm-svn: 106686
2010-06-23 21:51:12 +00:00
Gabor Greif
0b348ae475
use ArgOperand getters
...
llvm-svn: 106685
2010-06-23 21:41:47 +00:00
Dan Gohman
f44783ab4e
Replace ScalarEvolution's private copy of getLoopPredecessor
...
with LoopInfo's public copy.
llvm-svn: 106603
2010-06-22 23:43:28 +00:00
Dan Gohman
74d5144414
Use pre-increment instead of post-increment when the result is not used.
...
llvm-svn: 106542
2010-06-22 15:08:57 +00:00
Dan Gohman
a3bc6b13f7
Allow "exhaustive" trip count evaluation on phi nodes with all
...
constant operands.
llvm-svn: 106537
2010-06-22 13:15:46 +00:00
Devang Patel
f50b6147ad
Use single interface, using twine, to get named metadata.
...
getNamedMetadata().
llvm-svn: 106518
2010-06-22 01:19:38 +00:00
Devang Patel
dee41b010a
Do not rely on Twine temporaries to survive.
...
llvm-svn: 106515
2010-06-22 01:01:58 +00:00
Dan Gohman
6a3c46ad49
Use A.append(...) instead of A.insert(A.end(), ...) when A is a
...
SmallVector, and other SmallVector simplifications.
llvm-svn: 106452
2010-06-21 19:47:52 +00:00
Devang Patel
3dbb143c29
Do not directly use function names to construct new name for named metadata.
...
"llvm.dbg.lv.~A" is not a valid name.
llvm-svn: 106438
2010-06-21 18:36:58 +00:00
Dan Gohman
90c5f8753d
Restore a call to rememberInstruction which was accidentally dropped
...
in refactoring.
llvm-svn: 106398
2010-06-19 22:50:35 +00:00
Dan Gohman
cec5b682b6
Fix ScalarEvolution's "exhaustive" trip count evaluation code to avoid
...
assuming that loops are in canonical form, as ScalarEvolution doesn't
depend on LoopSimplify itself. Also, with indirectbr not all loops can
be simplified. This fixes PR7416.
llvm-svn: 106389
2010-06-19 14:17:24 +00:00
Dan Gohman
fb091c213b
Factor out duplicated code for reusing and inserting casts into
...
a helper function.
llvm-svn: 106388
2010-06-19 13:25:23 +00:00
Dan Gohman
b5ec637e57
Revert r106304 (105548 and friends), which are the SCEVComplexityCompare
...
optimizations. There is still some nondeterminism remaining.
llvm-svn: 106306
2010-06-18 19:54:20 +00:00
Dan Gohman
527b570925
Reapply 105540, 105542, and 105548, and revert r105732.
...
llvm-svn: 106304
2010-06-18 19:26:04 +00:00
Dan Gohman
75f6f94c48
Reapply 105546.
...
llvm-svn: 106302
2010-06-18 19:12:32 +00:00
Dan Gohman
ab895769a7
Reapply 105544.
...
llvm-svn: 106301
2010-06-18 19:09:27 +00:00
Dan Gohman
e20e668c7e
Remove getIntegerSCEV; it's redundant with getConstant, and getConstant
...
is more consistent with the ConstantInt API.
llvm-svn: 106281
2010-06-18 14:33:50 +00:00
Dan Gohman
0b5b93b20d
Eliminate unnecessary uses of getZExtValue().
...
llvm-svn: 106279
2010-06-18 14:22:04 +00:00
Dan Gohman
eab6b51039
Fix a typo in a comment.
...
llvm-svn: 106260
2010-06-18 00:53:08 +00:00
Dan Gohman
1d9d93381a
Simplify this code.
...
llvm-svn: 106254
2010-06-17 23:34:09 +00:00
Jim Grosbach
67b46d6303
A few more places where SCEVExpander bits need to skip over debug intrinsics
...
when iterating through instructions. Yet more work for rdar://7797940
llvm-svn: 106149
2010-06-16 21:13:38 +00:00
Devang Patel
108d77796f
Check function pointer first, before comparing function names.
...
llvm-svn: 106088
2010-06-16 06:42:02 +00:00
Devang Patel
3282324020
Use separate named MDNode to hold each function's local variable info.
...
This speeds up local variable handling in DwarfDebug.
llvm-svn: 106075
2010-06-16 00:53:55 +00:00
Stuart Hastings
f9ef9ff3d6
Support for nested functions/classes in debug output. (Again.) Radar 7424645.
...
llvm-svn: 105828
2010-06-11 20:08:44 +00:00
Stuart Hastings
7b15c202c7
Delete duplicate function.
...
llvm-svn: 105827
2010-06-11 20:05:01 +00:00
Evan Cheng
28c151ae52
Revert 105540, 105542, 105544, 105546, and 105548 to unbreak bootstrapping.
...
llvm-svn: 105740
2010-06-09 18:59:43 +00:00
Kenneth Uildriks
2c6b68924d
Pulled CodeMetrics out of InlineCost.h and made it a bit more general, so it can be reused from PartialSpecializationCost
...
llvm-svn: 105725
2010-06-09 15:11:37 +00:00
Dan Gohman
490f4d7020
The FoldingSet hash data includes pointer values, so it isn't
...
determinstic. Instead, give SCEV objects an arbitrary sequence
number.
llvm-svn: 105548
2010-06-07 19:36:14 +00:00
Dan Gohman
ee75f6f4dd
Optimize this code somewhat by taking advantage of the fact
...
that the operands are sorted.
llvm-svn: 105546
2010-06-07 19:20:57 +00:00
Dan Gohman
e4676a62de
Micro-optimize this, to speed up this hotspot in debug builds a little.
...
llvm-svn: 105544
2010-06-07 19:16:37 +00:00
Dan Gohman
044a968609
Micro-optimize this.
...
llvm-svn: 105542
2010-06-07 19:12:54 +00:00
Dan Gohman
65954b2eb4
Optimize ScalarEvolution's SCEVComplexityCompare predicate: don't go
...
scrounging through SCEVUnknown contents and SCEVNAryExpr operands;
instead just do a simple deterministic comparison of the precomputed
hash data.
Also, since this is more precise, it eliminates the need for the slow
N^2 duplicate detection code.
llvm-svn: 105540
2010-06-07 19:06:13 +00:00
Bill Wendling
a96eaed21d
Create new accessors to get arguments for call/invoke instructions. It breaks
...
encapsulation to force the users of these classes to know about the internal
data structure of the Operands structure. It also can lead to errors, like in
the MSIL writer.
llvm-svn: 105539
2010-06-07 19:05:06 +00:00