[llvm-commits] [llvm] r70625 - /llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Dan Gohman
gohman at apple.com
Fri May 1 22:36:01 PDT 2009
Author: djg
Date: Sat May 2 00:36:01 2009
New Revision: 70625
URL: http://llvm.org/viewvc/llvm-project?rev=70625&view=rev
Log:
Don't split critical edges during the AddUsersIfInteresting phase
of LSR. This makes the AddUsersIfInteresting phase of LSR a pure
analysis instead of a phase that potentially does CFG modifications.
The conditions where this code would actually perform a split are
rare, and in the cases where it actually would do a split the split
is usually undone by CodeGenPrepare, and in cases where splits
actually survive into codegen, they appear to hurt more often than
they help.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=70625&r1=70624&r2=70625&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Sat May 2 00:36:01 2009
@@ -406,20 +406,7 @@
}
// Okay, all uses of IV by PN are in predecessor blocks that really are
- // dominated by the latch block. Split the critical edges and use the
- // post-incremented value.
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
- if (PN->getIncomingValue(i) == IV) {
- SplitCriticalEdge(PN->getIncomingBlock(i), PN->getParent(), P, false);
- // Splitting the critical edge can reduce the number of entries in this
- // PHI.
- e = PN->getNumIncomingValues();
- if (--NumUses == 0) break;
- }
-
- // PHI node might have become a constant value after SplitCriticalEdge.
- DeadInsts.push_back(User);
-
+ // dominated by the latch block. Use the post-incremented value.
return true;
}
More information about the llvm-commits
mailing list