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

377 Commits

Author SHA1 Message Date
Daniel Dunbar
43ad3dfe00 Revert "Reverse the order for collecting the parts of an addrec. The order", it
is breaking llvm-gcc bootstrap.

llvm-svn: 95988
2010-02-12 17:27:08 +00:00
Dan Gohman
2f46f79492 Reverse the order for collecting the parts of an addrec. The order
doesn't matter, except that ScalarEvolution tends to need less time
to fold the results this way.

llvm-svn: 95979
2010-02-12 11:08:26 +00:00
Dan Gohman
c40eb525ad Reapply the new LoopStrengthReduction code, with compile time and
bug fixes, and with improved heuristics for analyzing foreign-loop
addrecs.

This change also flattens IVUsers, eliminating the stride-oriented
groupings, which makes it easier to work with.

llvm-svn: 95975
2010-02-12 10:34:29 +00:00
Bill Wendling
f6736d2bae Generic reformatting and comment fixing. No functionality change.
llvm-svn: 94771
2010-01-29 00:52:43 +00:00
Bill Wendling
d115615285 Add newline to debugging output, and fix some grammar-os in comment.
llvm-svn: 94765
2010-01-29 00:27:39 +00:00
Dan Gohman
525f7d7833 Revert LoopStrengthReduce.cpp to pre-r94061 for now.
llvm-svn: 94123
2010-01-22 00:46:49 +00:00
Dan Gohman
23ac1f6157 When inserting expressions for post-increment users which contain
loop-variant components, adds must be inserted after the increment.
Keep track of the increment position for this case, and insert
these adds in the correct location.

llvm-svn: 94110
2010-01-21 23:01:22 +00:00
Dan Gohman
2c93a3fa96 Include IVUsers information in LSR's debug output.
llvm-svn: 94108
2010-01-21 22:46:32 +00:00
Dan Gohman
3cce294b13 Prune the search for candidate formulae if the number of register
operands exceeds the number of registers used in the initial
solution, as that wouldn't lead to a profitable solution anyway.

llvm-svn: 94107
2010-01-21 22:42:49 +00:00
Dan Gohman
a4954135a7 Add a comment.
llvm-svn: 94104
2010-01-21 21:31:09 +00:00
Dan Gohman
be34c35f32 Re-implement the main strength-reduction portion of LoopStrengthReduction.
This new version is much more aggressive about doing "full" reduction in
cases where it reduces register pressure, and also more aggressive about
rewriting induction variables to count down (or up) to zero when doing so
reduces register pressure.

It currently uses fairly simplistic algorithms for finding reuse
opportunities, but it introduces a new framework allows it to combine
multiple strategies at once to form hybrid solutions, instead of doing
all full-reduction or all base+index.

llvm-svn: 94061
2010-01-21 02:09:26 +00:00
Dan Gohman
fff95c0489 Set Changed properly after calling DeleteDeadPHIs.
llvm-svn: 92735
2010-01-05 16:31:45 +00:00
David Greene
1b160211dd Remove dump routine and the associated Debug.h from a header. Patch up
other files to compensate.

llvm-svn: 92075
2009-12-23 22:58:38 +00:00
Dan Gohman
0f8f7f179d Add Loop contains utility methods for testing whether a loop
contains another loop, or an instruction. The loop form is
substantially more efficient on large loops than the typical
code it replaces.

llvm-svn: 91654
2009-12-18 01:24:09 +00:00
Dan Gohman
66a17c5ce2 Minor code simplification.
llvm-svn: 91653
2009-12-18 01:20:44 +00:00
Dan Gohman
3ea233d1f2 Don't pass const pointers by reference.
llvm-svn: 91647
2009-12-18 00:38:08 +00:00
Dan Gohman
c483bed5e8 Reapply LoopStrengthReduce and IVUsers cleanups, excluding the part
of 91296 that caused trouble -- the Processed list needs to be
preserved for the livetime of the pass, as AddUsersIfInteresting
is called from other passes.

llvm-svn: 91641
2009-12-18 00:06:20 +00:00
Evan Cheng
18e334195d Revert 91280-91283, 91286-91289, 91291, 91293, 91295-91296. It apparently introduced a non-deterministic behavior in the optimizer somewhere.
llvm-svn: 91598
2009-12-17 09:39:49 +00:00
Dan Gohman
a1003e40f7 Delete an unused function.
llvm-svn: 91432
2009-12-15 16:30:09 +00:00
Dan Gohman
abb2ea84d9 Fix a thinko; isNotAlreadyContainedIn had a built-in negative, so the
condition was inverted when the code was converted to contains().

llvm-svn: 91295
2009-12-14 17:31:01 +00:00
Dan Gohman
ea5d4d2354 Remove unnecessary #includes.
llvm-svn: 91293
2009-12-14 17:19:06 +00:00
Dan Gohman
5066c25e62 Instead of having a ScalarEvolution pointer member in BasedUser, just pass
the ScalarEvolution pointer into the functions which need it.

