[PATCH] D18316: [PATCH] Force RerollLoop pass to reset the loop trip count value for rerolled loops
Zinovy Nis via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 22 06:56:01 PDT 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL264051: [PATCH] Force LoopReroll to reset the loop trip count value after reroll. (authored by zinovy.nis).
Changed prior to commit:
http://reviews.llvm.org/D18316?vs=51163&id=51280#toc
Repository:
rL LLVM
http://reviews.llvm.org/D18316
Files:
llvm/trunk/lib/Transforms/Scalar/LoopRerollPass.cpp
llvm/trunk/test/Transforms/LoopReroll/basic32iters.ll
Index: llvm/trunk/test/Transforms/LoopReroll/basic32iters.ll
===================================================================
--- llvm/trunk/test/Transforms/LoopReroll/basic32iters.ll
+++ llvm/trunk/test/Transforms/LoopReroll/basic32iters.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -loop-reroll -S | FileCheck %s
+; RUN: opt < %s -loop-reroll -verify-scev -S | FileCheck %s
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
Index: llvm/trunk/lib/Transforms/Scalar/LoopRerollPass.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopRerollPass.cpp
+++ llvm/trunk/lib/Transforms/Scalar/LoopRerollPass.cpp
@@ -1551,14 +1551,12 @@
"] Loop %" << Header->getName() << " (" <<
L->getNumBlocks() << " block(s))\n");
- bool Changed = false;
-
// For now, we'll handle only single BB loops.
if (L->getNumBlocks() > 1)
- return Changed;
+ return false;
if (!SE->hasLoopInvariantBackedgeTakenCount(L))
- return Changed;
+ return false;
const SCEV *LIBETC = SE->getBackedgeTakenCount(L);
const SCEV *IterCount = SE->getAddExpr(LIBETC, SE->getOne(LIBETC->getType()));
@@ -1572,11 +1570,12 @@
if (PossibleIVs.empty()) {
DEBUG(dbgs() << "LRR: No possible IVs found\n");
- return Changed;
+ return false;
}
ReductionTracker Reductions;
collectPossibleReductions(L, Reductions);
+ bool Changed = false;
// For each possible IV, collect the associated possible set of 'root' nodes
// (i+1, i+2, etc.).
@@ -1587,5 +1586,9 @@
break;
}
+ // Trip count of L has changed so SE must be re-evaluated.
+ if (Changed)
+ SE->forgetLoop(L);
+
return Changed;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18316.51280.patch
Type: text/x-patch
Size: 1863 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160322/392c88ea/attachment.bin>
More information about the llvm-commits
mailing list