[llvm] r226998 - [PM] Change LowerExpectIntrinsic to actually return true when it has
Chandler Carruth
chandlerc at gmail.com
Sat Jan 24 03:12:58 PST 2015
Author: chandlerc
Date: Sat Jan 24 05:12:57 2015
New Revision: 226998
URL: http://llvm.org/viewvc/llvm-project?rev=226998&view=rev
Log:
[PM] Change LowerExpectIntrinsic to actually return true when it has
changed the IR. This is particularly easy as we can just look for the
existence of any expect intrinsic at all to know whether we've changed
the IR.
Modified:
llvm/trunk/lib/Transforms/Scalar/LowerExpectIntrinsic.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LowerExpectIntrinsic.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LowerExpectIntrinsic.cpp?rev=226998&r1=226997&r2=226998&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LowerExpectIntrinsic.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LowerExpectIntrinsic.cpp Sat Jan 24 05:12:57 2015
@@ -144,6 +144,8 @@ static bool handleBranchExpect(BranchIns
}
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
Value *Exp = CI->getArgOperand(0);
CI->replaceAllUsesWith(Exp);
CI->eraseFromParent();
+ Changed = true;
}
}
}
- return false;
+ return Changed;
}
char LowerExpectIntrinsic::ID = 0;
More information about the llvm-commits
mailing list