1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

93 Commits

Author SHA1 Message Date
Cameron Zwarich
c5fa112a70 Make LoopDeletion work on loops with multiple edges, as long as the incoming
values from all of the loop's exiting blocks are equal. Patch by Andrew Clinton.

llvm-svn: 126253
2011-02-22 22:25:39 +00:00
Cameron Zwarich
c93f994801 Remove code for updating dominance frontiers and some outdated references to
dominance and post-dominance frontiers.

llvm-svn: 123725
2011-01-18 04:11:31 +00:00
Devang Patel
52db9b4821 Use SmallVector instead of SmallPtrSet and avoid non-deterministic behavior.
llvm-svn: 123318
2011-01-12 19:12:45 +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
Owen Anderson
deee1e18f1 Passes do not need to recursively initialize passes that they preserve, if
they do not also require them.  This allows us to reduce inter-pass linkage
dependencies.

llvm-svn: 116854
2010-10-19 20:08:44 +00:00
Owen Anderson
46990c17f7 Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which
must be called in the pass's constructor.  This function uses static dependency declarations to recursively initialize
the pass's dependencies.

Clients that only create passes through the createFooPass() APIs will require no changes.  Clients that want to use the
CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h
before parsing commandline arguments.

I have tested this with all standard configurations of clang and llvm-gcc on Darwin.  It is possible that there are problems
with the static dependencies that will only be visible with non-standard options.  If you encounter any crash in pass
registration/creation, please send the testcase to me directly.

llvm-svn: 116820
2010-10-19 17:21:58 +00:00
Owen Anderson
63f757463c Begin adding static dependence information to passes, which will allow us to
perform initialization without static constructors AND without explicit initialization
by the client.  For the moment, passes are required to initialize both their
(potential) dependencies and any passes they preserve.  I hope to be able to relax
the latter requirement in the future.

llvm-svn: 116334
2010-10-12 19:48:12 +00:00
Owen Anderson
69cbf2e8b7 Now with fewer extraneous semicolons!
llvm-svn: 115996
2010-10-07 22:25:06 +00:00
Owen Anderson
f2fea95f2f Reapply r110396, with fixes to appease the Linux buildbot gods.
llvm-svn: 110460
2010-08-06 18:33:48 +00:00
Owen Anderson
aadd8a89ca Revert r110396 to fix buildbots.
llvm-svn: 110410
2010-08-06 00:23:35 +00:00
Owen Anderson
b9762c07cb Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
ID member as the sole unique type identifier.  Clean up APIs related to this change.

llvm-svn: 110396
2010-08-05 23:42:04 +00:00
Dan Gohman
23a6a1bdc5 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.

llvm-svn: 109413
2010-07-26 18:11:16 +00:00
Owen Anderson
f8addbb0a1 Fix batch of converting RegisterPass<> to INTIALIZE_PASS().
llvm-svn: 109045
2010-07-21 22:09:45 +00:00
Dan Gohman
74d5144414 Use pre-increment instead of post-increment when the result is not used.
llvm-svn: 106542
2010-06-22 15:08:57 +00:00
Dan Gohman
6a3eefbfeb LoopDeletion depends on loops having dedicated exits.
llvm-svn: 86180
2009-11-05 21:47:04 +00:00
Dan Gohman
0079f87732 Rename forgetLoopBackedgeTakenCount to forgetLoop, because it
clears out more information than just the stored backedge taken count.

llvm-svn: 85664
2009-10-31 15:04:55 +00:00
Dan Gohman
3f14cd3282 Simplify this code. LoopDeletion doesn't need to explicit check that
the loop exiting block dominates the latch block; if ScalarEvolution
can prove that the trip-count is finite, that's sufficient.

llvm-svn: 85165
2009-10-26 22:18:58 +00:00
Dan Gohman
ad2555c9a3 Make LoopDeletion check the maximum backedge taken count, rather than the
exact backedge taken count, when checking for infinite loops. This allows
it to delete loops with multiple exit conditions.

llvm-svn: 84952
2009-10-23 17:10:01 +00:00
Chris Lattner
5f54c5bd1c eliminate VISIBILITY_HIDDEN from Transforms/Scalar. PR4861
llvm-svn: 80766
2009-09-02 06:11:42 +00:00
Dan Gohman
81885d5b80 Make makeLoopInvariant report whether it made any changes or not,
and use this to simplify more code.

llvm-svn: 75722
2009-07-15 01:25:43 +00:00
Dan Gohman
d9b9ed628f Tell ScalarEvolution to forget a loop before starting to delete it.
This way ScalarEvolution can examine the loop to determine what state
it needs to update, if it chooses.

llvm-svn: 75029
2009-07-08 19:14:29 +00:00
Dan Gohman
dd7f97c496 Change all SCEV* to SCEV *.
llvm-svn: 74918
2009-07-07 17:06:11 +00:00
Owen Anderson
c023151c9f SCEVHandle is no more!
llvm-svn: 73906
2009-06-22 21:39:50 +00:00
Duncan Sands
880eaf5278 Allow readonly functions to unwind exceptions. Teach
the optimizers about this.  For example, a readonly
function with no uses cannot be removed unless it is
also marked nounwind.

