22 walkImmediateSubElementsFn(type, walkAttrsFn, walkTypesFn);
28 return replaceImmediateSubElementsFn(type, replAttrs, replTypes);
41 return llvm::isa<Float8E5M2FNUZType>(*
this);
44 return llvm::isa<Float8E4M3FNUZType>(*
this);
47 return llvm::isa<Float8E4M3B11FNUZType>(*
this);
49 bool Type::isBF16()
const {
return llvm::isa<BFloat16Type>(*
this); }
50 bool Type::isF16()
const {
return llvm::isa<Float16Type>(*
this); }
51 bool Type::isTF32()
const {
return llvm::isa<FloatTF32Type>(*
this); }
52 bool Type::isF32()
const {
return llvm::isa<Float32Type>(*
this); }
53 bool Type::isF64()
const {
return llvm::isa<Float64Type>(*
this); }
54 bool Type::isF80()
const {
return llvm::isa<Float80Type>(*
this); }
55 bool Type::isF128()
const {
return llvm::isa<Float128Type>(*
this); }
63 if (
auto intTy = llvm::dyn_cast<IntegerType>(*
this))
64 return intTy.getWidth() == width;
69 if (
auto intTy = llvm::dyn_cast<IntegerType>(*
this))
70 return intTy.isSignless();
75 if (
auto intTy = llvm::dyn_cast<IntegerType>(*
this))
76 return intTy.isSignless() && intTy.getWidth() == width;
81 if (
auto intTy = llvm::dyn_cast<IntegerType>(*
this))
82 return intTy.isSigned();
87 if (
auto intTy = llvm::dyn_cast<IntegerType>(*
this))
88 return intTy.isSigned() && intTy.getWidth() == width;
93 if (
auto intTy = llvm::dyn_cast<IntegerType>(*
this))
94 return intTy.isUnsigned();
99 if (
auto intTy = llvm::dyn_cast<IntegerType>(*
this))
100 return intTy.isUnsigned() && intTy.getWidth() == width;
105 return isSignlessInteger() || llvm::isa<IndexType>(*
this);
109 return isSignlessInteger() || llvm::isa<IndexType, FloatType>(*
this);
113 return isSignlessInteger() || llvm::isa<FloatType>(*
this);
117 return llvm::isa<IntegerType>(*
this) || isIndex();
121 return llvm::isa<IntegerType, FloatType>(*
this);
127 assert(isIntOrFloat() &&
"only integers and floats have a bitwidth");
128 if (
auto intType = llvm::dyn_cast<IntegerType>(*
this))
129 return intType.getWidth();
130 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 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 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 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.