From: Chris Lattner Date: Thu, 13 Nov 2003 19:17:02 +0000 (+0000) Subject: Implement feature: InstCombine/2003-11-13-ConstExprCastCall.ll X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=917e8042535f67697f90310126c85804f7552fde;p=oota-llvm.git 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 --- diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 8522b610e13..db178b3d1fd 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());