[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.

llvm-svn: 226998
This commit is contained in:
Chandler Carruth 2015-01-24 11:12:57 +00:00
parent 6eb60eb5c9
commit c3bf5bd8cf
1 changed files with 4 additions and 1 deletions

View File

@ -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;