Commit Graph

6922 Commits

Author SHA1 Message Date
Gabor Greif
a292b2f49f recommit simplification (r109502, backed out r109509); seems to innocent
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109510 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 16:44:23 +00:00
Gabor Greif
5b0c25313e back out this too to restore the bots
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109509 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 15:56:07 +00:00
Gabor Greif
86099345db simplify: CallSite::get --> CallSite constructor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109506 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 15:02:37 +00:00
Gabor Greif
50da18171e simplify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109502 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 13:31:22 +00:00
Owen Anderson
cfa7fb6df5 Add an initial implementation of LazyValueInfo updating for JumpThreading. Disabled for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109424 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 18:48:03 +00:00
Dan Gohman
052f000158 Remove LCSSA's bogus dependence on LoopSimplify and LoopSimplify's bogus
dependence on DominanceFrontier. Instead, add an explicit DominanceFrontier
pass in StandardPasses.h to ensure that it gets scheduled at the right
time.

Declare that loop unrolling preserves ScalarEvolution, and shuffle some
getAnalysisUsages.

This eliminates one LoopSimplify and one LCCSA run in the standard
compile opts sequence.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109413 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 18:11:16 +00:00
Dan Gohman
572365ec88 Preserve ScalarEvolution in the loop unroller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109412 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 18:02:06 +00:00
Dan Gohman
b7aa26bbdb Use DominatorTree::properlyDominates instead of dominates with an
explicit inequality check.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109401 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 17:37:36 +00:00
Dan Gohman
cb6816dc81 A block dominates itself, by definition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109400 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 17:35:32 +00:00
Nick Lewycky
de4e94a18c Revert this because we can't clone cyclic MDNodes which are creating during a
build of llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109355 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-24 20:54:02 +00:00
Nick Lewycky
fee12b2985 Whether function-local or not, a MDNode may reference a Function in which case
it needs to be mapped to refer to the function in the new module, not the old
one. Fixes PR7700.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109353 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-24 19:43:25 +00:00
Devang Patel
169c932759 Speculatively revert 109117
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109132 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 18:44:00 +00:00
Gabor Greif
481c4c0734 keep in 80 cols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109122 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 17:18:03 +00:00
Devang Patel
bd68d42843 Map MDNode correctly.
A non function local MDNode can have an operand which is cloned by MapValue(). 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109117 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 16:35:00 +00:00
Gabor Greif
96f1d8ebdd mass elimination of reliance on automatic iterator dereferencing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109103 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 13:36:47 +00:00
Gabor Greif
945f1ab0a5 simplify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109101 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 13:07:39 +00:00
Gabor Greif
efdf039aec do not access arguments via low-level interface, do not multiply dereference use_iterators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109100 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 13:04:32 +00:00
Gabor Greif
85e01df73d pass dereferenced iterator to dyn_cast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109099 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 11:48:35 +00:00
Gabor Greif
20361b9d4d pass dereferenced iterator to dyn_cast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109098 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 11:43:44 +00:00
Gabor Greif
a399781289 undo 80 column trespassing I caused
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109092 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 10:37:47 +00:00
Dan Gohman
17aa92c92a Make NamedMDNode not be a subclass of Value, and simplify the interface
for creating and populating NamedMDNodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109061 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 23:38:33 +00:00
Owen Anderson
d13db2c59c Fix batch of converting RegisterPass<> to INTIALIZE_PASS().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109045 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 22:09:45 +00:00
Dan Gohman
549979f550 Make this code a little more readable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108968 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 23:49:44 +00:00
Dan Gohman
333a94765a Use DebugLocs instead of MDNodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108967 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 23:49:05 +00:00
Dan Gohman
e336cbc450 Fix a typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108962 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 23:10:36 +00:00
Dan Gohman
7bc230ec6a Don't look up the "dbg" metadata kind by name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108961 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 23:09:34 +00:00
Dan Gohman
bda0252639 Use getDebugLoc and setDebugLoc instead of getDbgMetadata and setDbgMetadata,
avoiding MDNode overhead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108909 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 20:09:07 +00:00
Dan Gohman
43ef3fbae1 Remember that the induction variable is always a PHINode and
use getIncomingValueForBlock instead of
LoopInfo::getCanonicalInductionVariableIncrement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108865 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 17:18:52 +00:00
Owen Anderson
5f23a938b0 Tweak per Chris' comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108736 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 19:23:32 +00:00
Owen Anderson
d90290127b Reimplement r108639 in InstCombine rather than DAGCombine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108687 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 08:09:34 +00:00
Owen Anderson
7e3012c345 Another attempt at getting the clang self-host to like my instcombine patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108614 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-17 06:56:35 +00:00
Chris Lattner
49669e6d3a eliminate unlockedRefineAbstractTypeTo, types are all per-llvmcontext,
so there is no locking involved in type refinement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108553 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 20:50:13 +00:00
Dan Gohman
1e381fcd55 Reorder the contents of various getAnalysisUsage functions, eliminating
a redundant loopsimplify run from the default -O2 sequence.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108539 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 17:58:45 +00:00
Owen Anderson
835d425a16 Remove the rest of my instcombine changes. Back to the drawing board on this one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108530 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 16:39:00 +00:00
Gabor Greif
a6aac4c5bc eliminate CallInst::ArgOffset
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108522 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 09:38:02 +00:00
Nick Lewycky
394ce41b7f Arrays and vectors with different numbers of elements are not equivalent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108517 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 06:31:12 +00:00
Eric Christopher
de309a8b52 Also revert 108422, it's causing some test failures.
Working on testcases for Owen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108494 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 01:36:12 +00:00
Dan Gohman
a9db129730 Don't merge uses when they are targetting fixup sites with
different widths. In a use with a narrower fixup, formulae
may be wider than the fixup, in which case the high bits
aren't necessarily meaningful, so it isn't safe to reuse
them for uses with wider fixups.

