32 if (
auto intTy = dyn_cast<IntegerType>())
33 return intTy.getWidth() == width;
38 if (
auto intTy = dyn_cast<IntegerType>())
39 return intTy.isSignless();
44 if (
auto intTy = dyn_cast<IntegerType>())
45 return intTy.isSignless() && intTy.getWidth() == width;
50 if (
auto intTy = dyn_cast<IntegerType>())
51 return intTy.isSigned();
56 if (
auto intTy = dyn_cast<IntegerType>())
57 return intTy.isSigned() && intTy.getWidth() == width;
62 if (
auto intTy = dyn_cast<IntegerType>())
63 return intTy.isUnsigned();
68 if (
auto intTy = dyn_cast<IntegerType>())
69 return intTy.isUnsigned() && intTy.getWidth() == width;
74 return isSignlessInteger() || isa<IndexType>();
78 return isSignlessInteger() || isa<IndexType, FloatType>();
82 return isSignlessInteger() || isa<FloatType>();
92 assert(isIntOrFloat() &&
"only integers and floats have a bitwidth");
93 if (
auto intType = dyn_cast<IntegerType>())
94 return intType.getWidth();
95 return cast<FloatType>().getWidth();
Include the generated interface declarations.
bool isIntOrIndexOrFloat() const
Return true if this is an integer (of any signedness), index, or float type.
bool isInteger(unsigned width) const
Return true if this is an integer type with the specified width.
bool isIntOrFloat() const
Return true if this is an integer (of any signedness) or a float type.
bool isUnsignedInteger() const
Return true if this is an unsigned integer type (with the specified width).
bool isSignlessIntOrIndexOrFloat() const
Return true if this is a signless integer, index, or float type.
bool isSignlessIntOrIndex() const
Return true if this is a signless integer or index type.
bool isSignlessInteger() const
Return true if this is a signless integer type (with the specified width).
bool isSignedInteger() const
Return true if this is a signed integer type (with the specified width).
MLIRContext * getContext() const
Return the MLIRContext in which this type was uniqued.
MLIRContext is the top-level object for a collection of MLIR operations.
unsigned getIntOrFloatBitWidth() const
Return the bit width of an integer or a float type, assert failure on other types.
bool isIntOrIndex() const
Return true if this is an integer (of any signedness) or an index type.
bool isSignlessIntOrFloat() const
Return true of this is a signless integer or a float type.