Skip to content

Commit 90a959f

Browse files
committed
fix remark emission for llvm-simdloop
1 parent c0aff33 commit 90a959f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/llvm-simdloop.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,10 @@ static bool markLoopInfo(Module &M, Function *marker, function_ref<LoopInfo &(Fu
165165
Instruction *I = cast<Instruction>(U);
166166
ToDelete.push_back(I);
167167

168-
OptimizationRemarkEmitter ORE(I->getParent()->getParent());
169-
LoopInfo &LI = GetLI(*I->getParent()->getParent());
170-
Loop *L = LI.getLoopFor(I->getParent());
168+
BasicBlock *B = I->getParent();
169+
OptimizationRemarkEmitter ORE(B->getParent());
170+
LoopInfo &LI = GetLI(*B->getParent());
171+
Loop *L = LI.getLoopFor(B);
171172
if (!L) {
172173
I->removeFromParent();
173174
continue;
@@ -210,8 +211,8 @@ static bool markLoopInfo(Module &M, Function *marker, function_ref<LoopInfo &(Fu
210211

211212
LLVM_DEBUG(dbgs() << "LSL: simd: " << simd << " ivdep: " << ivdep << "\n");
212213

213-
REMARK([&]() {
214-
return OptimizationRemarkAnalysis(DEBUG_TYPE, "Loop SIMD Flags", I)
214+
REMARK([=]() {
215+
return OptimizationRemarkAnalysis(DEBUG_TYPE, "Loop SIMD Flags", I->getDebugLoc(), B)
215216
<< "Loop marked for SIMD vectorization with flags { \"simd\": " << (simd ? "true" : "false") << ", \"ivdep\": " << (ivdep ? "true" : "false") << " }";
216217
});
217218

0 commit comments

Comments
 (0)