llvm-svn: 71071
2009-05-06 06:49:50 +00:00
Dan Gohman
00c4ac3add Re-apply 70645, converting ScalarEvolution to use
CallbackVH, with fixes. allUsesReplacedWith need to
walk the def-use chains and invalidate all users of a
value that is replaced. SCEVs of users need to be
recalcualted even if the new value is equivalent. Also,
make forgetLoopPHIs walk def-use chains, since any
SCEV that depends on a PHI should be recalculated when
more information about that PHI becomes available.

llvm-svn: 70927
2009-05-04 22:30:44 +00:00
Dan Gohman
8e4b9e586b Revert r70645 for now; it's causing a variety of regressions.
llvm-svn: 70661
2009-05-03 05:46:20 +00:00
Dan Gohman
7d98736ca6 Convert ScalarEvolution to use CallbackVH for its internal map. This
makes ScalarEvolution::deleteValueFromRecords, and it's code that
subtly needed to be called before ReplaceAllUsesWith, unnecessary.

It also makes ValueDeletionListener unnecessary.

llvm-svn: 70645
2009-05-02 21:19:20 +00:00
Dan Gohman
cc3edfaa6c Tell ScalarEvolution that the loop is being deleted before actually
deleting it.  This will let ScalarEvolution be more complete about
updating its records.

llvm-svn: 70632
2009-05-02 17:29:26 +00:00
Dan Gohman
dd9c79d45b Rename ScalarEvolution's getIterationCount to getBackedgeTakenCount,
to more accurately describe what it does. Expand its doxygen comment
to describe what the backedge-taken count is and how it differs
from the actual iteration count of the loop. Adjust names and
comments in associated code accordingly.

llvm-svn: 65382
2009-02-24 18:55:53 +00:00
Dan Gohman
3a3b51162b Preserve the DominanceFrontier analysis in the LoopDeletion pass.
llvm-svn: 65359
2009-02-24 01:21:53 +00:00
Dan Gohman
f7d0d6fe22 LoopDeletion needs to inform ScalarEvolution when a loop is deleted,
so that ScalarEvolution doesn't hang onto a dangling Loop*, which
could be a problem if another Loop happens to get allocated at the
same address.

llvm-svn: 65323
2009-02-23 17:10:29 +00:00
Daniel Dunbar
5447f9679d Change create*Pass factory functions to return Pass* instead of
LoopPass*.
 - Although less precise, this means they can be used in clients
   without RTTI (who would otherwise need to include LoopPass.h, which
   eventually includes things using dynamic_cast). This was the
   simplest solution that presented itself, but I am happy to use a
   better one if available.

llvm-svn: 58010
2008-10-22 23:32:42 +00:00
Dan Gohman
e1f9be27bc Tidy up several unbeseeming casts from pointer to intptr_t.
llvm-svn: 55779
2008-09-04 17:05:41 +00:00
Dan Gohman
11d367fd0c Use use_empty() instead of getNumUses(), avoiding a use list traversal.
llvm-svn: 52651
2008-06-23 23:23:49 +00:00
Owen Anderson
ccaf62ac5e Remove debugging code.
llvm-svn: 51666
2008-05-29 08:15:48 +00:00
Owen Anderson
791223eac7 Clean ups for loop deletion based on Chris' feedback.
Also, use SCEV to determine the trip count of the loop, which is more powerful
and accurate that Loop::getTripCount.

llvm-svn: 51179
2008-05-16 04:32:45 +00:00
Dan Gohman
bab18cae46 Clean up the use of static and anonymous namespaces. This turned up
several things that were neither in an anonymous namespace nor static
but not intended to be global.

llvm-svn: 51017
2008-05-13 00:00:25 +00:00
Gordon Henriksen
846171a09e Improve pass documentation and comments.
Patch by Matthijs Kooijman!

llvm-svn: 50861
2008-05-08 17:46:35 +00:00
Owen Anderson
d82a778214 We need to update PHIs containing the exiting block, not the exit block. We really should come up with better names for these.
llvm-svn: 50770
2008-05-06 20:55:16 +00:00
Owen Anderson
aaa86b3249 This condition got inverted accidentally.
llvm-svn: 50473
2008-04-30 07:16:33 +00:00
Owen Anderson
9db9df7329 A lot of cleanups and documentation improvements, as well as a few corner case fixes. Most
of this was suggested by Chris.

llvm-svn: 50441
2008-04-29 20:59:33 +00:00
Owen Anderson
5b7928f3d2 Rename DeadLoopElimination to LoopDeletion, part 2.
llvm-svn: 50437
2008-04-29 20:06:54 +00:00
Owen Anderson
f9e11b8327 Rename DeadLoopElimination to LoopDeletion, part one.
llvm-svn: 50436
2008-04-29 19:58:07 +00:00