[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Andrew Lenharth
alenhar2 at cs.uiuc.edu
Thu Apr 20 07:57:00 PDT 2006
Changes in directory llvm/lib/Transforms/Scalar:
InstructionCombining.cpp updated: 1.469 -> 1.470
---
Log message:
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.
---
Diffs of the changes: (+4 -2)
InstructionCombining.cpp | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.469 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.470
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.469 Mon Apr 17 17:26:56 2006
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Thu Apr 20 09:56:47 2006
@@ -5681,8 +5681,10 @@
// 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
More information about the llvm-commits
mailing list