diff options
author | Chris Lattner <sabre@nondot.org> | 2007-01-06 02:09:32 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-01-06 02:09:32 +0000 |
commit | ec47992f5ca8572c7ae2f52c60fbcbe10552ef17 (patch) | |
tree | 563d7e0e947cb0a1e7ae6fb25f1d1a25cc81a96e | |
parent | 57d8637468d8293f25e13ecf3e0b1786b3bc5da3 (diff) |
simplify some more code now that there are not multiple different integer
types of the same size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32948 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 087d7d188d..10e1c059af 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -7211,13 +7211,9 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) { // Check to see if we are changing the return type... if (OldRetTy != FT->getReturnType()) { - if (Callee->isExternal() && - !Caller->use_empty() && - !(OldRetTy->canLosslesslyBitCastTo(FT->getReturnType()) || - (isa<PointerType>(FT->getReturnType()) && - TD->getIntPtrType()->canLosslesslyBitCastTo(OldRetTy))) - ) - return false; // Cannot transform this return value... + if (Callee->isExternal() && !Caller->use_empty() && + OldRetTy != FT->getReturnType()) + return false; // Cannot transform this return value. // If the callsite is an invoke instruction, and the return value is used by // a PHI node in a successor, we cannot change the return type of the call @@ -7242,7 +7238,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) { const Type *ActTy = (*AI)->getType(); ConstantInt *c = dyn_cast<ConstantInt>(*AI); //Either we can cast directly, or we can upconvert the argument - bool isConvertible = ActTy->canLosslesslyBitCastTo(ParamTy) || + bool isConvertible = ActTy == ParamTy || (ParamTy->isIntegral() && ActTy->isIntegral() && ParamTy->getPrimitiveSize() >= ActTy->getPrimitiveSize()) || (c && ParamTy->getPrimitiveSize() >= ActTy->getPrimitiveSize() && |