diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index e65eaf38ad8..efda6608e44 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -8261,10 +8261,10 @@ Instruction *InstCombiner::commonIntCastTransforms(CastInst &CI) { // Only do this if the dest type is a simple type, don't convert the // expression tree to something weird like i93 unless the source is also // strange. - if (!isa(SrcI->getType()) || - (ShouldChangeType(SrcI->getType(), DestTy, TD) && - CanEvaluateInDifferentType(SrcI, DestTy, - CI.getOpcode(), NumCastsRemoved))) { + if ((isa(DestTy) || + ShouldChangeType(SrcI->getType(), DestTy, TD)) && + CanEvaluateInDifferentType(SrcI, DestTy, + CI.getOpcode(), NumCastsRemoved)) { // If this cast is a truncate, evaluting in a different type always // eliminates the cast, so it is always a win. If this is a zero-extension, // we need to do an AND to maintain the clear top-part of the computation,