From a11f7ecbf80dd746726336bb5df5b6b9be87191d Mon Sep 17 00:00:00 2001 From: Jakub Staszak Date: Wed, 6 Jul 2011 23:50:16 +0000 Subject: [PATCH] Fix a bug in the "expect" intrinsic lowering. llvm-svn: 134566 --- llvm/lib/Transforms/Utils/LowerExpectIntrinsic.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/Utils/LowerExpectIntrinsic.cpp b/llvm/lib/Transforms/Utils/LowerExpectIntrinsic.cpp index fd94c84413ba..563f7f4490a3 100644 --- a/llvm/lib/Transforms/Utils/LowerExpectIntrinsic.cpp +++ b/llvm/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(); + } } }