summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen/PPCGCodeGeneration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'polly/lib/CodeGen/PPCGCodeGeneration.cpp')
-rw-r--r--polly/lib/CodeGen/PPCGCodeGeneration.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
index 5bf31e60e92..2366b5ec2f8 100644
--- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp
+++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
@@ -1555,20 +1555,16 @@ void GPUNodeBuilder::clearDominators(Function *F) {
}
void GPUNodeBuilder::clearScalarEvolution(Function *F) {
- for (BasicBlock &BB : *F) {
- Loop *L = LI.getLoopFor(&BB);
+ for (auto *L : LI)
if (L)
SE.forgetLoop(L);
- }
}
void GPUNodeBuilder::clearLoops(Function *F) {
- for (BasicBlock &BB : *F) {
- Loop *L = LI.getLoopFor(&BB);
- if (L)
- SE.forgetLoop(L);
- LI.removeBlock(&BB);
- }
+ clearScalarEvolution(F);
+ SmallVector<Loop *, 1> Loops(LI.begin(), LI.end());
+ for (auto *L : Loops)
+ LI.erase(L);
}
std::tuple<Value *, Value *> GPUNodeBuilder::getGridSizes(ppcg_kernel *Kernel) {
OpenPOWER on IntegriCloud