22 walkImmediateSubElementsFn(type, walkAttrsFn, walkTypesFn);
28 return replaceImmediateSubElementsFn(type, replAttrs, replTypes);
44 return llvm::isa<Float8E5M2FNUZType>(*
this);
47 return llvm::isa<Float8E4M3FNUZType>(*
this);
50 return llvm::isa<Float8E4M3B11FNUZType>(*
this);
53 return llvm::isa<Float8E8M0FNUType>(*
this);
56 bool Type::isBF16()
const {
return llvm::isa<BFloat16Type>(*
this); }
57 bool Type::isF16()
const {
return llvm::isa<Float16Type>(*
this); }
58 bool Type::isTF32()
const {
return llvm::isa<FloatTF32Type>(*
this); }
59 bool Type::isF32()
const {
return llvm::isa<Float32Type>(*
this); }
60 bool Type::isF64()
const {
return llvm::isa<Float64Type>(*
this); }
61 bool Type::isF80()
const {
return llvm::isa<Float80Type>(*
this); }
62 bool Type::isF128()
const {
return llvm::isa<Float128Type>(*
this); }
70 if (
auto intTy = llvm::dyn_cast<IntegerType>(*
this))
71 return intTy.getWidth() == width;
76 if (
auto intTy = llvm::dyn_cast<IntegerType>(*
this))
77 return intTy.isSignless();
82 if (
auto intTy = llvm::dyn_cast<IntegerType>(*
this))
83 return intTy.isSignless() && intTy.getWidth() == width;
88 if (
auto intTy = llvm::dyn_cast<IntegerType>(*
this))
89 return intTy.isSigned();
94 if (
auto intTy = llvm::dyn_cast<IntegerType>(*
this))
95 return intTy.isSigned() && intTy.getWidth() == width;
100 if (
auto intTy = llvm::dyn_cast<IntegerType>(*
this))
101 return intTy.isUnsigned();
106 if (
auto intTy = llvm::dyn_cast<IntegerType>(*
this))
107 return intTy.isUnsigned() && intTy.getWidth() == width;
112 return isSignlessInteger() || llvm::isa<IndexType>(*
this);
116 return isSignlessInteger() || llvm::isa<IndexType, FloatType>(*
this);
120 return isSignlessInteger() || llvm::isa<FloatType>(*
this);
124 return llvm::isa<IntegerType>(*
this) || isIndex();
128 return llvm::isa<IntegerType, FloatType>(*
this);
134 assert(isIntOrFloat() &&
"only integers and floats have a bitwidth");
135 if (
auto intType = llvm::dyn_cast<IntegerType>(*
this))
136 return intType.getWidth();
137 return llvm::cast<FloatType>(*this).getWidth();
Type replaceImmediateSubElements(Type type, ArrayRef< Attribute > replAttrs, ArrayRef< Type > replTypes) const
Replace the immediate sub-elements of the given type.
void walkImmediateSubElements(Type type, function_ref< void(Attribute)> walkAttrsFn, function_ref< void(Type)> walkTypesFn) const
Walk the immediate sub-elements of the given type.
Attributes are known-constant values of operations.
MLIRContext is the top-level object for a collection of MLIR operations.
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
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 isFloat8E3M4() const
bool isIntOrIndexOrFloat() const
Return true if this is an integer (of any signedness), index, or float type.
bool isFloat8E4M3FNUZ() const
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 isFloat8E4M3B11FNUZ() const
bool isFloat6E3M2FN() const
bool isInteger() 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 isFloat8E5M2() const
bool isFloat8E8M0FNU() const
bool isFloat4E2M1FN() const
bool isFloat6E2M3FN() 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 isFloat8E4M3() const
bool isFloat8E5M2FNUZ() const
bool isSignlessIntOrIndexOrFloat() const
Return true if this is a signless integer, index, or float type.
Include the generated interface declarations.