From: Jakub Staszak Date: Wed, 6 Jul 2011 23:50:16 +0000 (+0000) Subject: Fix a bug in the "expect" intrinsic lowering. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=447c40c4028f1563826ea75f47fd3ec48c7a74ad;p=oota-llvm.git Fix a bug in the "expect" intrinsic lowering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134566 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Utils/LowerExpectIntrinsic.cpp b/lib/Transforms/Utils/LowerExpectIntrinsic.cpp index fd94c84413b..563f7f4490a 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(); + } } }