8 #ifndef MLIR_DIALECT_ARITHMETIC_IR_ARITHMETIC_H_ 9 #define MLIR_DIALECT_ARITHMETIC_IR_ARITHMETIC_H_ 23 #include "mlir/Dialect/Arithmetic/IR/ArithmeticOpsDialect.h.inc" 29 #include "mlir/Dialect/Arithmetic/IR/ArithmeticOpsEnums.h.inc" 35 #define GET_OP_CLASSES 36 #include "mlir/Dialect/Arithmetic/IR/ArithmeticOps.h.inc" 44 using arith::ConstantOp::ConstantOp;
56 return arith::ConstantOp::getValue().cast<IntegerAttr>().getInt();
65 using arith::ConstantOp::ConstantOp;
72 return arith::ConstantOp::getValue().cast<FloatAttr>().getValue();
81 using arith::ConstantOp::ConstantOp;
87 return arith::ConstantOp::getValue().cast<IntegerAttr>().getInt();
130 #endif // MLIR_DIALECT_ARITHMETIC_IR_ARITHMETIC_H_
Include the generated interface declarations.
Operation is a basic unit of execution within MLIR.
Specialization of arith.constant op that returns an integer value.
bool applyCmpPredicate(arith::CmpIPredicate predicate, const APInt &lhs, const APInt &rhs)
Compute lhs pred rhs, where pred is one of the known integer comparison predicates.
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
Attribute getIdentityValueAttr(AtomicRMWKind kind, Type resultType, OpBuilder &builder, Location loc)
Returns the identity value attribute associated with an AtomicRMWKind op.
Attributes are known-constant values of operations.
Value getReductionOp(AtomicRMWKind op, OpBuilder &builder, Location loc, Value lhs, Value rhs)
Returns the value obtained by applying the reduction operation kind associated with a binary AtomicRM...
This represents an operation in an abstracted form, suitable for use with the builder APIs...
static bool classof(Operation *op)
Value getIdentityValue(AtomicRMWKind op, Type resultType, OpBuilder &builder, Location loc)
Returns the identity value associated with an AtomicRMWKind op.
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Specialization of arith.constant op that returns a floating point value.
arith::CmpIPredicate invertPredicate(arith::CmpIPredicate pred)
Invert an integer comparison predicate.
Specialization of arith.constant op that returns an integer of index type.
static void build(OpBuilder &builder, OperationState &result, int64_t value, unsigned width)
Build a constant int op that produces an integer of the specified width.
This class helps build Operations.