aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/LowerExpectIntrinsic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Utils/LowerExpectIntrinsic.cpp')
-rw-r--r--lib/Transforms/Utils/LowerExpectIntrinsic.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Transforms/Utils/LowerExpectIntrinsic.cpp b/lib/Transforms/Utils/LowerExpectIntrinsic.cpp
index fd94c84413..563f7f4490 100644
--- a/lib/Transforms/Utils/LowerExpectIntrinsic.cpp
+++ b/lib/Transforms/Utils/LowerExpectIntrinsic.cpp
@@ -145,8 +145,11 @@ bool LowerExpectIntrinsic::runOnFunction(Function &F) {
continue;
Function *Fn = CI->getCalledFunction();
- if (Fn && Fn->getIntrinsicID() == Intrinsic::expect)
+ if (Fn && Fn->getIntrinsicID() == Intrinsic::expect) {
+ Value *Exp = CI->getArgOperand(0);
+ CI->replaceAllUsesWith(Exp);
CI->eraseFromParent();
+ }
}
}