Chris Lattner
69e59e50f3
Change the other half of aliasGEP (which handles GEP differencing) to use DecomposeGEPExpression. This dramatically simplifies and shrinks the code by eliminating the horrible CheckGEPInstructions method, fixes a miscompilation (@test3) and makes the code more aggressive. In particular, we now handle the @test4 case, which is reduced from the SmallPtrSet constructor. Missing this caused us to emit a variable length memset instead of a fixed size one.
...
llvm-svn: 89922
2009-11-26 02:17:34 +00:00
Chris Lattner
bd90980add
Generalize DecomposeGEPExpression to exactly handle what Value::getUnderlyingObject does (when TD is around). This allows us to avoid calling DecomposeGEPExpression unless the ultimate alias check we care about passes, speedup up BasicAA a bit.
...
llvm-svn: 89920
2009-11-26 02:14:59 +00:00
Chris Lattner
57bca7101d
Implement a new DecomposeGEPExpression method, which decomposes a GEP into a list of scaled offsets. Use this to eliminate some previous ad-hoc code which was subtly broken (it assumed all Constant*'s were non-zero, but strange constant express could be zero).
...
llvm-svn: 89915
2009-11-26 02:13:03 +00:00
Chris Lattner
260350330e
Use GEPOperator more pervasively to simplify code.
...
llvm-svn: 89914
2009-11-26 02:11:08 +00:00
Chris Lattner
9646ffc9a2
remove some redundant braces
...
llvm-svn: 89912
2009-11-26 01:50:12 +00:00
Devang Patel
d50fc13c19
Use StringRef (again) in DebugInfo interface.
...
llvm-svn: 89866
2009-11-25 17:36:49 +00:00
Devang Patel
11c5d09a35
Emit pubtypes.
...
llvm-svn: 89725
2009-11-24 01:14:22 +00:00
Jim Grosbach
910fa44a53
enable iv-users simplification by default
...
llvm-svn: 89713
2009-11-23 23:25:54 +00:00
Devang Patel
80eee0d8a4
Add CreateLocation varinat that accepts MDNode (with a default value).
...
llvm-svn: 89689
2009-11-23 19:11:20 +00:00
Chris Lattner
23bebfe8d5
fix comment, thanks all :)
...
llvm-svn: 89666
2009-11-23 17:07:35 +00:00
Chris Lattner
1637c0e720
use the new isNoAlias method to simplify some code, only do an escaping check if
...
we have a non-constant pointer. Constant pointers can't be local.
llvm-svn: 89665
2009-11-23 16:46:41 +00:00
Chris Lattner
29221ce8d7
whitespace cleanup, tidying
...
llvm-svn: 89664
2009-11-23 16:45:27 +00:00
Chris Lattner
faf117b46b
speed up BasicAA a bit by implementing a long-standing TODO.
...
llvm-svn: 89663
2009-11-23 16:44:43 +00:00
Dan Gohman
58bb87921b
Make ConstantFoldConstantExpression recursively visit the entire
...
ConstantExpr, not just the top-level operator. This allows it to
fold many more constants.
Also, make GlobalOpt call ConstantFoldConstantExpression on
GlobalVariable initializers.
llvm-svn: 89659
2009-11-23 16:22:21 +00:00
Nick Lewycky
8cbd0c3156
Remove unused LLVMContext.
...
llvm-svn: 89642
2009-11-23 03:29:18 +00:00
Nick Lewycky
1328a7b47f
Remove dead LLVMContext argument.
...
llvm-svn: 89641
2009-11-23 03:26:09 +00:00
Chris Lattner
73422d2e9b
add fixme for dubious code. Duncan, what do you think?
...
llvm-svn: 89602
2009-11-22 16:16:48 +00:00
Chris Lattner
632f60ccc9
remove a silly condition that doesn't make a lot of sense anymore.
...
llvm-svn: 89601
2009-11-22 16:15:59 +00:00
Chris Lattner
59be5d3703
reduce indentation, no functionality change.
...
llvm-svn: 89600
2009-11-22 16:05:05 +00:00
Chris Lattner
b6ecd40652
Remove the AliasAnalysis::getMustAliases method, which is dead.
...
The hasNoModRefInfoForCalls isn't worth it as a filter because
basicaa provides m/r info and everything chains to it, so remove
it.
llvm-svn: 89599
2009-11-22 16:01:44 +00:00
Nick Lewycky
e7829c73f2
Remove dead code. While there, also turn a few 'T* ' into 'T *' to match the
...
rest of the file.
llvm-svn: 89577
2009-11-22 02:38:11 +00:00
Dan Gohman
b9c2249009
Use stripPointerCasts(). Thanks Duncan!
...
llvm-svn: 89472
2009-11-20 19:33:16 +00:00
Dan Gohman
198fbdadcf
Revert the rule that considers comparisons between two pointers in the
...
same object to be a non-capture; Duncan pointed out a way that such
a comparison could be a capture.
Make the rule that considers a comparison against null more specific,
and only consider noalias return values compared against null. This
still supports test/Transforms/GVN/nonescaping-malloc.ll, and is not
susceptible to the problem Duncan pointed out with noalias arguments.
llvm-svn: 89468
2009-11-20 17:50:21 +00:00
Dan Gohman
be82a074fa
Simplify this code; it's not necessary to check isIdentifiedObject here
...
because if the results from getUnderlyingObject match, the values must
be from the same underlying object, even if we don't know what that
object is.
llvm-svn: 89434
2009-11-20 01:34:03 +00:00
Dan Gohman
9f19d60c14
Teach getSmallConstantTripMultiple about Shl operators.
...
llvm-svn: 89426
2009-11-20 01:09:34 +00:00
Dan Gohman
2ee7f3780f
Refine the capture tracking rules for comparisons to be more
...
careful about crazy methods of capturing pointers using comparisons.
Comparisons of identified objects with null in the default address
space are not captures. And, comparisons of two pointers within the
same identified object are not captures.
llvm-svn: 89421
2009-11-20 00:50:47 +00:00
Dan Gohman
dfd39e724e
Use isVoidTy().
...
llvm-svn: 89419
2009-11-20 00:43:11 +00:00
Dan Gohman
8154e3118a
Refine this to only apply to null in the default address space.
...
llvm-svn: 89411
2009-11-19 23:53:49 +00:00
Dan Gohman
44ddc50043
Extend CaptureTracking to indicate when a value is never stored, even
...
if it is not ultimately captured. Teach BasicAliasAnalysis that a
local object address which does not escape and is never stored does
not alias with a value resulting from a load.
llvm-svn: 89398
2009-11-19 21:57:48 +00:00
Dan Gohman
141e028b96
Comparing a pointer with null is not a capture.
...
llvm-svn: 89389
2009-11-19 21:34:07 +00:00
Jim Grosbach
3a0e57424e
Teach IVUsers to keep things simpler and track loop-invariant strides only
...
for uses inside the loop. This works better with LSR. Disabled behind
-simplify-iv-users while benchmarking.
llvm-svn: 89299
2009-11-19 02:05:44 +00:00
Dan Gohman
f3ab031fde
Simplify ComputeMultiple so that it doesn't depend on TargetData.
...
llvm-svn: 89175
2009-11-18 00:58:27 +00:00
Devang Patel
34b8b72944
Remove dead code.
...
llvm-svn: 89156
2009-11-17 22:39:08 +00:00
Chris Lattner
f3d89dee33
typo spotted by duncan.
...
llvm-svn: 88884
2009-11-16 03:51:42 +00:00
Chris Lattner
34aefed024
teach LVI to infer edge information from switch instructions.
...
This allows JT to eliminate a ton of infeasible edges when
handling code like the templates in PatternMatch.h
llvm-svn: 88869
2009-11-15 20:02:12 +00:00
Chris Lattner
69a52dd583
fix a logic error that would cause LVI-JT to miscompile
...
some conditionals
llvm-svn: 88868
2009-11-15 20:01:24 +00:00
Chris Lattner
7ea8b3fbf8
implement the first stab at caching queries. This isn't correct
...
(because the invalidation logic is missing) but LVI isn't enabled
by default anyway.
llvm-svn: 88867
2009-11-15 20:00:52 +00:00
Chris Lattner
b9a9336376
refactor a bunch of code forming the new LazyValueInfoCache
...
and LVIQuery classes, no functionality change.
llvm-svn: 88866
2009-11-15 19:59:49 +00:00
Nick Lewycky
fba1efd298
Teach BasicAA that a constant expression can't alias memory provably not
...
allocated until runtime (such as an alloca). Patch by Hans Wennborg!
llvm-svn: 88760
2009-11-14 06:15:14 +00:00
Devang Patel
3e2aba2402
Revert r87059 for now. It is failing clang tests.
...
llvm-svn: 87070
2009-11-13 02:27:33 +00:00
Victor Hernandez
0be9d07279
Remove unnecessary llvm.dbg.declare bitcast
...
llvm-svn: 87059
2009-11-13 01:44:55 +00:00
Devang Patel
c024e96ca3
"Attach debug info with llvm instructions" mode was enabled a month ago. Now make it permanent and remove old way of inserting intrinsics to encode debug info for line number and scopes.
...
llvm-svn: 87014
2009-11-12 19:02:56 +00:00
Evan Cheng
b0a193db31
- Teach LSR to avoid changing cmp iv stride if it will create an immediate that
...
cannot be folded into target cmp instruction.
- Avoid a phase ordering issue where early cmp optimization would prevent the
later count-to-zero optimization.
- Add missing checks which could cause LSR to reuse stride that does not have
users.
- Fix a bug in count-to-zero optimization code which failed to find the pre-inc
iv's phi node.
- Remove, tighten, loosen some incorrect checks disable valid transformations.
- Quite a bit of code clean up.
llvm-svn: 86969
2009-11-12 07:35:05 +00:00
Chris Lattner
3e63fb7318
various fixes to the lattice transfer functions.
...
llvm-svn: 86952
2009-11-12 04:57:13 +00:00
Chris Lattner
6d1ca5d976
Add a new getPredicateOnEdge method which returns more rich information for
...
constant constraints. Improve the LVI lattice to include inequality
constraints.
llvm-svn: 86950
2009-11-12 04:36:58 +00:00
Chris Lattner
b5bb115ece
expose edge information and switch j-t to use it.
...
llvm-svn: 86920
2009-11-12 01:29:10 +00:00
Chris Lattner
46056d81aa
move some stuff into DEBUG's and turn on lazy-value-info for
...
the basic.ll testcase.
llvm-svn: 86918
2009-11-12 01:22:16 +00:00
Devang Patel
c70b8eefb7
Do not use StringRef in DebugInfo interface.
...
This allows StringRef to skip controversial if(str) check in constructor.
Buildbots, wait for corresponding clang and llvm-gcc FE check-ins!
llvm-svn: 86914
2009-11-12 00:50:58 +00:00
Chris Lattner
4c831006c7
make LazyValueInfo actually to some stuff. This isn't very tested but improves
...
strswitch.
llvm-svn: 86889
2009-11-11 22:48:44 +00:00
Chris Lattner
b45381c3f0
stub out some LazyValueInfo interfaces, and have JumpThreading
...
start using them in a trivial way when -enable-jump-threading-lvi
is passed. enable-jump-threading-lvi will be my playground for
awhile.
llvm-svn: 86789
2009-11-11 02:08:33 +00:00