Chris Lattner
26403acef7
GetLinearExpression is only called when TD is non-null, pass as
...
a reference instead of pointer.
llvm-svn: 111445
2010-08-18 22:52:09 +00:00
Chris Lattner
1b9c38796e
rework GEP decomposition to make a new VariableGEPIndex struct instead of
...
using a pair. This tidies up the code a bit. While setting things up, add
a (currently unused) field to keep track of how the value is extended.
llvm-svn: 111444
2010-08-18 22:47:56 +00:00
Chris Lattner
9f7500f57b
move gep decomposition out of ValueTracking into BasicAA. The form of
...
decomposition that it is doing is very basicaa specific and is only used
by basicaa.
Now with less tree breakingness.
llvm-svn: 111433
2010-08-18 22:07:29 +00:00
Owen Anderson
80d19f0905
Use ConstantRange to propagate information through value definitions.
...
llvm-svn: 111425
2010-08-18 21:11:37 +00:00
Daniel Dunbar
fbeeb130d8
Revert r111375, "move gep decomposition out of ValueTracking into BasicAA. The
...
form of", it doesn't pass tests.
llvm-svn: 111385
2010-08-18 18:43:08 +00:00
Owen Anderson
208636fa33
Inform LazyValueInfo whenever a block is deleted, to avoid dangling pointer issues.
...
llvm-svn: 111382
2010-08-18 18:39:01 +00:00
Chris Lattner
54fe883203
move gep decomposition out of ValueTracking into BasicAA. The form of
...
decomposition that it is doing is very basicaa specific and is only used
by basicaa.
llvm-svn: 111375
2010-08-18 18:22:17 +00:00
Chris Lattner
a33edcb56c
fix PR7589: In brief:
...
gep P, (zext x) != gep P, (sext x)
DecomposeGEPExpression was getting this wrong, confusing
basicaa.
llvm-svn: 111352
2010-08-18 04:28:19 +00:00
Dan Gohman
ed2b005842
Tweak IVUsers' concept of "interesting" to exclude add recurrences
...
where the step value is an induction variable from an outer loop, to
avoid trouble trying to re-expand such expressions. This effectively
hides such expressions from indvars and lsr, which prevents them
from getting into trouble.
llvm-svn: 111317
2010-08-17 22:50:37 +00:00
Owen Anderson
fa7d44687f
Fix another iterator invalidation that caused a *really* nasty miscompilation in 403.gcc.
...
llvm-svn: 111210
2010-08-16 23:42:33 +00:00
Dan Gohman
55cd6aadc9
Make dumpPassStructure be a PMDataManager abstraction, rather than
...
a Pass abstraction, since that's the level it's actually used at.
Rename Pass' dumpPassStructure to dumpPass.
This eliminates an awkward use of getAsPass() to convert a PMDataManager*
into a Pass* just to permit a dumpPassStructure call.
llvm-svn: 111199
2010-08-16 22:45:12 +00:00
Dan Gohman
797a1dbb1c
To create a copy of a SmallVector with an element removed from the
...
middle, copy the elements in two groups, rather than copying all the
elements and then doing an erase on the middle of the result. These
are SmallVectors, so we shouldn't expect to hit dynamic allocation
in the common case.
llvm-svn: 111151
2010-08-16 16:57:24 +00:00
Dan Gohman
0d0cc18af5
Tidy whitespace.
...
llvm-svn: 111147
2010-08-16 16:34:09 +00:00
Dan Gohman
c29eeaecec
Add a comment.
...
llvm-svn: 111145
2010-08-16 16:31:39 +00:00
Dan Gohman
7eac4961d7
Use const_iterator in a few places.
...
llvm-svn: 111144
2010-08-16 16:30:01 +00:00
Dan Gohman
74c61503b1
Use iterators instead of indices in a few more places.
...
llvm-svn: 111143
2010-08-16 16:27:53 +00:00
Dan Gohman
f29618236e
Micro-optimize SCEVConstant comparison.
...
llvm-svn: 111142
2010-08-16 16:25:35 +00:00
Dan Gohman
3688ea5c7d
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
d6925bbe0d
Use iterators instead of indices in simple cases.
...
llvm-svn: 111138
2010-08-16 16:16:11 +00:00
Dan Gohman
b6c773ec2e
Avoid gratuitous inefficiency in ifndef NDEBUG code.
...
llvm-svn: 111137
2010-08-16 16:13:54 +00:00
Dan Gohman
e5fb1036e6
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
b094b39111
Delete an unused function.
...
llvm-svn: 111135
2010-08-16 15:57:14 +00:00
Dan Gohman
fb83b043eb
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
d0fcc9a818
Revert r111082. No warnings for this common pattern.
...
llvm-svn: 111102
2010-08-15 10:27:23 +00:00
Argyrios Kyrtzidis
7c09ddf0ae
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
21e6dc6aa3
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
0c436ab356
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
63c020a210
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
3324b9ec67
Add a const.
...
llvm-svn: 111038
2010-08-13 20:17:27 +00:00
Dan Gohman
cf32f2bde1
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
ec0120a123
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
2de47777f4
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
157847f5d1
Hoist some loop-invariant code out of a hot loop.
...
llvm-svn: 110915
2010-08-12 14:52:55 +00:00
Dan Gohman
e67b287451
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
4d597e8268
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
7b974a45db
Fix a subtle use-after-free issue.
...
llvm-svn: 110863
2010-08-11 22:36:04 +00:00
Dan Gohman
a97e78b4ac
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
0bd61240e9
Improve indentation.
...
llvm-svn: 110778
2010-08-11 04:24:25 +00:00
Dan Gohman
f7495f286a
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
e18c2d6f99
Rename and reorder the arguments to isImpliedCond, for consistency and clarity.
...
llvm-svn: 110750
2010-08-10 23:46:30 +00:00
Owen Anderson
5f1dd0967d
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
3e4d04230b
Add missing argument. CreateCompositeTypeEx() users, please verify.
...
llvm-svn: 110717
2010-08-10 20:22:49 +00:00
Owen Anderson
185fe00633
Switch over to using ConstantRange to track integral values.
...
llvm-svn: 110714
2010-08-10 20:03:09 +00:00
Devang Patel
8e06a5eb47
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
7fbe6cb429
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
b219746c80
Handle TAG_constant for integers.
...
llvm-svn: 110656
2010-08-10 07:11:13 +00:00
Devang Patel
c7cf14f5f6
Refactor.
...
llvm-svn: 110607
2010-08-09 21:39:24 +00:00
Owen Anderson
8afac043fb
Add ConstantRange information to the debugging output.
...
llvm-svn: 110598
2010-08-09 20:50:46 +00:00
Owen Anderson
a7aed18624
Reapply r110396, with fixes to appease the Linux buildbot gods.
...
llvm-svn: 110460
2010-08-06 18:33:48 +00:00
Dan Gohman
e68958fcdf
Implement a proper getModRefInfo for va_arg.
...
llvm-svn: 110458
2010-08-06 18:24:38 +00:00