1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

3836 Commits

Author SHA1 Message Date
Duncan Sands
ac01c21937 Transform (X/Y)*Y into X if the division is exact. Instcombine already knows how
to do this and more, but would only do it if X/Y had only one use.  Spotted as the
most common missed simplification in SPEC by my auto-simplifier, now that it knows
about nuw/nsw/exact flags.  This removes a bunch of multiplications from 447.dealII
and 483.xalancbmk.  It also removes a lot from tramp3d-v4, which results in much
more inlining.

llvm-svn: 124560
2011-01-30 18:03:50 +00:00
Nick Lewycky
67acf52b2e Fix comment.
llvm-svn: 124544
2011-01-29 19:55:23 +00:00
Frits van Bommel
92dc04df67 Move InstCombine's knowledge of fdiv to SimplifyInstruction().
llvm-svn: 124534
2011-01-29 15:26:31 +00:00
Duncan Sands
0587f785bf Fix typo: should have been testing that X was odd, not V.
llvm-svn: 124533
2011-01-29 13:27:00 +00:00
Andrew Trick
72f17d97f3 Implementation of path profiling.
Modified patch by Adam Preuss.

This builds on the existing framework for block tracing, edge profiling and optimal edge profiling.
See -help-hidden for new flags.
For documentation, see the technical report "Implementation of Path Profiling..." in llvm.org/pubs.

llvm-svn: 124515
2011-01-29 01:09:53 +00:00
Duncan Sands
07617615f4 This dyn_cast should be a cast. Pointed out by Frits van Bommel.
llvm-svn: 124497
2011-01-28 18:53:08 +00:00
Duncan Sands
e788a04c09 Thread divisions over selects and phis. This doesn't fire much and has basically
zero effect on the testsuite (it improves two Ada testcases).

llvm-svn: 124496
2011-01-28 18:50:50 +00:00
Duncan Sands
1a18d8df96 My auto-simplifier noticed that ((X/Y)*Y)/Y occurs several times in SPEC
benchmarks, and that it can be simplified to X/Y.  (In general you can only
simplify (Z*Y)/Y to Z if the multiplication did not overflow; if Z has the
form "X/Y" then this is the case).  This patch implements that transform and
moves some Div logic out of instcombine and into InstructionSimplify.
Unfortunately instcombine gets in the way somewhat, since it likes to change
(X/Y)*Y into X-(X rem Y), so I had to teach instcombine about this too.
Finally, thanks to the NSW/NUW flags, sometimes we know directly that "Z*Y"
does not overflow, because the flag says so, so I added that logic too.  This
eliminates a bunch of divisions and subtractions in 447.dealII, and has good
effects on some other benchmarks too.  It seems to have quite an effect on
tramp3d-v4 but it's hard to say if it's good or bad because inlining decisions
changed, resulting in massive changes all over.

llvm-svn: 124487
2011-01-28 16:51:11 +00:00
Eric Christopher
54f709d970 Temporarily revert 124275 to see if it brings the dragonegg buildbot back.
llvm-svn: 124312
2011-01-26 19:40:31 +00:00
Duncan Sands
803522ec6f APInt has a method for determining whether a number is a power of 2
which is more efficient than countPopulation - use it.

llvm-svn: 124283
2011-01-26 08:44:16 +00:00
Nick Lewycky
fc7a74c9a0 Fix memory corruption. If one of the SCEV creation functions calls another but
doesn't return immediately after then the insert position in UniqueSCEVs will
be out of date. No test because this is a memory corruption issue. Fixes PR9051!

llvm-svn: 124282
2011-01-26 08:40:22 +00:00
Eric Christopher
cb32adbd3f Separate out the constant bonus from the size reduction metrics. Rework
a few loops accordingly. Should be no functional change.

This is a step for more accurate cost/benefit analysis of devirt/inlining
bonuses.

llvm-svn: 124275
2011-01-26 02:58:39 +00:00
Eric Christopher
45e584b1b7 Coding style formatting changes.
llvm-svn: 124260
2011-01-26 01:09:59 +00:00
Duncan Sands
017a3d76f7 In which I discover that zero+zero is zero, d'oh!
llvm-svn: 124188
2011-01-25 15:14:15 +00:00
Duncan Sands
4d8a541ae2 See if this fixes llvm-gcc bootstrap.
llvm-svn: 124184
2011-01-25 12:15:09 +00:00
Duncan Sands
92b081bd42 According to my auto-simplifier the most common missed simplifications in
optimized code are:
  (non-negative number)+(power-of-two) != 0 -> true
and
  (x | 1) != 0 -> true
Instcombine knows about the second one of course, but only does it if X|1
has only one use.  These fire thousands of times in the testsuite.

llvm-svn: 124183
2011-01-25 09:38:29 +00:00
Eric Christopher
8c76a85e48 Reorganize this so that the early exit and special cases come early
rather than interspersed. No functional change.

llvm-svn: 124168
2011-01-25 01:34:31 +00:00
Dan Gohman
db0dc19c04 Give GetUnderlyingObject a TargetData, to keep it in sync
with BasicAA's DecomposeGEPExpression, which recently began
using a TargetData. This fixes PR8968, though the testcase
is awkward to reduce.

Also, update several off GetUnderlyingObject's users
which happen to have a TargetData handy to pass it in.

llvm-svn: 124134
2011-01-24 18:53:32 +00:00
Chris Lattner
1a73dcfbdd fix PR8928 by clearing a stale map, patch by Jakub Staszak!
llvm-svn: 124132
2011-01-24 18:36:51 +00:00
Dan Gohman
308677c046 Add a comment.
llvm-svn: 124126
2011-01-24 17:54:18 +00:00
Nick Lewycky
13a2b8281f Simplify some code with no functionality change. Make the test a lot more
robust against smarter optimizations, using the power of FileCheck.

llvm-svn: 124081
2011-01-23 20:06:05 +00:00
Ted Kremenek
880c19c032 Null initialize a few variables flagged by
clang's -Wuninitialized-experimental warning.
While these don't look like real bugs, clang's
-Wuninitialized-experimental analysis is stricter
than GCC's, and these fixes have the benefit
of being general nice cleanups.

llvm-svn: 124073
2011-01-23 17:05:06 +00:00
Nick Lewycky
2503c9f9c8 Use value ranges to fold ext(trunc) in SCEV when possible.
llvm-svn: 124062
2011-01-23 06:20:19 +00:00
Nick Lewycky
4440e5815b Have SCEV turn sext(x) into zext(x) when x is s>= 0. This applies many times in
"make check" alone.

