Skip to content

Commit

Permalink
Don't modify existing MDNodes in SIMDloop pass.
Browse files Browse the repository at this point in the history
(cherry picked from commit 0afa9a3)
  • Loading branch information
maleadt authored and KristofferC committed Apr 17, 2019
1 parent 2c62d02 commit e8d697d
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 @@ -207,8 +207,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 e8d697d

Please sign in to comment.