diff --git a/llvm/lib/Transforms/Scalar/Reassociate.cpp b/llvm/lib/Transforms/Scalar/Reassociate.cpp --- a/llvm/lib/Transforms/Scalar/Reassociate.cpp +++ b/llvm/lib/Transforms/Scalar/Reassociate.cpp @@ -154,20 +154,20 @@ /// Return true if V is an instruction of the specified opcode and if it /// only has one use. static BinaryOperator *isReassociableOp(Value *V, unsigned Opcode) { - auto *I = dyn_cast(V); - if (I && I->hasOneUse() && I->getOpcode() == Opcode) - if (!isa(I) || hasFPAssociativeFlags(I)) - return cast(I); + auto *BO = dyn_cast(V); + if (BO && BO->hasOneUse() && BO->getOpcode() == Opcode) + if (!isa(BO) || hasFPAssociativeFlags(BO)) + return BO; return nullptr; } static BinaryOperator *isReassociableOp(Value *V, unsigned Opcode1, unsigned Opcode2) { - auto *I = dyn_cast(V); - if (I && I->hasOneUse() && - (I->getOpcode() == Opcode1 || I->getOpcode() == Opcode2)) - if (!isa(I) || hasFPAssociativeFlags(I)) - return cast(I); + auto *BO = dyn_cast(V); + if (BO && BO->hasOneUse() && + (BO->getOpcode() == Opcode1 || BO->getOpcode() == Opcode2)) + if (!isa(BO) || hasFPAssociativeFlags(BO)) + return BO; return nullptr; }