llvm-svn: 124046
2011-01-22 22:06:21 +00:00
Eric Christopher
ee9652eceb Add a FIXME explaining the move to a single indirect call bonus per function
that we can change from indirect to direct.

llvm-svn: 124045
2011-01-22 21:56:53 +00:00
Eric Christopher
5da99702ec Only apply the devirtualization bonus once instead of per-call site in the
target function.

Fixes part of rdar://8546196

llvm-svn: 124044
2011-01-22 21:17:33 +00:00
Duncan Sands
1faa8712c9 At -O123 the early-cse pass is run before instcombine has run. According to my
auto-simplier the transform most missed by early-cse is (zext X) != 0 -> X != 0.
This patch adds this transform and some related logic to InstructionSimplify
and removes some of the logic from instcombine (unfortunately not all because
there are several situations in which instcombine can improve things by making
new instructions, whereas instsimplify is not allowed to do this).  At -O2 this
often results in more than 15% more simplifications by early-cse, and results in
hundreds of lines of bitcode being eliminated from the testsuite.  I did see some
small negative effects in the testsuite, for example a few additional instructions
in three programs.  One program, 483.xalancbmk, got an additional 35 instructions,
which seems to be due to a function getting an additional instruction and then
being inlined all over the place.

llvm-svn: 123911
2011-01-20 13:21:55 +00:00
Nick Lewycky
51c13384f5 Similarly, analyze truncate through multiply.
llvm-svn: 123842
2011-01-19 18:56:00 +00:00
Nick Lewycky
9867e58096 Add a missed SCEV fold that is required to continue analyzing the IR produced
by indvars through the scev expander.

trunc(add x, y) --> add(trunc x, y). Currently SCEV largely folds the other way
which is probably wrong, but preserved to minimize churn. Instcombine doesn't
do this fold either, demonstrating a missed optz'n opportunity on code doing
add+trunc+add.

llvm-svn: 123838
2011-01-19 16:59:46 +00:00
Nick Lewycky
5a538b62ca Add a missing SCEV simplification sext(zext x) --> zext x.
llvm-svn: 123832
2011-01-19 15:56:12 +00:00
Dan Gohman
df668227fb Teach BasicAA to return PartialAlias in cases where both pointers
are pointing to the same object, one pointer is accessing the entire
object, and the other is access has a non-zero size. This prevents
TBAA from kicking in and saying NoAlias in such cases.

llvm-svn: 123775
2011-01-18 21:16:06 +00:00
Duncan Sands
732cb58b61 For completeness, generalize the (X + Y) - Y -> X transform and add X - (X + 1) -> -1.
These were not recommended by my auto-simplifier since they don't fire often enough.
However they do fire from time to time, for example they remove one subtraction from
the final bitcode for 483.xalancbmk.

llvm-svn: 123755
2011-01-18 11:50:19 +00:00
Duncan Sands
2abe6f500f Simplify (X<<1)-X into X. According to my auto-simplier this is the most common missed
simplification in fully optimized code.  It occurs sporadically in the testsuite, and
many times in 403.gcc: the final bitcode has 131 fewer subtractions after this change.
The reason that the multiplies are not eliminated is the same reason that instcombine
did not catch this: they are used by other instructions (instcombine catches this with
a more general transform which in general is only profitable if the operands have only
one use).

llvm-svn: 123754
2011-01-18 09:24:58 +00:00
Cameron Zwarich
c8083524f8 Move DominanceFrontier from VMCore to Analysis.
llvm-svn: 123747
2011-01-18 06:06:27 +00:00
Chris Lattner
aba06ce448 fix PR8983, a broken assertion.
llvm-svn: 123562
2011-01-16 03:43:53 +00:00
Nick Lewycky
708df45c84 Teach LazyValueInfo that allocas aren't NULL. Over all of llvm-test, this saves
half a million non-local queries, each of which would otherwise have triggered a
linear scan over a basic block.

Also fix a fixme for memory intrinsics which dereference pointers. With this,
we prove that a pointer is non-null because it was dereferenced by an intrinsic
112 times in llvm-test.

llvm-svn: 123533
2011-01-15 09:16:12 +00:00
Duncan Sands
dc51b0ee48 Turn X-(X-Y) into Y. According to my auto-simplifier this is the most common
simplification present in fully optimized code (I think instcombine fails to
transform some of these when "X-Y" has more than one use).  Fires here and
there all over the test-suite, for example it eliminates 8 subtractions in
the final IR for 445.gobmk, 2 subs in 447.dealII, 2 in paq8p etc.

llvm-svn: 123442
2011-01-14 15:26:10 +00:00
Duncan Sands
4757061c47 Factorize common code out of the InstructionSimplify shift logic. Add in
threading of shifts over selects and phis while there.  This fires here and
there in the testsuite, to not much effect.  For example when compiling spirit
it fires 5 times, during early-cse, resulting in 6 more cse simplifications,
and 3 more terminators being folded by jump threading, but the final bitcode
doesn't change in any interesting way: other optimizations would have caught
the opportunity anyway, only later.

llvm-svn: 123441
2011-01-14 14:44:12 +00:00
Duncan Sands
44c273d907 Move some shift transforms out of instcombine and into InstructionSimplify.
While there, I noticed that the transform "undef >>a X -> undef" was wrong.
For example if X is 2 then the top two bits must be equal, so the result can
not be anything.  I fixed this in the constant folder as well.  Also, I made
the transform for "X << undef" stronger: it now folds to undef always, even
though X might be zero.  This is in accordance with the LangRef, but I must
admit that it is fairly aggressive.  Also, I added "i32 X << 32 -> undef"
following the LangRef and the constant folder, likewise fairly aggressive.

llvm-svn: 123417
2011-01-14 00:37:45 +00:00
Tobias Grosser
189efecfed Add single entry / single exit accessors.
Add methods for accessing the (single) entry / exit edge of a region. If no such
edge exists, null is returned.  Both accessors return the start block of the
corresponding edge. The edge can finally be formed by utilizing
Region::getEntry() or Region::getExit();

Contributed by: Andreas Simbuerger <simbuerg@fim.uni-passau.de>

llvm-svn: 123410
2011-01-13 23:18:04 +00:00
Duncan Sands
69fbfa2b0e Remove some wrong code which fortunately was never executed (as explained in
the comment I added): an extern weak global may have a null address.

