Index: llvm/lib/Transforms/Scalar/Reassociate.cpp =================================================================== --- llvm/lib/Transforms/Scalar/Reassociate.cpp +++ llvm/lib/Transforms/Scalar/Reassociate.cpp @@ -147,7 +147,7 @@ /// Instruction::isAssociative() because it includes operations like fsub. /// (This routine is only intended to be called for floating-point operations.) static bool hasFPAssociativeFlags(Instruction *I) { - assert(I && I->getType()->isFPOrFPVectorTy() && "Should only check FP ops"); + assert(I && isa(I) && "Should only check FP ops"); return I->hasAllowReassoc() && I->hasNoSignedZeros(); } @@ -778,7 +778,7 @@ Constant *Undef = UndefValue::get(I->getType()); NewOp = BinaryOperator::Create(Instruction::BinaryOps(Opcode), Undef, Undef, "", I); - if (NewOp->getType()->isFPOrFPVectorTy()) + if (isa(NewOp)) NewOp->setFastMathFlags(I->getFastMathFlags()); } else { NewOp = NodesToRewrite.pop_back_val(); @@ -2227,7 +2227,7 @@ // Don't optimize floating-point instructions unless they have the // appropriate FastMathFlags for reassociation enabled. - if (I->getType()->isFPOrFPVectorTy() && !hasFPAssociativeFlags(I)) + if (isa(I) && !hasFPAssociativeFlags(I)) return; // Do not reassociate boolean (i1) expressions. We want to preserve the