[llvm-commits] [polly] r153316 - in /polly/trunk: include/polly/LinkAllPasses.h lib/IndVarSimplify.cpp lib/RegisterPasses.cpp
Tobias Grosser
grosser at fim.uni-passau.de
Fri Mar 23 01:02:07 PDT 2012
Author: grosser
Date: Fri Mar 23 03:02:05 2012
New Revision: 153316
URL: http://llvm.org/viewvc/llvm-project?rev=153316&view=rev
Log:
IndVarSimplify: Proberly initialize the pass.
Modified:
polly/trunk/include/polly/LinkAllPasses.h
polly/trunk/lib/IndVarSimplify.cpp
polly/trunk/lib/RegisterPasses.cpp
Modified: polly/trunk/include/polly/LinkAllPasses.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/LinkAllPasses.h?rev=153316&r1=153315&r2=153316&view=diff
==============================================================================
--- polly/trunk/include/polly/LinkAllPasses.h (original)
+++ polly/trunk/include/polly/LinkAllPasses.h Fri Mar 23 03:02:05 2012
@@ -123,6 +123,7 @@
#ifdef SCOPLIB_FOUND
void initializePoccPass(llvm::PassRegistry&);
#endif
+ void initializePollyIndVarSimplifyPass(llvm::PassRegistry&);
void initializeRegionSimplifyPass(llvm::PassRegistry&);
}
Modified: polly/trunk/lib/IndVarSimplify.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/IndVarSimplify.cpp?rev=153316&r1=153315&r2=153316&view=diff
==============================================================================
--- polly/trunk/lib/IndVarSimplify.cpp (original)
+++ polly/trunk/lib/IndVarSimplify.cpp Fri Mar 23 03:02:05 2012
@@ -65,7 +65,7 @@
static const bool VerifyIndvars = false;
namespace {
- class IndVarSimplify : public LoopPass {
+ class PollyIndVarSimplify : public LoopPass {
IVUsers *IU;
LoopInfo *LI;
ScalarEvolution *SE;
@@ -77,7 +77,7 @@
public:
static char ID; // Pass identification, replacement for typeid
- IndVarSimplify() : LoopPass(ID), IU(0), LI(0), SE(0), DT(0), TD(0),
+ PollyIndVarSimplify() : LoopPass(ID), IU(0), LI(0), SE(0), DT(0), TD(0),
Changed(false) {
initializeIndVarSimplifyPass(*PassRegistry::getPassRegistry());
}
@@ -123,8 +123,8 @@
};
}
-char IndVarSimplify::ID = 0;
-INITIALIZE_PASS_BEGIN(IndVarSimplify, "polly-indvars",
+char PollyIndVarSimplify::ID = 0;
+INITIALIZE_PASS_BEGIN(PollyIndVarSimplify, "polly-indvars",
"Induction Variable Simplification (Polly version)", false,
false)
INITIALIZE_PASS_DEPENDENCY(DominatorTree)
@@ -133,19 +133,19 @@
INITIALIZE_PASS_DEPENDENCY(LoopSimplify)
INITIALIZE_PASS_DEPENDENCY(LCSSA)
INITIALIZE_PASS_DEPENDENCY(IVUsers)
-INITIALIZE_PASS_END(IndVarSimplify, "polly-indvars",
+INITIALIZE_PASS_END(PollyIndVarSimplify, "polly-indvars",
"Induction Variable Simplification (Polly version)", false,
false)
Pass *polly::createIndVarSimplifyPass() {
- return new IndVarSimplify();
+ return new PollyIndVarSimplify();
}
/// isValidRewrite - Return true if the SCEV expansion generated by the
/// rewriter can replace the original value. SCEV guarantees that it
/// produces the same value, but the way it is produced may be illegal IR.
/// Ideally, this function will only be called for verification.
-bool IndVarSimplify::isValidRewrite(Value *FromVal, Value *ToVal) {
+bool PollyIndVarSimplify::isValidRewrite(Value *FromVal, Value *ToVal) {
// If an SCEV expression subsumed multiple pointers, its expansion could
// reassociate the GEP changing the base pointer. This is illegal because the
// final address produced by a GEP chain must be inbounds relative to its
@@ -250,7 +250,7 @@
/// for(int i = 0; i < 10000; ++i)
/// bar((double)i);
///
-void IndVarSimplify::HandleFloatingPointIV(Loop *L, PHINode *PN) {
+void PollyIndVarSimplify::HandleFloatingPointIV(Loop *L, PHINode *PN) {
unsigned IncomingEdge = L->contains(PN->getIncomingBlock(0));
unsigned BackEdge = IncomingEdge^1;
@@ -455,7 +455,7 @@
Changed = true;
}
-void IndVarSimplify::RewriteNonIntegerIVs(Loop *L) {
+void PollyIndVarSimplify::RewriteNonIntegerIVs(Loop *L) {
// First step. Check to see if there are any floating-point recurrences.
// If there are, change them into integer recurrences, permitting analysis by
// the SCEV routines.
@@ -493,7 +493,8 @@
/// happen later, except that it's more powerful in some cases, because it's
/// able to brute-force evaluate arbitrary instructions as long as they have
/// constant operands at the beginning of the loop.
-void IndVarSimplify::RewriteLoopExitValues(Loop *L, SCEVExpander &Rewriter) {
+void PollyIndVarSimplify::RewriteLoopExitValues(Loop *L,
+ SCEVExpander &Rewriter) {
// Verify the input to the pass in already in LCSSA form.
assert(L->isLCSSAForm(*DT));
@@ -642,7 +643,8 @@
return false;
}
-void IndVarSimplify::RewriteIVExpressions(Loop *L, SCEVExpander &Rewriter) {
+void PollyIndVarSimplify::RewriteIVExpressions(Loop *L,
+ SCEVExpander &Rewriter) {
// Rewrite all induction variable expressions in terms of the canonical
// induction variable.
//
@@ -1186,9 +1188,9 @@
///
/// Sign/Zero extend elimination is interleaved with IV simplification.
///
-void IndVarSimplify::SimplifyAndExtend(Loop *L,
- SCEVExpander &Rewriter,
- LPPassManager &LPM) {
+void PollyIndVarSimplify::SimplifyAndExtend(Loop *L,
+ SCEVExpander &Rewriter,
+ LPPassManager &LPM) {
SmallVector<WideIVInfo, 8> WideIVs;
SmallVector<PHINode*, 8> LoopPhis;
@@ -1608,7 +1610,7 @@
/// variable. This pass is able to rewrite the exit tests of any loop where the
/// SCEV analysis can determine a loop-invariant trip count of the loop, which
/// is actually a much broader range than just linear tests.
-Value *IndVarSimplify::
+Value *PollyIndVarSimplify::
LinearFunctionTestReplace(Loop *L,
const SCEV *BackedgeTakenCount,
PHINode *IndVar,
@@ -1704,7 +1706,7 @@
/// If there's a single exit block, sink any loop-invariant values that
/// were defined in the preheader but not used inside the loop into the
/// exit block to reduce register pressure in the loop.
-void IndVarSimplify::SinkUnusedInvariants(Loop *L) {
+void PollyIndVarSimplify::SinkUnusedInvariants(Loop *L) {
BasicBlock *ExitBlock = L->getExitBlock();
if (!ExitBlock) return;
@@ -1791,7 +1793,7 @@
// IndVarSimplify driver. Manage several subpasses of IV simplification.
//===----------------------------------------------------------------------===//
-bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
+bool PollyIndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
// If LoopSimplify form is not available, stay out of trouble. Some notes:
// - LSR currently only supports LoopSimplify-form loops. Indvars'
// canonicalization can be a pessimization without LSR to "clean up"
Modified: polly/trunk/lib/RegisterPasses.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/RegisterPasses.cpp?rev=153316&r1=153315&r2=153316&view=diff
==============================================================================
--- polly/trunk/lib/RegisterPasses.cpp (original)
+++ polly/trunk/lib/RegisterPasses.cpp Fri Mar 23 03:02:05 2012
@@ -109,6 +109,7 @@
#ifdef SCOPLIB_FOUND
initializePoccPass(Registry);
#endif
+ initializePollyIndVarSimplifyPass(Registry);
initializeRegionSimplifyPass(Registry);
initializeScopDetectionPass(Registry);
initializeScopInfoPass(Registry);
More information about the llvm-commits
mailing list