forked from OSchip/llvm-project
If we can convert the return pointer type into an integer that IntPtrType
can be converted to losslessly, we can continue the conversion to a direct call. llvm-svn: 27880
This commit is contained in:
parent
b950dbea0b
commit
61eae29ad6
|
@ -5681,8 +5681,10 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
|
||||||
// Check to see if we are changing the return type...
|
// Check to see if we are changing the return type...
|
||||||
if (OldRetTy != FT->getReturnType()) {
|
if (OldRetTy != FT->getReturnType()) {
|
||||||
if (Callee->isExternal() &&
|
if (Callee->isExternal() &&
|
||||||
!OldRetTy->isLosslesslyConvertibleTo(FT->getReturnType()) &&
|
!(OldRetTy->isLosslesslyConvertibleTo(FT->getReturnType()) ||
|
||||||
!Caller->use_empty())
|
(isa<PointerType>(FT->getReturnType()) &&
|
||||||
|
OldRetTy->isLosslesslyConvertibleTo(TD->getIntPtrType())))
|
||||||
|
&& !Caller->use_empty())
|
||||||
return false; // Cannot transform this return value...
|
return false; // Cannot transform this return value...
|
||||||
|
|
||||||
// If the callsite is an invoke instruction, and the return value is used by
|
// If the callsite is an invoke instruction, and the return value is used by
|
||||||
|
|
Loading…
Reference in New Issue