summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2006-04-20 14:56:47 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2006-04-20 14:56:47 +0000
commit61eae29ad6c0dc7ba07a09299313c2335ddd59a8 (patch)
tree3e066ee204f6bbe6343e5b263f3433d5959b6768 /llvm/lib/Transforms
parentb950dbea0b15c4e9fba0da6ac0e3214d21c1a68f (diff)
downloadbcm5719-llvm-61eae29ad6c0dc7ba07a09299313c2335ddd59a8.tar.gz
bcm5719-llvm-61eae29ad6c0dc7ba07a09299313c2335ddd59a8.zip
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
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index be3868dca8c..79d79011f4b 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -5681,8 +5681,10 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
// Check to see if we are changing the return type...
if (OldRetTy != FT->getReturnType()) {
if (Callee->isExternal() &&
- !OldRetTy->isLosslesslyConvertibleTo(FT->getReturnType()) &&
- !Caller->use_empty())
+ !(OldRetTy->isLosslesslyConvertibleTo(FT->getReturnType()) ||
+ (isa<PointerType>(FT->getReturnType()) &&
+ OldRetTy->isLosslesslyConvertibleTo(TD->getIntPtrType())))
+ && !Caller->use_empty())
return false; // Cannot transform this return value...
// If the callsite is an invoke instruction, and the return value is used by
OpenPOWER on IntegriCloud