Commit Graph

3463 Commits

Author SHA1 Message Date
Dan Gohman
c1ac0d7623 Teach memdep about TBAA tags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114588 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 21:41:02 +00:00
Benjamin Kramer
a53557e4fb Simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114444 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 16:41:29 +00:00
Benjamin Kramer
28b4afc103 Make CreateComplexVariable independent of SmallVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114439 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 16:00:03 +00:00
Jakob Stoklund Olesen
38cb1cdfb7 Don't include <fenv.h> now that we have llvm/System/FEnv.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114219 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 21:47:03 +00:00
Dan Gohman
3f2f21e640 Attempt to support platforms which don't have fenv.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114196 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 20:06:27 +00:00
Dan Gohman
8ee731f2ce Fix the folding of floating-point math library calls, like sin(infinity),
so that it detects errors on platforms where libm doesn't set errno.
It's still subject to host libm details though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114148 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 01:38:06 +00:00
Dan Gohman
8945db73d1 Add an #include of raw_ostream.h. Previously, this only compiled
because it was using Twine.h's declaration of operator<<(const Twine &).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114141 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 00:33:43 +00:00
Benjamin Kramer
fc24c1a7ba Update CMake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114128 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 23:06:18 +00:00
Dan Gohman
a627e9bfcd Rename a variable to avoid a declaration conflict.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114126 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 22:50:09 +00:00
Dan Gohman
ead0109f5b Add a pass which prints out all the memdep dependencies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114121 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 22:08:32 +00:00
Owen Anderson
4e282decf3 Revert r114097, adding back in the assertion against replacing an Instruction by itself. Now that CorrelatedValuePropagation is
more careful not to call SimplifyInstructionsInBlock() on an unreachable block, the issue has been fixed at a higher level.  Add
a big warning to SimplifyInstructionsInBlock() to hopefully prevent this in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114117 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 20:51:41 +00:00
Owen Anderson
c2ce21ad51 It is possible, under specific circumstances involving ptrtoint ConstantExpr's, for LVI to end up trying to merge
a Constant into a ConstantRange.  Handle this conservatively for now, rather than asserting.  The testcase is
more complex that I would like, but the manifestation of the problem is sensitive to iteration orders and the state of the
LVI cache, and I have not been able to reproduce it with manually constructed or simplified cases.

Fixes PR8162.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114103 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 18:28:33 +00:00
Owen Anderson
4b91c3ac96 Fix PR8161, in which an unreachable loop causes recursive instruction simplification to try
to replace an instruction with itself.  Add a predicate to the simplifier to prevent this case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114097 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 17:42:36 +00:00
Eli Friedman
39e30124e5 PR7959: Handle negative scales in GEPs correctly in BasicAA for non-64-bit
targets.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114015 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 20:08:03 +00:00
Dan Gohman
e6291ae96e Convert TBAA to use the new TBAATag field of AliasAnalysis::Location.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113892 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14 23:28:12 +00:00
Dan Gohman
b2143b6247 Remove the experimental AliasAnalysis::getDependency interface, which
isn't a good level of abstraction for memdep. Instead, generalize
AliasAnalysis::alias and related interfaces with a new Location
class for describing a memory location. For now, this is the same
Pointer and Size as before, plus an additional field for a TBAA tag.

Also, introduce a fixed MD_tbaa metadata tag kind.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113858 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14 21:25:10 +00:00
Michael J. Spencer
3a210e2d30 Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."
This reverts commit r113632

Conflicts:

	cmake/modules/AddLLVM.cmake

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113819 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 23:59:48 +00:00
Benjamin Kramer
6844c8ea5a Teach InstructionSimplify to fold (A & B) & A -> A & B and (A | B) | A -> A | B.
Reassociate does this but it doesn't catch all cases (e.g. if the operands are i1).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113651 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 22:39:55 +00:00
Michael J. Spencer
4e9c939312 CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113632 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 21:14:25 +00:00
Owen Anderson
f9a26b89f8 What the loop unroller cares about, rather than just not unrolling loops with calls, is
not unrolling loops that contain calls that would be better off getting inlined.  This mostly
comes up when an interleaved devirtualization pass has devirtualized a call which the inliner
will inline on a future pass.  Thus, rather than blocking all loops containing calls, add
a metric for "inline candidate calls" and block loops containing those instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113535 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 20:32:23 +00:00
Dan Gohman
c8ddbdabb6 Extend the getDependence query with support for PHI translation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113521 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 18:37:31 +00:00
Owen Anderson
082bf2a977 Refactor code-size reduction estimation methods out of InlineCostAnalyzer and into CodeMetrics. They
don't use any InlineCostAnalyzer state, and are useful for other clients who don't necessarily want to use
all of InlineCostAnalyzer's logic, some of which is fairly inlining-specific.

