// backedge blocks to jump to the BEBlock instead of the header.
// If one of the backedges has llvm.loop metadata attached, we remove
// it from the backedge and add it to BEBlock.
- unsigned LoopMDKind = BEBlock->getContext().getMDKindID("llvm.loop");
MDNode *LoopMD = nullptr;
for (BasicBlock *BB : BackedgeBlocks) {
Instruction *TI = BB->getTerminator();
if (!LoopMD)
- LoopMD = TI->getMetadata(LoopMDKind);
- TI->setMetadata(LoopMDKind, nullptr);
+ LoopMD = TI->getMetadata(LLVMContext::MD_loop);
+ TI->setMetadata(LLVMContext::MD_loop, nullptr);
TI->replaceSuccessorWith(Header, BEBlock);
}
- BEBlock->getTerminator()->setMetadata(LoopMDKind, LoopMD);
+ BEBlock->getTerminator()->setMetadata(LLVMContext::MD_loop, LoopMD);
//===--- Update all analyses which we must preserve now -----------------===//