summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorVyacheslav Zakharin <vyacheslav.p.zakharin@intel.com>2018-09-26 01:03:21 +0000
committerVyacheslav Zakharin <vyacheslav.p.zakharin@intel.com>2018-09-26 01:03:21 +0000
commite06831a3b29df7e573d82f9ab8e487adf92abf94 (patch)
treea10de9e1f42280f54670b745cca1c83ca6247019 /llvm/lib
parent95710337b4dfc77fc9a92eb21168b8bbd62df88a (diff)
downloadbcm5719-llvm-e06831a3b29df7e573d82f9ab8e487adf92abf94.tar.gz
bcm5719-llvm-e06831a3b29df7e573d82f9ab8e487adf92abf94.zip
Remove LoopID metadata from the branch instruction
that follows the peeled iterations. Differential Revision: https://reviews.llvm.org/D52176 llvm-svn: 343054
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp b/llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp
index 78afe748e59..86ac1a71d5e 100644
--- a/llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp
@@ -618,8 +618,12 @@ bool llvm::peelLoop(Loop *L, unsigned PeelCount, LoopInfo *LI,
assert(DT->verify(DominatorTree::VerificationLevel::Fast));
}
- updateBranchWeights(InsertBot, cast<BranchInst>(VMap[LatchBR]), Iter,
+ auto *LatchBRCopy = cast<BranchInst>(VMap[LatchBR]);
+ updateBranchWeights(InsertBot, LatchBRCopy, Iter,
PeelCount, ExitWeight);
+ // Remove Loop metadata from the latch branch instruction
+ // because it is not the Loop's latch branch anymore.
+ LatchBRCopy->setMetadata(LLVMContext::MD_loop, nullptr);
InsertTop = InsertBot;
InsertBot = SplitBlock(InsertBot, InsertBot->getTerminator(), DT, LI);
OpenPOWER on IntegriCloud