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
Dan Gohman
bb27588b3f
Revert r111199; it breaks -debug-pass=Structure output.
...
llvm-svn: 111500
2010-08-19 01:29:07 +00:00
Chris Lattner
7663b66c31
refix PR1143 by making basicaa analyze zexts of indices aggresively,
...
which I broke with a recent patch.
llvm-svn: 111452
2010-08-18 23:09:49 +00:00
Chris Lattner
45440e6f6e
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
1e05823153
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
bd80bd5d69
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
a57dfdac61
Use ConstantRange to propagate information through value definitions.
...
llvm-svn: 111425
2010-08-18 21:11:37 +00:00
Daniel Dunbar
3d68ce9eeb
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
65795241db
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
2d584f0b0e
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
49d0f29752
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
ee89338e37
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
803f9320fa
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
b09e2e1be4
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
013400a0f9
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
7312563612
Tidy whitespace.
...
llvm-svn: 111147
2010-08-16 16:34:09 +00:00
Dan Gohman
8281459eb0
Add a comment.
...
llvm-svn: 111145
2010-08-16 16:31:39 +00:00
Dan Gohman
71323d2cfe
Use const_iterator in a few places.
...
llvm-svn: 111144
2010-08-16 16:30:01 +00:00