[Acc] Re-land r326643 to finally fix PR33208.

Other than before, don't clear out LI entirely but only those relevant
loops.

llvm-svn: 333089
This commit is contained in:
Philip Pfaffe 2018-05-23 14:52:35 +00:00
parent 6d55b90a22
commit c06a6380a0
1 changed files with 4 additions and 2 deletions

View File

@ -1563,12 +1563,14 @@ void GPUNodeBuilder::clearScalarEvolution(Function *F) {
} }
void GPUNodeBuilder::clearLoops(Function *F) { void GPUNodeBuilder::clearLoops(Function *F) {
SmallSet<Loop *, 1> WorkList;
for (BasicBlock &BB : *F) { for (BasicBlock &BB : *F) {
Loop *L = LI.getLoopFor(&BB); Loop *L = LI.getLoopFor(&BB);
if (L) if (L)
SE.forgetLoop(L); WorkList.insert(L);
LI.removeBlock(&BB);
} }
for (auto *L : WorkList)
LI.erase(L);
} }
std::tuple<Value *, Value *> GPUNodeBuilder::getGridSizes(ppcg_kernel *Kernel) { std::tuple<Value *, Value *> GPUNodeBuilder::getGridSizes(ppcg_kernel *Kernel) {