Skip to content

Commit

Permalink
fix remark emission for llvm-simdloop
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy committed May 10, 2023
1 parent c0aff33 commit 90a959f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/llvm-simdloop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,10 @@ static bool markLoopInfo(Module &M, Function *marker, function_ref<LoopInfo &(Fu
Instruction *I = cast<Instruction>(U);
ToDelete.push_back(I);

OptimizationRemarkEmitter ORE(I->getParent()->getParent());
LoopInfo &LI = GetLI(*I->getParent()->getParent());
Loop *L = LI.getLoopFor(I->getParent());
BasicBlock *B = I->getParent();
OptimizationRemarkEmitter ORE(B->getParent());
LoopInfo &LI = GetLI(*B->getParent());
Loop *L = LI.getLoopFor(B);
if (!L) {
I->removeFromParent();
continue;
Expand Down Expand Up @@ -210,8 +211,8 @@ static bool markLoopInfo(Module &M, Function *marker, function_ref<LoopInfo &(Fu

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

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

Expand Down

0 comments on commit 90a959f

Please sign in to comment.