Skip to content

Commit c0aff33

Browse files
committed
Delay removing loop marker from parent
1 parent 75a7cdb commit c0aff33

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/llvm-simdloop.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,10 @@ static bool markLoopInfo(Module &M, Function *marker, function_ref<LoopInfo &(Fu
168168
OptimizationRemarkEmitter ORE(I->getParent()->getParent());
169169
LoopInfo &LI = GetLI(*I->getParent()->getParent());
170170
Loop *L = LI.getLoopFor(I->getParent());
171-
I->removeFromParent();
172-
if (!L)
171+
if (!L) {
172+
I->removeFromParent();
173173
continue;
174+
}
174175

175176
LLVM_DEBUG(dbgs() << "LSL: loopinfo marker found\n");
176177
bool simd = false;
@@ -258,6 +259,8 @@ static bool markLoopInfo(Module &M, Function *marker, function_ref<LoopInfo &(Fu
258259
}
259260
}
260261

262+
I->removeFromParent();
263+
261264
Changed = true;
262265
}
263266

0 commit comments

Comments
 (0)