No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113499 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 16:56:42 +00:00
Dan Gohman
65924111bf Add a new experimental generalized dependence query interface to
AliasAnalysis, and some code for implementing the new query on top of
existing implementations by making standard alias and getModRefInfo
queries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113329 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 01:32:20 +00:00
Owen Anderson
6bcd3a0265 Clean up some of the PassRegistry implementation, and pImpl-ize it to reduce #include clutter
and exposing internal details.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113252 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 19:16:25 +00:00
Nick Lewycky
198381e542 Add completely hokey binary-and and binary-or operations to ConstantRange and
teach LazyValueInfo to use them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113196 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 05:39:02 +00:00
Chris Lattner
09981982f1 cleanup some of the lifetime/invariant marker stuff, add a big fixme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113144 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 03:58:04 +00:00
Chris Lattner
c5a5cf26fd speed up -gvn 3.4% on the testcase in PR7023
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113135 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 01:26:29 +00:00
Chris Lattner
adc799112d pull a simple method out of LICM into a new
Loop::hasLoopInvariantOperands method. Remove
a useless and confusing Loop::isLoopInvariant(Instruction)
method, which didn't do what you thought it did.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113133 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 01:05:37 +00:00
Chris Lattner
e971131695 fix PR8063, a crash in globalopt in the malloc analysis code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113109 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 17:20:46 +00:00
Chris Lattner
ab2cee6d51 dead method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113077 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 18:19:16 +00:00
Chris Lattner
17aa68055b zap dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113073 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 18:12:00 +00:00
Dan Gohman
46ffb231c6 Disable the asserts that check that normalization is perfectly
invertible. ScalarEvolution's folding routines don't always succeed
in canonicalizing equal expressions to a single canonical form, and
this can cause these asserts to fail, even though there's no actual
correctness problem. This fixes PR8066.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113021 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 22:12:56 +00:00
Owen Anderson
1593dd6779 Add support for simplifying a load from a computed value to a load from a global when it
is provable that they're equivalent.  This fixes PR4855.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112994 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 19:08:37 +00:00
Chris Lattner
831c8ec016 stop forcing a noop AssemblyAnnotationWriter to silence #uses
comments, these don't happen anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112901 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 23:03:10 +00:00
Owen Anderson
4caef6001d Remove incorrect and poorly tested code for trying to reason about values on default edges of
switches.  Just return the conservatively correct answer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112876 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 22:16:52 +00:00
Owen Anderson
66048c2169 Fix a bug in LazyValueInfo that CorrelatedValuePropagation exposed: In the LVI lattice, undef and the full set ConstantRange should not
be treated as equivalent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112843 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 18:23:58 +00:00
Dan Gohman
191bd64a39 Revert 112442 and 112440 until the compile time problems introduced
by 112440 are resolved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112692 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 01:45:53 +00:00
Dan Gohman
3f19c091bf Reapply r112432, now that the real problem is addressed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112667 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 22:53:17 +00:00
Dan Gohman
6a0c125ed5 Reapply r112433, now that the real problem is addressed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112666 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 22:52:12 +00:00
Dan Gohman
90b5f25e8d Revert r110916. This patch is buggy because the code inside the
inner loop doesn't update all the variables in the outer loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112665 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 22:50:31 +00:00
Dan Gohman
26125c65b9 Revert r112432. It appears to be exposing a problem in the emacs build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112638 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 20:58:44 +00:00
Dan Gohman
f3bba4c1ae Speculatively revert r112433.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112608 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 17:56:47 +00:00
Owen Anderson
392953262e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112489 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 17:03:45 +00:00
Benjamin Kramer
033927408e Don't print two "0x" prefixes. Use a raw_ostream overload instead of llvm::format.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112479 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 14:46:53 +00:00
Chris Lattner
cb7f653422 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 :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112452 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-29 18:42:23 +00:00
Dan Gohman
eaa40ff74e Make IVUsers iterative instead of recursive.
This has the side effect of reversing the order of most of
IVUser's results.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112442 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-29 16:40:03 +00:00
Dan Gohman
d578a40853 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112433 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-29 15:16:58 +00:00
Dan Gohman
b8fc62bc58 Batch up subtracts along with adds, when analyzing long chains of
operations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112432 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-29 15:10:06 +00:00
Dan Gohman
c6a8e99fb3 Micro-optimize GroupByComplexity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112431 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-29 15:07:13 +00:00
Dan Gohman
0f32ae3aa7 Hold AddRec->getLoop() in a variable, to make the Mul code more consistent
with the Add code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112430 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-29 14:55:19 +00:00