diff options
author | Jakub Staszak <jstaszak@apple.com> | 2011-07-06 23:50:16 +0000 |
---|---|---|
committer | Jakub Staszak <jstaszak@apple.com> | 2011-07-06 23:50:16 +0000 |
commit | 447c40c4028f1563826ea75f47fd3ec48c7a74ad (patch) | |
tree | 728520aba1d50f3b91d6a612efc16cb41f94acf3 /lib/Transforms/Utils/LowerExpectIntrinsic.cpp | |
parent | a38cfb2fceb266bd78164021c08284dc59a1e8a3 (diff) | |
download | external_llvm-447c40c4028f1563826ea75f47fd3ec48c7a74ad.zip external_llvm-447c40c4028f1563826ea75f47fd3ec48c7a74ad.tar.gz external_llvm-447c40c4028f1563826ea75f47fd3ec48c7a74ad.tar.bz2 |
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
Diffstat (limited to 'lib/Transforms/Utils/LowerExpectIntrinsic.cpp')
-rw-r--r-- | lib/Transforms/Utils/LowerExpectIntrinsic.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Transforms/Utils/LowerExpectIntrinsic.cpp b/lib/Transforms/Utils/LowerExpectIntrinsic.cpp index fd94c84..563f7f4 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(); + } } } |