[llvm] b56fb22 - [Utils] Use LLVMContext::MD_loop (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Wed May 17 21:28:52 PDT 2023
Author: Kazu Hirata
Date: 2023-05-17T21:28:38-07:00
New Revision: b56fb227877e9679ae24b264bb3bfe9811cf791b
URL: https://github.com/llvm/llvm-project/commit/b56fb227877e9679ae24b264bb3bfe9811cf791b
DIFF: https://github.com/llvm/llvm-project/commit/b56fb227877e9679ae24b264bb3bfe9811cf791b.diff
LOG: [Utils] Use LLVMContext::MD_loop (NFC)
Added:
Modified:
llvm/lib/Transforms/Utils/LoopSimplify.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Utils/LoopSimplify.cpp b/llvm/lib/Transforms/Utils/LoopSimplify.cpp
index 1b36a29bdf772..30a255023698c 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 -----------------===//
More information about the llvm-commits
mailing list