simplify code a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94281 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2010-01-23 04:42:42 +00:00
parent e4a0a151a5
commit 33b1758e16

View File

@ -2080,25 +2080,25 @@ unsigned CastInst::isEliminableCastPair(
case 3: case 3:
// no-op cast in second op implies firstOp as long as the DestTy // no-op cast in second op implies firstOp as long as the DestTy
// is integer and we are not converting between a vector and a // is integer and we are not converting between a vector and a
// non vector type // non vector type.
if (SrcTy->getTypeID() != Type::VectorTyID && DstTy->isInteger()) if (!isa<VectorType>(SrcTy) && DstTy->isInteger())
return firstOp; return firstOp;
return 0; return 0;
case 4: case 4:
// no-op cast in second op implies firstOp as long as the DestTy // no-op cast in second op implies firstOp as long as the DestTy
// is floating point // is floating point.
if (DstTy->isFloatingPoint()) if (DstTy->isFloatingPoint())
return firstOp; return firstOp;
return 0; return 0;
case 5: case 5:
// no-op cast in first op implies secondOp as long as the SrcTy // no-op cast in first op implies secondOp as long as the SrcTy
// is an integer // is an integer.
if (SrcTy->isInteger()) if (SrcTy->isInteger())
return secondOp; return secondOp;
return 0; return 0;
case 6: case 6:
// no-op cast in first op implies secondOp as long as the SrcTy // no-op cast in first op implies secondOp as long as the SrcTy
// is a floating point // is a floating point.
if (SrcTy->isFloatingPoint()) if (SrcTy->isFloatingPoint())
return secondOp; return secondOp;
return 0; return 0;