llvm-svn: 123373
2011-01-13 10:43:08 +00:00
Duncan Sands
36b007d63b The most common simplification missed by instsimplify in unoptimized bitcode
is "X != 0 -> X" when X is a boolean.  This occurs a lot because of the way
llvm-gcc converts gcc's conditional expressions.  Add this, and a few other
similar transforms for completeness.

llvm-svn: 123372
2011-01-13 08:56:29 +00:00
Chris Lattner
8c0a70a30c some comment improvements.
llvm-svn: 123243
2011-01-11 17:11:59 +00:00
Eric Christopher
e86e1aecd8 Temporarily revert 123133, it's causing some regressions and I'm trying
to get a testcase.

llvm-svn: 123225
2011-01-11 09:02:09 +00:00
Chris Lattner
14bf29d7a0 the GEP faq says that only inbounds geps are guaranteed to not overflow.
llvm-svn: 123218
2011-01-11 06:44:41 +00:00
Jakob Stoklund Olesen
43e92a1d28 Revert r123207: "Turn on memdep's verifyRemoved() in an attempt to smoke out the cause of our gcc bootstrap miscompare."
It didn't.

llvm-svn: 123215
2011-01-11 04:05:39 +00:00
Jakob Stoklund Olesen
d8abef4798 Turn on memdep's verifyRemoved() in an attempt to smoke out the cause of our gcc bootstrap miscompare.
llvm-svn: 123207
2011-01-11 01:18:03 +00:00
Chandler Carruth
250dce460c Teach constant folding to perform conversions from constant floating
point values to their integer representation through the SSE intrinsic
calls. This is the last part of a README.txt entry for which I have real
world examples.

llvm-svn: 123206
2011-01-11 01:07:24 +00:00
Chandler Carruth
5ac8ca39c0 Cleanup some of the constant folding code to consistently test intrinsic
IDs when available rather than using a mixture of IDs and textual name
comparisons.

llvm-svn: 123165
2011-01-10 09:02:58 +00:00
Chris Lattner
0643d32b61 add a fixme: ir isn't expressive enough.
llvm-svn: 123139
2011-01-09 23:02:10 +00:00
Chris Lattner
c8a9f4ca2b Step #4 in improving trip count analysis: HowFarToZero can analyze
NUW AddRec's much more aggressively.  We now get a trip count
for @test2 in nsw.ll

llvm-svn: 123138
2011-01-09 22:58:47 +00:00
Chris Lattner
09cfec2226 rearrange some code, no functionality change.
llvm-svn: 123136
2011-01-09 22:39:48 +00:00
Chris Lattner
4efcd276de Step #3 to improving trip count analysis: If we fold
a + {b,+,stride} into {a+b,+,stride}  (because a is LIV),
then the resultant AddRec is NUW/NSW if the client says it
is.

llvm-svn: 123133
2011-01-09 22:31:26 +00:00
Chris Lattner
b6a67a9068 Step #2 to improve trip count analysis for loops like this:
void f(int* begin, int* end) { std::fill(begin, end, 0); }