llvm-svn: 91289
2009-12-14 17:12:51 +00:00
Dan Gohman
b001599b67 Don't bother cleaning up if there's nothing to clean up.
llvm-svn: 91288
2009-12-14 17:10:44 +00:00
Dan Gohman
178e26adbf Delete an unused variable.
llvm-svn: 91287
2009-12-14 17:08:09 +00:00
Dan Gohman
44a2a502f2 LSR itself doesn't need LoopInfo.
llvm-svn: 91283
2009-12-14 17:02:34 +00:00
Dan Gohman
449298eb08 LSR itself doesn't need DominatorTree.
llvm-svn: 91282
2009-12-14 16:57:08 +00:00
Dan Gohman
bf3406f85f Remove the code in LSR that manually hoists expansions out of loops;
SCEVExpander does this automatically.

llvm-svn: 91281
2009-12-14 16:52:55 +00:00
Dan Gohman
0a0423c492 Minor code cleanups.
llvm-svn: 91280
2009-12-14 16:37:29 +00:00
Jim Grosbach
2853c74dc9 grammar
llvm-svn: 89145
2009-11-17 21:37:04 +00:00
Jim Grosbach
1aa8f6c5c7 80-column violations
llvm-svn: 89123
2009-11-17 19:05:35 +00:00
Evan Cheng
aaa58b7653 Generalize OptimizeLoopTermCond to optimize more loop terminating icmp to use postinc iv.
llvm-svn: 89116
2009-11-17 18:10:11 +00:00
Jim Grosbach
5851dbf184 Remove trailing whitespace
llvm-svn: 89110
2009-11-17 17:53: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
Evan Cheng
ea76ec6720 Block terminator may be a switch.
llvm-svn: 86761
2009-11-11 00:00:21 +00:00
Evan Cheng
f5e85bec73 Generalize lsr code that optimize loop to count down towards zero.
llvm-svn: 86715
2009-11-10 21:14:05 +00:00
Dan Gohman
54aa68b309 Teach LSR to avoid calling SplitCriticalEdge on edges with indirectbr.
llvm-svn: 86193
2009-11-05 23:34:59 +00:00
Dan Gohman
3c155aa3cd Update various Loop optimization passes to cope with the possibility that
LoopSimplify form may not be available.

llvm-svn: 86175
2009-11-05 21:11:53 +00:00
Dan Gohman
3d0c010ee4 Make LSR's OptimizeShadowIV ignore induction variables with negative
strides for now, because it doesn't handle them correctly. This fixes a
miscompile of SingleSource/Benchmarks/Misc-C++/ray.

This problem was usually hidden because indvars transforms such induction
variables into negations of canonical induction variables.

llvm-svn: 85118
2009-10-26 15:32:57 +00:00
Nick Lewycky
cacdc4d65a Remove ICmpInst::isSignedPredicate which was a reimplementation
CmpInst::isSigned.

llvm-svn: 85037
2009-10-25 05:20:17 +00:00
Nick Lewycky
d21c325f09 Instruction::clone does not need to take an LLVMContext&. Remove that and
update all the callers.

llvm-svn: 82889
2009-09-27 07:38:41 +00:00
Dan Gohman
cdaa08e706 Re-apply r80926, with fixes: keep the domtree informed of new blocks
that get created during loop unswitching, and fix SplitBlockPredecessors'
LCSSA updating code to create new PHIs instead of trying to just move
existing ones.

Also, optimize Loop::verifyLoop, since it gets called a lot. Use
searches on a sorted list of blocks instead of calling the "contains"
function, as is done in other places in the Loop class, since "contains"
does a linear search. Also, don't call verifyLoop from LoopSimplify or
LCSSA, as the PassManager is already calling verifyLoop as part of
LoopInfo's verifyAnalysis.

llvm-svn: 81221
2009-09-08 15:45:00 +00:00
Evan Cheng
a191202da5 Revert r80926. It causes loop unswitch assertion and slow down some JIT tests significantly.
llvm-svn: 81101
2009-09-06 02:26:10 +00:00
Dan Gohman
7296225414 Add a verifyAnalysis to LoopInfo, LoopSimplify, and LCSSA form that verify
that these passes are properly preserved.

Fix several transformation passes that claimed to preserve LoopSimplify
form but weren't.

llvm-svn: 80926
2009-09-03 16:31:42 +00:00
Chris Lattner
5f54c5bd1c eliminate VISIBILITY_HIDDEN from Transforms/Scalar. PR4861
llvm-svn: 80766
2009-09-02 06:11:42 +00:00
Chris Lattner
01dae858b6 eliminate the "Value" printing methods that print to a std::ostream.
This required converting a bunch of stuff off DOUT and other cleanups.

llvm-svn: 79819
2009-08-23 04:37:46 +00:00
Owen Anderson
9df206d02d Push LLVMContexts through the IntegerType APIs.
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Owen Anderson
b4bce99769 Rename MVT to EVT, in preparation for splitting SimpleValueType out into its own struct type.
llvm-svn: 78610
2009-08-10 22:56:29 +00:00
Dan Gohman
bee2eedb5f Check for !isa<Constant> instead of isa<Instruction>. This
matches what the comment says, and it avoids spurious BitCast
instructions for Argument values.

llvm-svn: 78121
2009-08-04 23:23:56 +00:00
Owen Anderson
1dc40e205b Move a few more APIs back to 2.5 forms. The only remaining ones left to change back are
metadata related, which I'm waiting on to avoid conflicting with Devang.

llvm-svn: 77721
2009-07-31 20:28:14 +00:00
Douglas Gregor
8c9b60cabc Eliminate a few unused-variable warnings
llvm-svn: 77519
2009-07-29 22:41:10 +00:00