summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-01-06 02:09:32 +0000
committerChris Lattner <sabre@nondot.org>2007-01-06 02:09:32 +0000
commit400f959a0c0ba98cfe18105d001796607dd63f6c (patch)
tree2df93d4bfb586b013747c02891282f5f1e09f680 /llvm/lib/Transforms/Scalar/InstructionCombining.cpp
parent64d87b0215e1778104cd466b41338e703341b267 (diff)
downloadbcm5719-llvm-400f959a0c0ba98cfe18105d001796607dd63f6c.tar.gz
bcm5719-llvm-400f959a0c0ba98cfe18105d001796607dd63f6c.zip
simplify some more code now that there are not multiple different integer
types of the same size llvm-svn: 32948
Diffstat (limited to 'llvm/lib/Transforms/Scalar/InstructionCombining.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 087d7d188dc..10e1c059afe 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/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() &&
OpenPOWER on IntegriCloud