which turns into a != exit expression where one pointer is
strided and (thanks to step #1) known to not overflow, and 
the other is loop invariant.

The observation here is that, though the IV is strided by
4 in this case, that the IV *has* to become equal to the
end value.  It cannot "miss" the end value by stepping over
it, because if it did, the strided IV expression would
eventually wrap around.

Handle this by turning A != B into "A-B != 0" where the A-B
part is known to be NUW.

llvm-svn: 123131
2011-01-09 22:26:35 +00:00
Chris Lattner
57e9b35653 teach SCEV analysis of PHI nodes that PHI recurences formed
with GEP instructions are always NUW, because PHIs cannot wrap
the end of the address space.

llvm-svn: 123105
2011-01-09 02:28:48 +00:00
Chris Lattner
fa37cac39c reduce indentation. Print <nuw> and <nsw> when dumping SCEV AddRec's
that have the bit set.

llvm-svn: 123104
2011-01-09 02:16:18 +00:00
Chris Lattner
6430d12360 use isNullValue() to simplify code, add an assert.
llvm-svn: 122977
2011-01-06 22:24:29 +00:00
Chris Lattner
83067bc3e7 implement constant folding support for an exotic constant expr:
ret i64 ptrtoint (i8* getelementptr ([1000 x i8]* @X, i64 1, i64 sub (i64 0, i64 ptrtoint ([1000 x i8]* @X to i64))) to i64)

to "ret i64 1000".  This allows us to correctly compute the trip count
on a loop in PR8883, which occurs with std::fill on a char array.  This
allows us to transform it into a memset with a constant size.

llvm-svn: 122950
2011-01-06 06:19:46 +00:00
Owen Anderson
ba8ae674d7 Reorder, rename, and document some members to make this easier to follow.
llvm-svn: 122929
2011-01-05 23:26:22 +00:00
Owen Anderson
97bd86a5e7 When computing the value on an edge, in certain cases LVI would fail to compute the value range
in the predecessor block, leading to an incorrect conclusion for the edge value.  Found by inspection.

llvm-svn: 122908
2011-01-05 21:37:18 +00:00
Owen Anderson
3d7ba422df Re-convert several of LazyValueInfo's internal maps to Dense{Map|Set}, and fix the issue in
hasBlockValue() that was causing iterator invalidations.  Many thanks to Dimitry Andric for
tracking down those invalidations!

llvm-svn: 122906
2011-01-05 21:15:29 +00:00
Chris Lattner
dbb1b09731 fix an off-by-one bug that caused a crash analyzing
ashr's with huge shift amounts, PR8896

llvm-svn: 122814
2011-01-04 18:19:15 +00:00
Owen Anderson
ce48a5e838 Use the new addEscapingValue callback to update GlobalsModRef when GVN adds PHIs of GEPs. For the moment,
have GlobalsModRef handle this conservatively by simply removing the value from its maps.

llvm-svn: 122787
2011-01-03 23:51:43 +00:00
Owen Anderson
a52e5dbdfa Stub out a new updating interface to AliasAnalysis, allowing stateful analyses to be informed when
a pointer value has potentially become escaping.  Implementations can choose to either fall back to
conservative responses for that value, or may recompute their analysis to accomodate the change.

llvm-svn: 122777
2011-01-03 21:38:41 +00:00
Chris Lattner
a7735a573d fix rdar://8813415 - a miscompilation of 164.gzip that loop-idiom
exposed.  It turns out to be a latent bug in basicaa, scary.

llvm-svn: 122772
2011-01-03 21:03:33 +00:00
Nick Lewycky
4840065424 Add spliceFunction to the CallGraph interface. This allows users to efficiently
update a callGraph when performing the common operation of splicing the body to
a new function and updating all callers (such as via RAUW).

No users yet, though this is intended for DeadArgumentElimination as part of
PR8887.

llvm-svn: 122728
2011-01-03 03:19:35 +00:00
Chris Lattner
e396e846b4 split dom frontier handling stuff out to its own DominanceFrontier header,
so that Dominators.h is *just* domtree.  Also prune #includes a bit.

llvm-svn: 122714
2011-01-02 22:09:33 +00:00
Duncan Sands
aaddf57af9 Revert commit 122654 at the request of Chris, who reckons that instsimplify
is the wrong hammer for this nail, and is probably right.

llvm-svn: 122661
2011-01-01 20:08:02 +00:00
Duncan Sands
ec8b2b4cc5 Fix a README item by having InstructionSimplify do a mild form of value
numbering, in which it considers (for example) "%a = add i32 %x, %y" and
"%b = add i32 %x, %y" to be equal because the operands are equal and the
result of the instructions only depends on the values of the operands.
This has almost no effect (it removes 4 instructions from gcc-as-one-file),
and perhaps slows down compilation: I measured a 0.4% slowdown on the large
gcc-as-one-file testcase, but it wasn't statistically significant.

llvm-svn: 122654
2011-01-01 16:12:09 +00:00
Benjamin Kramer
5acd47c674 Cast away "comparison between signed and unsigned integer" warnings.
llvm-svn: 122598
2010-12-28 13:52:52 +00:00
Chris Lattner
c56d20aa48 move isBytewiseValue out to ValueTracking.h/cpp
llvm-svn: 122565
2010-12-26 20:15:01 +00:00
Jeffrey Yasskin
a199652a3e Change all self assignments X=X to (void)X, so that we can turn on a
new gcc warning that complains on self-assignments and
self-initializations.

llvm-svn: 122458
2010-12-23 00:58:24 +00:00
Duncan Sands
68d969c2f5 When determining whether the new instruction was already present in
the original instruction, half the cases were missed (making it not
wrong but suboptimal).  Also correct a typo (A <-> B) in the second
chunk. 

llvm-svn: 122414
2010-12-22 17:15:25 +00:00
Duncan Sands
9b28a173fe Add some statistics, good for understanding how much more powerful
instcombine is compared to instsimplify.

llvm-svn: 122397
2010-12-22 09:40:51 +00:00
Duncan Sands
b4497c7e0f While I don't think any later transforms can fire, it seems cleaner to
not assume this (for example in case more transforms get added below
it).  Suggested by Frits van Bommel.

llvm-svn: 122332
2010-12-21 15:03:43 +00:00
Duncan Sands
7e94cad96b Fix inverted condition noticed by Frits van Bommel.
llvm-svn: 122331
2010-12-21 14:48:48 +00:00
Duncan Sands
6b0ed93a81 Pull a few more simplifications out of instcombine (there are still
plenty left though!), in particular for multiplication.

llvm-svn: 122330
2010-12-21 14:00:22 +00:00
Duncan Sands
0bd25425b6 Teach InstructionSimplify about distributive laws. These transforms fire
quite often, but don't make much difference in practice presumably because
instcombine also knows them and more.

llvm-svn: 122328
2010-12-21 13:32:22 +00:00
Duncan Sands
2ca8f72575 Move checking of the recursion limit into the various Thread methods.
No functionality change.

llvm-svn: 122327
2010-12-21 09:09:15 +00:00
Duncan Sands
5880f299da Add generic simplification of associative operations, generalizing
a couple of existing transforms.  This fires surprisingly often, for
example when compiling gcc "(X+(-1))+1->X" fires quite a lot as well
as various "and" simplifications (usually with a phi node operand).
Most of the time this doesn't make a real difference since the same
thing would have been done elsewhere anyway, eg: by instcombine, but
there are a few places where this results in simplifications that we
were not doing before.

llvm-svn: 122326
2010-12-21 08:49:00 +00:00
Owen Anderson
308ca4e488 Speculatively revert the use of DenseMap in LazyValueInfo, which may be causing Linux self-host failures.
llvm-svn: 122291
2010-12-20 23:53:19 +00:00
Owen Anderson
b481f13b97 Attempt to appease the DragonEgg buildbots.
llvm-svn: 122288
2010-12-20 23:23:18 +00:00
Owen Anderson
006186c519 Convert one of LVI's primary maps to a DenseMap, now that we know are more assured of iterator stability.
llvm-svn: 122273
2010-12-20 21:30:54 +00:00
Owen Anderson
7a69be36e5 More LVI cleanups, including trying to simplify the process of maintaining the OverDefinedCache.
llvm-svn: 122256
2010-12-20 19:33:41 +00:00
Owen Anderson
2ebd7e9192 Reuse the reference into the LVI cache throughout the solver subsystem. This is much easier to
verify as being safe thanks its recent de-recursivization.

llvm-svn: 122254
2010-12-20 18:18:16 +00:00
Duncan Sands
f72cfa961d Have SimplifyBinOp dispatch Xor, Add and Sub to the corresponding methods
(they had just been forgotten before).  Adding Xor causes "main" in the
existing testcase 2010-11-01-lshr-mask.ll to be hugely more simplified.

llvm-svn: 122245
2010-12-20 14:47:04 +00:00
Nick Lewycky
44a08d5812 Make LazyValueInfo non-recursive.
llvm-svn: 122120
2010-12-18 01:00:40 +00:00
Nate Begeman
063d88d6fb Add vector versions of some existing scalar transforms to aid codegen in matching psign & pblend operations to the IR produced by clang/gcc for their C idioms.
llvm-svn: 122105
2010-12-17 23:12:19 +00:00
Dan Gohman
8540450279 Update a comment.
llvm-svn: 121946
2010-12-16 02:55:10 +00:00
Dan Gohman
e106936414 Make memcpyopt TBAA-aware.
llvm-svn: 121944
2010-12-16 02:51:19 +00:00
Dan Gohman
b9583fff47 Enable TBAA by default.
llvm-svn: 121923
2010-12-15 23:58:44 +00:00
Dan Gohman
7c7b24af4d Reapply r121886, and also update DecomposeGEPExpression to keep
it in sync.

llvm-svn: 121895
2010-12-15 20:49:55 +00:00
Dan Gohman
4f6b802044 Revert r121886. DecomposeGEPExpression needs to be kept
in sync.

llvm-svn: 121892
2010-12-15 20:39:25 +00:00
Dan Gohman
8b09daa387 Strengthen GetUnderlyingObject using InstructionSimplify.
While LLVM's main design is that analysis code shouldn't
go out of its way to understand code which hasn't been
InstCombined, analysis utility routines like this can
find themselves being called in the middle of transform
passes when instcombine hasn't had a chance to run.

llvm-svn: 121886
2010-12-15 20:10:26 +00:00
Dan Gohman
295ba3ab26 Move Value::getUnderlyingObject to be a standalone
function so that it can live in Analysis instead of
VMCore.

llvm-svn: 121885
2010-12-15 20:02:24 +00:00
Nick Lewycky
44b582fb69 Clean up some of LVI:
* mergeIn now uses constant folding for constants that are provably not-equal.
 * sink some sanity checks from the get*() methods into the mark*() methods, to ensure that we never have a constant/notconstant ConstantInt
 * some textual cleanups, whitespace changes, removing "else" after return, that sort of thing.

llvm-svn: 121877
2010-12-15 18:57:18 +00:00
Duncan Sands
2699fb1072 Move Sub simplifications and additional Add simplifications out of
instcombine and into InstructionSimplify.

llvm-svn: 121861
2010-12-15 14:07:39 +00:00
Duncan Sands
a9b837f7c7 If we detect that the instruction we are simplifying is unreachable, arrange for
it to be replaced by undef rather than not replaced at all, the idea being that
this may reduce the amount of work done by whoever called InstructionSimplify.

llvm-svn: 121860
2010-12-15 11:02:22 +00:00
Dan Gohman
1baada041e Update a comment.
llvm-svn: 121727
2010-12-13 22:53:18 +00:00
Dan Gohman
b187cce266 Reapply r121520, PartialAlias implementation for BasicAA, now that
memdep is updated to handle it.

llvm-svn: 121725
2010-12-13 22:50:24 +00:00
Dan Gohman
f4e1d91b8e Update memdep to handle PartialAlias as MayAlias.
llvm-svn: 121723
2010-12-13 22:47:57 +00:00
Tobias Grosser
cd3d63e102 Remove useless dynamic_cast<>().
Thanks Peter for pointing me to something that should have never been
committed to the llvm code base.

llvm-svn: 121648
2010-12-12 21:58:28 +00:00
Dan Gohman
18e2a55c07 Revert r121520, which may have introduced miscompilations.
llvm-svn: 121573
2010-12-10 21:48:28 +00:00
Dan Gohman
d1bf1d8013 Implement PartialAlias checking in BasicAA.
llvm-svn: 121520
2010-12-10 20:47:03 +00:00
Dan Gohman
b0fa0f7849 Minimally update this code to handle PartialAlias.
llvm-svn: 121518
2010-12-10 20:14:49 +00:00
Dan Gohman
98f5b2ae22 Use PartialAlias to do better noalias lint checking.
llvm-svn: 121514
2010-12-10 20:04:06 +00:00
Dan Gohman
cbee92bb65 Teach AliasAnalysisCounter about PartialAlias.
llvm-svn: 121513
2010-12-10 19:53:05 +00:00
Dan Gohman
26e1b4ac11 Teach AliasAnalysisEvaluator about PartialAlias.
llvm-svn: 121512
2010-12-10 19:52:40 +00:00
Dan Gohman
9e03ffc789 Update this code to handle PartialAlias as MayAlias.
llvm-svn: 121508
2010-12-10 19:40:47 +00:00
Owen Anderson
a882a78d4b Take the first step towards making LVI non-recursive: get rid of the LVIQuery abstraction.
llvm-svn: 121357
2010-12-09 06:14:58 +00:00
Devang Patel
e515e18523 Use type's file info while describing inheritance relationship.
llvm-svn: 121289
2010-12-08 21:46:37 +00:00
Devang Patel
90fd70aa09 Add support to create debug info for functions and methods.
llvm-svn: 121281
2010-12-08 20:42:44 +00:00
Devang Patel
53f05af4c1 Add support to create class type.
llvm-svn: 121279
2010-12-08 20:18:20 +00:00
Devang Patel
b7a7988b6b Add support to create vector, array, enums etc...
llvm-svn: 121224
2010-12-08 01:50:15 +00:00
Devang Patel
0c0accf6bc Global variable does not need linkage name.
llvm-svn: 121212
2010-12-08 00:06:22 +00:00
Devang Patel
bdbff5f106 Add support to create local variable's debug info.
llvm-svn: 121211
2010-12-07 23:58:00 +00:00
Devang Patel
cef2982b39 Add support to create variables, structs etc.. using DIBuilder.
This is still work in progress.

llvm-svn: 121205
2010-12-07 23:25:47 +00:00
Jay Foad
79e18ed269 PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method
trunc(), to be const and to return a new value instead of modifying the
object in place.

llvm-svn: 121120
2010-12-07 08:25:19 +00:00
Jakob Stoklund Olesen
6f535251de Also inore '()' while creating mdnode name from ObjC symbol name.
llvm-svn: 120856
2010-12-03 23:40:45 +00:00
Devang Patel
fdc570cad4 Ignore '+' while creating mdnode name from ObjC symbol name.
llvm-svn: 120853
2010-12-03 23:29:30 +00:00
Jay Foad
789e8ac4f7 PR5207: Rename overloaded APInt methods set(), clear(), flip() to
setAllBits(), setBit(unsigned), etc.

llvm-svn: 120564
2010-12-01 08:53:58 +00:00
Chris Lattner
58b829f94c move GetPointerBaseWithConstantOffset out of GVN into ValueTracking.h
llvm-svn: 120476
2010-11-30 22:25:26 +00:00
Jay Foad
c663d7e4f6 PR5207: Make APInt::set(), APInt::clear() and APInt::flip() return void.
llvm-svn: 120413
2010-11-30 09:02:01 +00:00
Chris Lattner
84d3d220c1 strength reduce this.
llvm-svn: 120381
2010-11-30 01:56:13 +00:00
Chris Lattner
cbe6b88afe getLocationForDest should work for memset as well.
llvm-svn: 120380
2010-11-30 01:48:20 +00:00
Chris Lattner
083731f3d6 enhance basicaa to return "Mod" for a memcpy call when the
queried location doesn't overlap the source, and add a testcase.

llvm-svn: 120370
2010-11-30 00:43:16 +00:00
Chris Lattner
8ec1830a01 Teach basicaa that memset's modref set is at worst "mod" and never
contains "ref".

Enhance DSE to use a modref query instead of a store-specific hack
to generalize the "ignore may-alias stores" optimization to handle
memset and memcpy.

llvm-svn: 120368
2010-11-30 00:28:45 +00:00
Frits van Bommel
6610b43890 Teach ConstantFoldInstruction() how to fold insertvalue and extractvalue.
llvm-svn: 120316
2010-11-29 20:36:52 +00:00
Michael J. Spencer
d5ec932c3a Merge System into Support.
llvm-svn: 120298
2010-11-29 18:16:10 +00:00
Chandler Carruth
12806a53f3 Add some dead stores to pacify my least favorite GCC warning: may be
uninitialized. The warning is terrible, has incorrect source locations, and has
a huge false positive rate such as *all* of these.

If anyone has a better solution, please let me know. Alternatively, I'll
happily add -Wno-uninitialized to the -Werror build mode. Maybe I can even do
it *only* when building with GCC instead of Clang.

llvm-svn: 120281
2010-11-29 01:41:13 +00:00
Duncan Sands
97ada840ed Expand a little on the description of what InstructionSimplify does.
llvm-svn: 120016
2010-11-23 10:50:08 +00:00
Duncan Sands
809b3e3634 Clarify that constant folding of instructions applies when all operands
are constant.  There was in fact one exception to this (phi nodes) - so
remove that exception (InstructionSimplify handles this so there should
be no loss).

llvm-svn: 120015
2010-11-23 10:16:18 +00:00
Duncan Sands
73f0559779 If a GEP index simply advances by multiples of a type of zero size,
then replace the index with zero.

llvm-svn: 119974
2010-11-22 16:32:50 +00:00
Duncan Sands
ffcd1f61d9 Move the "gep undef" -> "undef" transform from instcombine to
InstructionSimplify.

llvm-svn: 119970
2010-11-22 13:42:49 +00:00
Benjamin Kramer
3fb7d5556c Initialize MemDep's TD member so buildbots don't trip over an uninitialized pointer (TD is passed to PHITransAddr).
I wonder why this didn't explode earlier.

llvm-svn: 119944
2010-11-21 15:21:46 +00:00
Duncan Sands
c2b128ad7d Add a rather pointless InstructionSimplify transform, inspired by recent constant
folding improvements: if P points to a type of size zero, turn "gep P, N" into "P".
More generally, if a gep index type has size zero, instcombine could replace the
index with zero, but that is not done here.

llvm-svn: 119942
2010-11-21 13:53:09 +00:00
Duncan Sands
4ef7e7f158 Fix spelling.
llvm-svn: 119941
2010-11-21 12:43:13 +00:00
Chris Lattner
1b3dffa2d1 apply Dan's fix for PR8268 which allows constant folding to handle indexes over
zero sized elements.  This allows us to compile:

  #include <string>
  void foo() { std::string s; }

into an empty function.

llvm-svn: 119933
2010-11-21 08:39:01 +00:00
Chris Lattner
a39a40d351 add "getLocation" method to AliasAnalysis for getting the source and
destination location of a memcpy/memmove.  I'm not clear about whether
TBAA works on these, so I'm leaving it out for now.  Dan, please revisit
this when convenient.

llvm-svn: 119928
2010-11-21 07:51:27 +00:00
Chris Lattner
3a0edfb37c implement PR8576, deleting dead stores with intervening may-alias stores.
llvm-svn: 119927
2010-11-21 07:34:32 +00:00
Benjamin Kramer
9141603779 Simplify code. No change in functionality.
llvm-svn: 119908
2010-11-20 18:43:35 +00:00
Benjamin Kramer
821c39433d Silence warning about an uninitialized variable.
llvm-svn: 119800
2010-11-19 11:37:26 +00:00
Duncan Sands
56aefef080 Remove threading of Xor over selects and phis, with an explanation
of why such threading is pointless.

llvm-svn: 119798
2010-11-19 09:20:39 +00:00
Duncan Sands
4562d3b919 Factor code for testing whether replacing one value with another
preserves LCSSA form out of ScalarEvolution and into the LoopInfo
class.  Use it to check that SimplifyInstruction simplifications
are not breaking LCSSA form.  Fixes PR8622.

llvm-svn: 119727
2010-11-18 19:59:41 +00:00
Dan Gohman
87b78a4726 Strip trailing whitespace.
llvm-svn: 119706
2010-11-18 17:06:31 +00:00
Dan Gohman
99ac1c6b83 Use llvm_unreachable for "impossible" situations.
llvm-svn: 119705
2010-11-18 17:05:57 +00:00
Dan Gohman
ec75e876ab Add support for PHI-translating sext, zext, and trunc instructions,
enabling more PRE. PR8586.

llvm-svn: 119704
2010-11-18 17:05:13 +00:00
Dan Gohman
3213622610 Introduce memoization for ScalarEvolution dominates and properlyDominates
queries, and SCEVExpander getRelevantLoop queries.

llvm-svn: 119595
2010-11-18 00:34:22 +00:00
Dan Gohman
ecff21cc67 Factor out the code for purging a SCEV from all the various memoization maps.
Some of these maps may merge in the future, but for now it's convenient to have
a utility function for them.

llvm-svn: 119587
2010-11-17 23:28:48 +00:00
Dan Gohman
8e594dfe39 Merge the implementations of isLoopInvariant and hasComputableLoopEvolution, and
memoize the results. This improves compile time in code which highly complex
expressions which get queried many times.

llvm-svn: 119584
2010-11-17 23:21:44 +00:00
Dan Gohman
fb6ea18d0a Make SCEV::getType() and SCEV::print non-virtual. Move SCEV::hasOperand
to ScalarEvolution. Delete SCEV::~SCEV. SCEV is no longer virtual.

llvm-svn: 119578
2010-11-17 22:27:42 +00:00
Dan Gohman
9bbb0fa515 Move SCEV::dominates and properlyDominates to ScalarEvolution.
llvm-svn: 119570
2010-11-17 21:41:58 +00:00
Dan Gohman
04df5af12b Move SCEV::isLoopInvariant and hasComputableLoopEvolution to be member
functions of ScalarEvolution, in preparation for memoization and
other optimizations.

llvm-svn: 119562
2010-11-17 21:23:15 +00:00
Duncan Sands
b5fd5f2124 Before replacing a phi node with a different value, it
needs to be checked that this won't break LCSSA form.
Change the existing checking method to a more direct one:
rather than seeing if all predecessors belong to the loop,
check that the replacing value is either not in any loop or
is in a loop that contains the phi node.

llvm-svn: 119556
2010-11-17 20:49:12 +00:00
Dan Gohman
4dc0a20aea Verify SCEVAddRecExpr's invariant in ScalarEvolution::getAddRecExpr
instead of in SCEVAddRecExpr's constructor, in preparation for an
upcoming change.

llvm-svn: 119554
2010-11-17 20:48:38 +00:00
Dan Gohman
a585073323 Fix ScalarEvolution's range memoization to avoid using a
default ctor with ConstantRange.

llvm-svn: 119550
2010-11-17 20:23:08 +00:00
Duncan Sands
2bd7e7c274 Move some those Xor simplifications which don't require creating new
instructions out of InstCombine and into InstructionSimplify.  While
there, introduce an m_AllOnes pattern to simplify matching with integers
and vectors with all bits equal to one.

llvm-svn: 119536
2010-11-17 18:52:15 +00:00
Duncan Sands
a5bd3ff0e4 Now that hasConstantValue has been made simpler, it may return the
phi node itself if it occurs in an unreachable basic block.  Protect
against this.  Hopefully this will fix some more buildbots.

llvm-svn: 119493
2010-11-17 10:23:23 +00:00
Duncan Sands
d3c1ca1f00 Previously SimplifyInstruction could report that an instruction
simplified to itself (this can only happen in unreachable blocks).
Change it to return null instead.  Hopefully this will fix some
buildbot failures.

llvm-svn: 119490
2010-11-17 08:35:29 +00:00
Duncan Sands
48517dac03 Fix a layering violation: hasConstantValue, which is part of the PHINode
class, uses DominatorTree which is an analysis.  This change moves all of
the tricky hasConstantValue logic to SimplifyInstruction, and replaces it
with a very simple literal implementation.  I already taught users of
hasConstantValue that need tricky stuff to use SimplifyInstruction instead.
I didn't update InlineFunction because the IR looks like it might be in a
funky state at the point it calls hasConstantValue, which makes calling
SimplifyInstruction dangerous since it can in theory do a lot of tricky
reasoning.  This may be a pessimization, for example in the case where
all phi node operands are either undef or a fixed constant.

llvm-svn: 119459
2010-11-17 04:30:22 +00:00
Duncan Sands
7376a19858 Have ScalarEvolution use SimplifyInstruction rather than hasConstantValue.
While there, add a note about an inefficiency I noticed.

llvm-svn: 119458
2010-11-17 04:18:45 +00:00
Dan Gohman
b10ff802a0 Memoize results from ScalarEvolution's getUnsignedRange and getSignedRange.
This fixes some extreme compile times on unrolled sha512 code.

llvm-svn: 119455
2010-11-17 02:44:44 +00:00
Duncan Sands
825c7d7f79 In which I discover the existence of loops. Threading an operation
over a phi node by applying it to each operand may be wrong if the
operation and the phi node are mutually interdependent (the testcase
has a simple example of this).  So only do this transform if it would
be correct to perform the operation in each predecessor of the block
containing the phi, i.e. if the other operands all dominate the phi.
This should fix the FFMPEG snow.c regression reported by İsmail Dönmez.

llvm-svn: 119347
2010-11-16 12:16:38 +00:00
Duncan Sands
ccdccb2776 Teach InstructionSimplify the trick of skipping incoming phi
values that are equal to the phi itself.

llvm-svn: 119161
2010-11-15 17:52:45 +00:00
Duncan Sands
63e80e0593 If dom tree information is available, make it possible to pass
it to get better phi node simplification.

llvm-svn: 119055
2010-11-14 18:36:10 +00:00
Duncan Sands
617030ad18 Teach InstructionSimplify about phi nodes. I chose to have it simply
offload the work to hasConstantValue rather than do something more
complicated (such handling mutually recursive phis) because (1) it is
not clear it is worth it; and (2) if it is worth it, maybe such logic
would be better placed in hasConstantValue.  Adjust some GVN tests
which are now cleaned up much further (eg: all phi nodes are removed).

llvm-svn: 119043
2010-11-14 13:30:18 +00:00
Duncan Sands
9a914e2b5e Boost the power of phi node constant folding slightly: if all
operands are the phi node itself or undef, then return undef.
This logic already existed at a higher level so in practice it
shouldn't make the slightest difference.  Note that this code
could be replaced by a call to PN->hasConstantValue().  However
since we bail out the moment we see a non-constant operand, it
is more efficient to have a specialized version of that logic.

llvm-svn: 119041
2010-11-14 12:53:18 +00:00
Duncan Sands
ab39985d42 Strip trailing whitespace.
llvm-svn: 119038
2010-11-14 11:23:23 +00:00
Duncan Sands
6ff5e53731 Fix typo pointed out by Trevor Harmon.
llvm-svn: 119001
2010-11-13 12:16:27 +00:00
Dan Gohman
ec55b3ac75 Re-disable TBAA for now; it broke MultiSource/Applications/JM/lencod,
at least.

llvm-svn: 118890
2010-11-12 11:21:08 +00:00
Dan Gohman
f867bfd906 Enable TBAA.
llvm-svn: 118884
2010-11-12 06:20:01 +00:00
Dan Gohman
f3bf6591e0 Add helper functions for computing the Location of load, store,
and vaarg instructions.

llvm-svn: 118845
2010-11-11 21:50:19 +00:00
Dan Gohman
97ce60bfa4 Don't forget the TBAA info, if available.
llvm-svn: 118842
2010-11-11 21:27:26 +00:00
Dan Gohman
b68f197748 Avoid calling alias on non-pointer values.
llvm-svn: 118822
2010-11-11 19:23:51 +00:00
Dan Gohman
50936c7c4b It's not necessary to clear out the Size and TBAATag at each of
these points.

llvm-svn: 118752
2010-11-11 00:42:22 +00:00
Dan Gohman
b476dc0f55 Set NonLocalDepInfo's Size field to UnknownSize when invalidating
it, so that it doesn't appear to be a known size.

llvm-svn: 118748
2010-11-11 00:20:27 +00:00
Dan Gohman
8895f1c5d5 When clearing a non-local pointer dependency cache entry, clear
the reverse map too. This fixes seflhost build errors.

llvm-svn: 118729
2010-11-10 22:35:02 +00:00
Devang Patel
5520a6fc97 Take care of special characters while creating named MDNode name to hold function specific local variable's info.
This fixes radar 8653152. I am checking in testcase as a separate check-in.

llvm-svn: 118726
2010-11-10 22:19:21 +00:00
Dan Gohman
543edf7e84 Factor out the code for computing an AliasAnalysis::Location
for a given instruction into a helper function.

llvm-svn: 118723
2010-11-10 21:51:35 +00:00
Dan Gohman
aef3e95364 Fully invalidate cached results when a prior query's size or
type is insufficient for, or incompatible with, the current query.

llvm-svn: 118721
2010-11-10 21:45:11 +00:00
Duncan Sands
815e967d98 Reduce the maximum recursion depth, 5 seems pointlessly too much.
Probably it should just be 1, but compromise with 3.

llvm-svn: 118718
2010-11-10 20:53:24 +00:00
Dan Gohman
2b4e8302a6 Enhance GVN to do more precise alias queries for non-local memory
references. For example, this allows gvn to eliminate the load in
this example:

  void foo(int n, int* p, int *q) {
    p[0] = 0;
    p[1] = 1;
    if (n) {
      *q = p[0];
    }
  }

llvm-svn: 118714
2010-11-10 20:37:15 +00:00
Duncan Sands
8531f14f5b Teach InstructionSimplify how to look through PHI nodes. Since PHI
nodes can be used in loops, this could result in infinite looping
if there is no recursion limit, so add such a limit.  It is also
used for the SelectInst case because in theory there could be an
infinite loop there too if the basic block is unreachable.

llvm-svn: 118694
2010-11-10 18:23:01 +00:00
Dan Gohman
65a3841f03 Add a doesAccessArgPointees helper function, and update code to use
it, and to be consistent.

llvm-svn: 118692
2010-11-10 18:17:28 +00:00
Duncan Sands
1ecf1f999e Simplify binary operations where one operand is a select instruction.
The simplifications performed here never create new instructions, they
only return existing instructions (or a constant), and so are always a
win.  In theory they should transform (for example)
  %z = and i32 %x, %y
  %s = select i1 %cond, i32 %y, i32 %z
  %r = and i32 %x, %s
into
  %r = and i32 %x, y
but in practice they get into a fight with instcombine, and lose.
Unfortunately instcombine does a poor job in this case.  Nonetheless
I'm committing this transform to make it easier to discuss what to
do to make peace with instcombine.

llvm-svn: 118679
2010-11-10 13:00:08 +00:00
Dan Gohman
1571dfc883 Make ModRefBehavior a lattice. Use this to clean up AliasAnalysis
chaining and simplify FunctionAttrs' GetModRefBehavior logic.

llvm-svn: 118660
2010-11-10 01:02:18 +00:00
Dan Gohman
ebeb34d412 VAArg doesn't capture its operand.
llvm-svn: 118623
2010-11-09 20:09:35 +00:00
Dan Gohman
f82eabd648 Teach AliasAnalysis about AccessesArgumentsReadonly.
llvm-svn: 118621
2010-11-09 20:06:55 +00:00
Dan Gohman
1308376ebf Teach LICM and AliasSetTracker about AccessesArgumentsReadonly.
llvm-svn: 118618
2010-11-09 19:58:21 +00:00
Duncan Sands
f68789ed87 Factorize code, no functionality change.
llvm-svn: 118516
2010-11-09 17:25:51 +00:00
Dan Gohman
9f78edd2a7 Re-introduce the MaxLookup limit to BasicAliasAnalysis'
pointsToConstantMemory code to guard against possible
compile time slowdowns.

llvm-svn: 118440
2010-11-08 20:26:19 +00:00
Dan Gohman
46cb7cd7d8 Implement getModRefBehavior for TypeBasedAliasAnalysis.
llvm-svn: 118416
2010-11-08 17:10:22 +00:00
Dan Gohman
6909ecf66e Extend the AliasAnalysis::pointsToConstantMemory interface to allow it
to optionally look for constant or local (alloca) memory.

Teach BasicAliasAnalysis::pointsToConstantMemory to look through Select
and Phi nodes, and to support looking for local memory.

Remove FunctionAttrs' PointsToLocalOrConstantMemory function, now that
AliasAnalysis knows all the tricks that it knew.

llvm-svn: 118412
2010-11-08 16:45:26 +00:00
Dan Gohman
ee58dba24c Delete getIntrinsicModRefBehavior. Clients can just use the normal
getModRefBehavior now, since it now understands intrinsics as well
as normal functions.

llvm-svn: 118411
2010-11-08 16:11:19 +00:00
Dan Gohman
a8838ec654 Teach BasicAliasAnalysis::getModRefBehavior(const Function *F)
to analyze intrinsic functions.

llvm-svn: 118409
2010-11-08 16:08:43 +00:00
Duncan Sands
0a5bcce250 Add simplification of floating point comparisons with the result
of a select instruction, the same as already exists for integer
comparisons.

llvm-svn: 118379
2010-11-07 16:46:25 +00:00
Duncan Sands
c9c7d54930 Fix a README item: when doing a comparison with the result
of a select instruction, see if doing the compare with the
true and false values of the select gives the same result.
If so, that can be used as the value of the comparison.

llvm-svn: 118378
2010-11-07 16:12:23 +00:00
Benjamin Kramer
ed73c2619e Use arrays instead of constant-sized SmallVectors.
llvm-svn: 118257
2010-11-04 18:45:27 +00:00
Devang Patel
6c1b802673 Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
	DBuilder.CreatePointerType(Ty, Size);
instead of
	DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
                                       TheCU, "", getOrCreateMainFile(),
                                       0, Size, 0, 0, 0, OCTy);

llvm-svn: 118248
2010-11-04 15:01:38 +00:00
Devang Patel
9af731f560 Fix DIType verifier. The element 3 is DIFile now.
llvm-svn: 118054
2010-11-02 20:41:13 +00:00