diff --git a/llvm/include/llvm/IR/Operator.h b/llvm/include/llvm/IR/Operator.h index 4d77860be994e..38f84647ec74e 100644 --- a/llvm/include/llvm/IR/Operator.h +++ b/llvm/include/llvm/IR/Operator.h @@ -134,9 +134,7 @@ class OverflowingBinaryOperator : public Operator { } static bool classof(const ConstantExpr *CE) { return CE->getOpcode() == Instruction::Add || - CE->getOpcode() == Instruction::Sub || - CE->getOpcode() == Instruction::Mul || - CE->getOpcode() == Instruction::Shl; + CE->getOpcode() == Instruction::Sub; } static bool classof(const Value *V) { return (isa(V) && classof(cast(V))) || @@ -150,7 +148,7 @@ struct OperandTraits DEFINE_TRANSPARENT_OPERAND_ACCESSORS(OverflowingBinaryOperator, Value) -/// A udiv or sdiv instruction, which can be marked as "exact", +/// A udiv, sdiv, lshr, or ashr instruction, which can be marked as "exact", /// indicating that no bits are destroyed. class PossiblyExactOperator : public Operator { public: @@ -182,15 +180,11 @@ class PossiblyExactOperator : public Operator { OpC == Instruction::LShr; } - static bool classof(const ConstantExpr *CE) { - return isPossiblyExactOpcode(CE->getOpcode()); - } static bool classof(const Instruction *I) { return isPossiblyExactOpcode(I->getOpcode()); } static bool classof(const Value *V) { - return (isa(V) && classof(cast(V))) || - (isa(V) && classof(cast(V))); + return (isa(V) && classof(cast(V))); } };