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

3369 Commits

Author SHA1 Message Date
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
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