From b56fb227877e9679ae24b264bb3bfe9811cf791b Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Wed, 17 May 2023 21:28:38 -0700 Subject: [PATCH] [Utils] Use LLVMContext::MD_loop (NFC) --- llvm/lib/Transforms/Utils/LoopSimplify.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/llvm/lib/Transforms/Utils/LoopSimplify.cpp b/llvm/lib/Transforms/Utils/LoopSimplify.cpp index 1b36a29..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 -----------------===// -- 2.7.4