summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Transforms/Scalar/LowerExpectIntrinsic.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LowerExpectIntrinsic.cpp b/llvm/lib/Transforms/Scalar/LowerExpectIntrinsic.cpp
index 5d3bbbc6047..0cea5c5bc59 100644
--- a/llvm/lib/Transforms/Scalar/LowerExpectIntrinsic.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerExpectIntrinsic.cpp
@@ -144,6 +144,8 @@ static bool handleBranchExpect(BranchInst &BI) {
}
bool LowerExpectIntrinsic::runOnFunction(Function &F) {
+ bool Changed = false;
+
for (BasicBlock &BB : F) {
// Create "block_weights" metadata.
if (BranchInst *BI = dyn_cast<BranchInst>(BB.getTerminator())) {
@@ -165,11 +167,12 @@ bool LowerExpectIntrinsic::runOnFunction(Function &F) {
Value *Exp = CI->getArgOperand(0);
CI->replaceAllUsesWith(Exp);
CI->eraseFromParent();
+ Changed = true;
}
}
}
- return false;
+ return Changed;
}
char LowerExpectIntrinsic::ID = 0;
OpenPOWER on IntegriCloud