/*methodName=*/"getFlags",
(ins), [{}], [{
if (Attribute flags = $_op->getAttr("omp.flags"))
- return flags.dyn_cast_or_null<mlir::omp::FlagsAttr>();
+ return ::llvm::dyn_cast_or_null<mlir::omp::FlagsAttr>(flags);
return nullptr;
}]>,
InterfaceMethod<
/*methodName=*/"getTarget",
(ins), [{}], [{
if (Attribute flags = $_op->getAttr("omp.target"))
- return flags.dyn_cast_or_null<mlir::omp::TargetAttr>();
+ return ::llvm::dyn_cast_or_null<mlir::omp::TargetAttr>(flags);
return nullptr;
}]>,
InterfaceMethod<
/// `AttrClass`, null otherwise.
template<typename AttrClass, typename NameClass>
AttrClass getAs(NameClass &&name) const {
- return get(std::forward<NameClass>(name))
- .template dyn_cast_or_null<AttrClass>();
+ return llvm::dyn_cast_or_null<AttrClass>(
+ get(std::forward<NameClass>(name)));
}
private:
// Override Attr class fields for specialized class
let predicate = !if(genSpecializedAttr,
- CPred<"$_self.isa<" # cppNamespace # "::" # specializedAttrClassName # ">()">,
+ CPred<"::llvm::isa<" # cppNamespace # "::" # specializedAttrClassName # ">($_self)">,
baseAttrClass.predicate);
let storageType = !if(genSpecializedAttr,
cppNamespace # "::" # specializedAttrClassName,
template <typename AttrClass>
AttrClass getArgAttrOfType(unsigned index, StringAttr name) {
- return getArgAttr(index, name).template dyn_cast_or_null<AttrClass>();
+ return ::llvm::dyn_cast_or_null<AttrClass>(getArgAttr(index, name));
}
template <typename AttrClass>
AttrClass getArgAttrOfType(unsigned index, StringRef name) {
- return getArgAttr(index, name).template dyn_cast_or_null<AttrClass>();
+ return ::llvm::dyn_cast_or_null<AttrClass>(getArgAttr(index, name));
}
/// Set the attributes held by the argument at 'index'.
template <typename AttrClass>
AttrClass getResultAttrOfType(unsigned index, StringAttr name) {
- return getResultAttr(index, name).template dyn_cast_or_null<AttrClass>();
+ return ::llvm::dyn_cast_or_null<AttrClass>(getResultAttr(index, name));
}
template <typename AttrClass>
AttrClass getResultAttrOfType(unsigned index, StringRef name) {
- return getResultAttr(index, name).template dyn_cast_or_null<AttrClass>();
+ return ::llvm::dyn_cast_or_null<AttrClass>(getResultAttr(index, name));
}
/// Set the attributes held by the result at 'index'.
#define INT_AND_FLOAT_CASE(kind, iop, fop) \
case vector::CombiningKind::kind: \
- if (resultType.isa<IntegerType>()) { \
+ if (llvm::isa<IntegerType>(resultType)) { \
result = rewriter.create<spirv::iop>(loc, resultType, result, next); \
} else { \
- assert(resultType.isa<FloatType>()); \
+ assert(llvm::isa<FloatType>(resultType)); \
result = rewriter.create<spirv::fop>(loc, resultType, result, next); \
} \
break
// Args with elements of type ArrayAttr must have a type.
} else if (llvm::isa<ArrayAttr>(
- arg) /*&& arg.getType().isa<NoneType>()*/) {
+ arg) /*&& llvm::isa<NoneType>(arg.getType())*/) {
// FIXME: Array attributes never have types
return emitOpError("array argument has no type");
}
#define REDUCE_FOLDER(OP) \
OpFoldResult OP::fold(FoldAdaptor adaptor) { \
- ShapedType inputTy = getInput().getType().cast<ShapedType>(); \
+ ShapedType inputTy = llvm::cast<ShapedType>(getInput().getType()); \
if (!inputTy.hasRank()) \
return {}; \
if (inputTy.getDimSize(getAxis()) == 1) \
resultETy = quantType.getStorageType();
auto accType = getAccType();
- if (inputETy.isa<IntegerType>() && !accType.isInteger(32))
+ if (llvm::isa<IntegerType>(inputETy) && !accType.isInteger(32))
return emitOpError("accumulator type for integer tensor is not i32");
if ((inputETy.isBF16() || inputETy.isF16()) &&
OpaqueProperties properties, RegionRange regions, \
SmallVectorImpl<ShapedTypeComponents> &inferredReturnShapes) { \
Type inputType = \
- operands.getType()[0].cast<TensorType>().getElementType(); \
+ llvm::cast<TensorType>(operands.getType()[0]).getElementType(); \
return ReduceInferReturnTypes(operands.getShape(0), inputType, \
properties.as<Properties *>()->axis, \
inferredReturnShapes); \
}
#define GET_UQTYPE(input_type) \
- ((input_type).getElementType().dyn_cast<quant::UniformQuantizedType>())
+ (llvm::dyn_cast<quant::UniformQuantizedType>((input_type).getElementType()))
#define GET_QTYPE(input_type) \
- ((input_type).getElementType().dyn_cast<quant::QuantizedType>())
+ (llvm::dyn_cast<quant::QuantizedType>((input_type).getElementType()))
/// Method to build ConvOpQuantizationAttr, called from
/// ConvOpQuantInfoBuilder/TransConvOpQuantInfoBuilder:
::mlir::ShapedTypeComponents>& inferredShapedTypeComponents) {
$cppClass::Adaptor adaptor(operands, attributes, properties, regions);
auto operandType =
- adaptor.getOperand().getType().cast<::mlir::ShapedType>();
+ ::llvm::cast<::mlir::ShapedType>(adaptor.getOperand().getType());
if (operandType.hasRank()) {
inferredShapedTypeComponents.emplace_back(operandType.getShape(),
operandType.getElementType());