summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-11-13 19:17:02 +0000
committerChris Lattner <sabre@nondot.org>2003-11-13 19:17:02 +0000
commit917e8042535f67697f90310126c85804f7552fde (patch)
treef7fd38e5891412833c6fd081d8cc6133a1c36ca4
parent623f707bee5b0ff06409a9303d687cf777a2952a (diff)
downloadllvm-917e8042535f67697f90310126c85804f7552fde.tar.gz
llvm-917e8042535f67697f90310126c85804f7552fde.tar.bz2
llvm-917e8042535f67697f90310126c85804f7552fde.tar.xz
Implement feature: InstCombine/2003-11-13-ConstExprCastCall.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9981 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 8522b610e1..db178b3d1f 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -1801,7 +1801,8 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
const Type *OldRetTy = Caller->getType();
if (Callee->isExternal() &&
- !OldRetTy->isLosslesslyConvertibleTo(FT->getReturnType()))
+ !OldRetTy->isLosslesslyConvertibleTo(FT->getReturnType()) &&
+ !Caller->use_empty())
return false; // Cannot transform this return value...
unsigned NumActualArgs = unsigned(CS.arg_end()-CS.arg_begin());