Skip to content

Commit

Permalink
Merge pull request #31691 from JuliaLang/tb/temp_mdnode
Browse files Browse the repository at this point in the history
Don't modify existing MDNodes in SIMDloop pass.
  • Loading branch information
maleadt authored Apr 12, 2019
2 parents a84cf6f + 0afa9a3 commit 7132c63
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/llvm-simdloop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,9 @@ bool LowerSIMDLoop::markSIMDLoop(Module &M, Function *marker, bool ivdep)
MDNode *n = L->getLoopID();
if (!n) {
// Loop does not have a LoopID yet, so give it one.
n = MDNode::get(Lh->getContext(), ArrayRef<Metadata *>(NULL));
n->replaceOperandWith(0, n);
auto temp_n = MDNode::getTemporary(Lh->getContext(), ArrayRef<Metadata *>(NULL));
temp_n->replaceOperandWith(0, temp_n.get());
n = MDNode::replaceWithPermanent(std::move(temp_n));
L->setLoopID(n);
}

Expand Down

0 comments on commit 7132c63

Please sign in to comment.