summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-03-25 00:35:38 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-03-25 00:35:38 +0000
commit1d15a9f0c976a4c13d38010da2b4f3a9f97450bf (patch)
tree19ef34fcb255d206dc743648a0cd0566f2062479 /llvm/lib/Analysis
parent0dab98d9269355d3622c0949f27e2559892f2757 (diff)
downloadbcm5719-llvm-1d15a9f0c976a4c13d38010da2b4f3a9f97450bf.tar.gz
bcm5719-llvm-1d15a9f0c976a4c13d38010da2b4f3a9f97450bf.zip
IR: Reserve an MDKind for !llvm.loop; NFC
This reserves an MDKind for !llvm.loop, which allows callers to avoid a string-based lookup. I'm not sure why it was missing. There should be no functionality change here, just a small compile-time speedup. llvm-svn: 264371
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/LoopInfo.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp
index 47a313a8f3a..e3e1a281a6c 100644
--- a/llvm/lib/Analysis/LoopInfo.cpp
+++ b/llvm/lib/Analysis/LoopInfo.cpp
@@ -47,9 +47,6 @@ static cl::opt<bool,true>
VerifyLoopInfoX("verify-loop-info", cl::location(VerifyLoopInfo),
cl::desc("Verify loop info (time consuming)"));
-// Loop identifier metadata name.
-static const char *const LoopMDName = "llvm.loop";
-
//===----------------------------------------------------------------------===//
// Loop implementation
//
@@ -222,7 +219,7 @@ bool Loop::isSafeToClone() const {
MDNode *Loop::getLoopID() const {
MDNode *LoopID = nullptr;
if (isLoopSimplifyForm()) {
- LoopID = getLoopLatch()->getTerminator()->getMetadata(LoopMDName);
+ LoopID = getLoopLatch()->getTerminator()->getMetadata(LLVMContext::MD_loop);
} else {
// Go through each predecessor of the loop header and check the
// terminator for the metadata.
@@ -234,7 +231,7 @@ MDNode *Loop::getLoopID() const {
// Check if this terminator branches to the loop header.
for (BasicBlock *Successor : TI->successors()) {
if (Successor == H) {
- MD = TI->getMetadata(LoopMDName);
+ MD = TI->getMetadata(LLVMContext::MD_loop);
break;
}
}
@@ -259,7 +256,7 @@ void Loop::setLoopID(MDNode *LoopID) const {
assert(LoopID->getOperand(0) == LoopID && "Loop ID should refer to itself");
if (isLoopSimplifyForm()) {
- getLoopLatch()->getTerminator()->setMetadata(LoopMDName, LoopID);
+ getLoopLatch()->getTerminator()->setMetadata(LLVMContext::MD_loop, LoopID);
return;
}
@@ -268,7 +265,7 @@ void Loop::setLoopID(MDNode *LoopID) const {
TerminatorInst *TI = BB->getTerminator();
for (BasicBlock *Successor : TI->successors()) {
if (Successor == H)
- TI->setMetadata(LoopMDName, LoopID);
+ TI->setMetadata(LLVMContext::MD_loop, LoopID);
}
}
}
OpenPOWER on IntegriCloud