34 if (
auto intTy = dyn_cast<IntegerType>())
35 return intTy.getWidth() == width;
40 if (
auto intTy = dyn_cast<IntegerType>())
41 return intTy.isSignless();
46 if (
auto intTy = dyn_cast<IntegerType>())
47 return intTy.isSignless() && intTy.getWidth() == width;
52 if (
auto intTy = dyn_cast<IntegerType>())
53 return intTy.isSigned();
58 if (
auto intTy = dyn_cast<IntegerType>())
59 return intTy.isSigned() && intTy.getWidth() == width;
64 if (
auto intTy = dyn_cast<IntegerType>())
65 return intTy.isUnsigned();
70 if (
auto intTy = dyn_cast<IntegerType>())
71 return intTy.isUnsigned() && intTy.getWidth() == width;
76 return isSignlessInteger() || isa<IndexType>();
80 return isSignlessInteger() || isa<IndexType, FloatType>();
84 return isSignlessInteger() || isa<FloatType>();
94 assert(isIntOrFloat() &&
"only integers and floats have a bitwidth");
95 if (
auto intType = dyn_cast<IntegerType>())
96 return intType.getWidth();
97 return cast<FloatType>().getWidth();
MLIRContext is the top-level object for a collection of MLIR operations.
bool isInteger(unsigned width) const
Return true if this is an integer type with the specified width.
bool isSignlessIntOrIndex() const
Return true if this is a signless integer or index type.
MLIRContext * getContext() const
Return the MLIRContext in which this type was uniqued.
bool isSignedInteger() const
Return true if this is a signed integer type (with the specified width).
bool isFloat8E4M3FN() const
bool isSignlessInteger() const
Return true if this is a signless integer type (with the specified width).
bool isIntOrIndexOrFloat() const
Return true if this is an integer (of any signedness), index, or float type.
bool isUnsignedInteger() const
Return true if this is an unsigned integer type (with the specified width).
bool isIntOrIndex() const
Return true if this is an integer (of any signedness) or an index type.
bool isIntOrFloat() const
Return true if this is an integer (of any signedness) or a float type.
bool isFloat8E5M2() const
bool isSignlessIntOrFloat() const
Return true of this is a signless integer or a float type.
unsigned getIntOrFloatBitWidth() const
Return the bit width of an integer or a float type, assert failure on other types.
bool isSignlessIntOrIndexOrFloat() const
Return true if this is a signless integer, index, or float type.
Detect if any of the given parameter types has a sub-element handler.
Include the generated interface declarations.