aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopSimplify.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2023-05-17 21:28:38 -0700
committerKazu Hirata <kazu@google.com>2023-05-17 21:28:38 -0700
commitb56fb227877e9679ae24b264bb3bfe9811cf791b (patch)
tree722ebfc1c421f521d52ae3a48d8509ca55a6127c /llvm/lib/Transforms/Utils/LoopSimplify.cpp
parentfbaa086e1b67902082630228bc33890ccd5480ad (diff)
downloadllvm-b56fb227877e9679ae24b264bb3bfe9811cf791b.zip
llvm-b56fb227877e9679ae24b264bb3bfe9811cf791b.tar.gz
llvm-b56fb227877e9679ae24b264bb3bfe9811cf791b.tar.bz2
[Utils] Use LLVMContext::MD_loop (NFC)
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopSimplify.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopSimplify.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopSimplify.cpp b/llvm/lib/Transforms/Utils/LoopSimplify.cpp
index 1b36a29b..30a2550 100644
--- a/llvm/lib/Transforms/Utils/LoopSimplify.cpp
+++ b/llvm/lib/Transforms/Utils/LoopSimplify.cpp
@@ -448,16 +448,15 @@ static BasicBlock *insertUniqueBackedgeBlock(Loop *L, BasicBlock *Preheader,
// 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 -----------------===//