This fixes PR7618, though the testcase is too large for a
reasonable regression test, since it heavily dependes on
hitting LSR's heuristics in a certain way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108455 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 20:24:58 +00:00
Dan Gohman
ef4308d6ba Use dbgs() instead of errs() in a DEBUG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108453 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 20:12:42 +00:00
Owen Anderson
11acba0470 Speculatively revert r108429 to fix the clang self-host.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108436 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 18:18:57 +00:00
Owen Anderson
40bf5e7a68 Per Chris' suggestion, get rid of the select canonicalization and just add
the corresponding or-icmp-and pattern.  This has the added benefit of doing
the matching earlier, and thus being less susceptible to being confused by
earlier transforms.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108429 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 17:24:23 +00:00
Owen Anderson
2722dfa75d Remove unneeded check, and correct style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108427 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 16:38:22 +00:00
Dan Gohman
c88c1a4581 Watch out for a constant offset cancelling out a base register, forming
a zero. This situation arrises in Fortran code with induction variables
that start at 1 instead of 0. This fixes PR7651.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108424 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 15:14:45 +00:00
Owen Anderson
96fe621e07 Reapply r108378, with bugfixes, testcase, and improved comment formatting.
This now passes LIT, nighty test, and llvm-gcc bootstrap on my machine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108422 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 15:00:23 +00:00
Nick Lewycky
706f50820c This is a full sentence.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108418 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 06:51:22 +00:00
Nick Lewycky
664040a03c Disable aliases on all platforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108417 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 06:48:56 +00:00
Chris Lattner
35a939b97d make various clients of ReplaceAndSimplifyAllUses tolerate
it *changing* the things it replaces, not just causing them
to drop to null.  There is no functionality change yet, but 
this is required for a subsequent patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108414 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 06:06:04 +00:00
Eli Friedman
5e84e8e52a Speculatively revert r108378; may be causing bootstrap failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108389 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 00:33:00 +00:00
Owen Anderson
bd129a7460 Add instcombine transforms to optimize tests of multiple bits of the same value into a single larger comparison.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108378 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 23:33:51 +00:00
Owen Anderson
e84178a0bd Extend SimplifyCFG's common-destination folding heuristic to allow a single
"bonus" instruction to be speculatively executed.  Add a heuristic to
ensure we're not tripping up out-of-order execution by checking that this bonus
instruction only uses values that were already guaranteed to be available.

This allows us to eliminate the short circuit in (x&1)&&(x&2).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108351 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 19:52:16 +00:00