diff --git a/mapped_domain.cc b/mapped_domain.cc index 8b7887d..38c8246 100644 --- a/mapped_domain.cc +++ b/mapped_domain.cc @@ -60,7 +60,7 @@ mlir::LogicalResult MappedDomain::ResolveUnification( mlir::Operation *dim_op = dimension.value.defining_op().GetDuplicatedOp(); if (isa(dim_op)) return mlir::success(); - if (constraint.isa()) { + if (llvm::isa(constraint)) { // If the dimension is new, extend the domain. constraint = MappingDimExpr::get(domain_.size(), context()); assert(dimension.mapping.IsSurjective()); diff --git a/sair_attributes.cc b/sair_attributes.cc index 4229a53..7628762 100644 --- a/sair_attributes.cc +++ b/sair_attributes.cc @@ -74,7 +74,7 @@ llvm::SmallBitVector MappingExpr::DependencyMask(int domain_size) const { bool MappingExpr::HasNoneExprs() const { bool has_none_exprs = false; Walk([&](MappingExpr sub_expr) { - has_none_exprs |= sub_expr.isa(); + has_none_exprs |= llvm::isa(sub_expr); }); return has_none_exprs; } @@ -82,7 +82,7 @@ bool MappingExpr::HasNoneExprs() const { bool MappingExpr::HasUnknownExprs() const { bool has_unknown_exprs = false; Walk([&](MappingExpr sub_expr) { - has_unknown_exprs |= sub_expr.isa(); + has_unknown_exprs |= llvm::isa(sub_expr); }); return has_unknown_exprs; } @@ -109,10 +109,10 @@ int MappingExpr::MinDomainSize() const { // expression is `?` or `none`. Returns `nullptr` if unification fails. static MappingExpr ResolveNoneAndUnknownUnification(MappingExpr lhs, MappingExpr rhs) { - if (lhs.isa()) return rhs; - if (rhs.isa()) return lhs; - if (lhs.isa()) return rhs; - if (rhs.isa()) return lhs; + if (llvm::isa(lhs)) return rhs; + if (llvm::isa(rhs)) return lhs; + if (llvm::isa(lhs)) return rhs; + if (llvm::isa(rhs)) return lhs; return MappingExpr(); } @@ -383,7 +383,7 @@ mlir::LogicalResult MappingStripeExpr::SetInverse( MappingExpr MappingStripeExpr::FindInInverse( llvm::ArrayRef inverse) const { auto operand_inverse = operand().FindInInverse(inverse); - if (operand_inverse.isa()) { + if (llvm::isa(operand_inverse)) { return operand_inverse; } auto unstripe_expr = llvm::cast(operand_inverse); @@ -545,7 +545,7 @@ MappingExpr MappingUnStripeExpr::Unify( // If the last operand is `none` or `?`, we can replace it by an arbitrary // number of operands. - if (min_operands.back().isa()) { + if (llvm::isa(min_operands.back())) { min_operands = min_operands.drop_back(); min_factors = min_factors.drop_back(); } @@ -568,7 +568,7 @@ MappingExpr MappingUnStripeExpr::FindInInverse( MappingExpr operand_inverse; for (int i = 0, e = operands().size(); i < e; ++i) { operand_inverse = operands()[i].FindInInverse(inverse); - if (operand_inverse.isa()) continue; + if (llvm::isa(operand_inverse)) continue; return llvm::cast(operand_inverse).operand(); } // Unstripe has at least one operand. @@ -797,7 +797,7 @@ MappingAttr MappingAttr::MakeSurjective() const { new_exprs.reserve(size()); for (MappingExpr expr : Dimensions()) { MappingExpr new_expr = expr.Map([&](MappingExpr sub_expr) -> MappingExpr { - if (!sub_expr.isa()) return sub_expr; + if (!llvm::isa(sub_expr)) return sub_expr; return MappingDimExpr::get(num_dimensions++, getContext()); }); new_exprs.push_back(new_expr); @@ -810,7 +810,7 @@ MappingAttr MappingAttr::MakeFullySpecified() const { auto new_exprs = llvm::to_vector<4>(llvm::map_range(Dimensions(), [&](auto expr) { return expr.Map([&](MappingExpr sub_expr) -> MappingExpr { - return sub_expr.isa() ? none : sub_expr; + return llvm::isa(sub_expr) ? none : sub_expr; }); })); return MappingAttr::get(getContext(), UseDomainSize(), new_exprs); @@ -946,8 +946,8 @@ MappingAttr MappingAttr::UnifyUnknownExprs(MappingAttr other) const { for (auto [lhs, rhs] : llvm::zip(Dimensions(), other.Dimensions())) { MappingExpr unified = lhs.Unify(rhs, [](MappingExpr sub_lhs, MappingExpr sub_rhs) { - if (sub_lhs.isa()) return sub_rhs; - if (sub_rhs.isa()) return sub_lhs; + if (llvm::isa(sub_lhs)) return sub_rhs; + if (llvm::isa(sub_rhs)) return sub_lhs; return MappingExpr(); }); if (unified == nullptr) return nullptr; @@ -1236,7 +1236,7 @@ static DomainShapeDim StripeAccessedShape(MappingStripeExpr expr, static DomainShapeDim UnStripeAccessedShape(MappingUnStripeExpr expr, DomainShapeDim inner_shape, MappingAttr inverted_mapping) { - if (inner_shape.type().isa()) return inner_shape; + if (llvm::isa(inner_shape.type())) return inner_shape; auto type = llvm::cast(inner_shape.type()); int new_step = type.getStep() / expr.factors().front(); return DomainShapeDim( @@ -1460,10 +1460,10 @@ bool LoopAttr::classof(mlir::Attribute attr) { if (!derived) return false; auto name = derived.get("name"); - if (!name.isa_and_nonnull()) return false; + if (!llvm::isa_and_nonnull(name)) return false; auto iter = derived.get("iter"); - if (!iter.isa_and_nonnull()) return false; + if (!llvm::isa_and_nonnull(iter)) return false; auto unroll = derived.get("unroll"); if (!unroll) return derived.size() == 2; @@ -1481,7 +1481,8 @@ mlir::StringAttr LoopAttr::name() const { auto derived = llvm::cast(*this); auto name = derived.get("name"); assert(name && "attribute not found."); - assert(name.isa() && "incorrect Attribute type found."); + assert(llvm::isa(name) && + "incorrect Attribute type found."); return llvm::cast(name); } @@ -1489,7 +1490,7 @@ MappingExpr LoopAttr::iter() const { auto derived = llvm::cast(*this); auto iter = derived.get("iter"); assert(iter && "attribute not found."); - assert(iter.isa() && "incorrect Attribute type found."); + assert(llvm::isa(iter) && "incorrect Attribute type found."); return llvm::cast(iter); } @@ -1497,7 +1498,8 @@ mlir::IntegerAttr LoopAttr::unroll() const { auto derived = llvm::cast(*this); auto unroll = derived.get("unroll"); if (!unroll) return nullptr; - assert(unroll.isa() && "incorrect Attribute type found."); + assert(llvm::isa(unroll) && + "incorrect Attribute type found."); return llvm::cast(unroll); } @@ -1531,19 +1533,19 @@ bool BufferAttr::classof(mlir::Attribute attr) { int num_absent_attrs = 0; auto space = derived.get("space"); - if (!space.isa_and_nonnull()) return false; + if (!llvm::isa_and_nonnull(space)) return false; auto name = derived.get("name"); if (!name) { ++num_absent_attrs; - } else if (!name.isa()) { + } else if (!llvm::isa(name)) { return false; } auto layout = derived.get("layout"); if (!layout) { ++num_absent_attrs; - } else if (!layout.isa()) { + } else if (!llvm::isa(layout)) { return false; } @@ -1554,7 +1556,7 @@ mlir::StringAttr BufferAttr::space() const { auto derived = llvm::cast(*this); auto space = derived.get("space"); assert(space && "attribute not found."); - assert(space.isa() && "incorrect Attribute type found."); + assert(llvm::isa(space) && "incorrect Attribute type found."); return llvm::cast(space); } @@ -1562,7 +1564,8 @@ mlir::StringAttr BufferAttr::name() const { auto derived = llvm::cast(*this); auto name = derived.get("name"); if (!name) return nullptr; - assert(name.isa() && "incorrect Attribute type found."); + assert(llvm::isa(name) && + "incorrect Attribute type found."); return llvm::cast(name); } @@ -1570,7 +1573,8 @@ NamedMappingAttr BufferAttr::layout() const { auto derived = llvm::cast(*this); auto layout = derived.get("layout"); if (!layout) return nullptr; - assert(layout.isa() && "incorrect Attribute type found."); + assert(llvm::isa(layout) && + "incorrect Attribute type found."); return llvm::cast(layout); } @@ -1640,7 +1644,7 @@ bool DecisionsAttr::classof(mlir::Attribute attr) { auto loop_nest_attr = llvm::dyn_cast(loop_nest); if (!loop_nest_attr) return false; if (llvm::any_of(loop_nest_attr, [](mlir::Attribute attr) { - return !attr.isa_and_nonnull(); + return !llvm::isa_and_nonnull(attr); })) { return false; } @@ -1649,21 +1653,21 @@ bool DecisionsAttr::classof(mlir::Attribute attr) { auto storage = derived.get("storage"); if (!storage) { ++num_absent_attrs; - } else if (!storage.isa()) { + } else if (!llvm::isa(storage)) { return false; } auto expansion = derived.get("expansion"); if (!expansion) { ++num_absent_attrs; - } else if (!expansion.isa()) { + } else if (!llvm::isa(expansion)) { return false; } auto copy_of = derived.get("copy_of"); if (!copy_of) { ++num_absent_attrs; - } else if (!copy_of.isa()) { + } else if (!llvm::isa(copy_of)) { return false; } @@ -1673,8 +1677,8 @@ bool DecisionsAttr::classof(mlir::Attribute attr) { } else { auto operands_attr = llvm::dyn_cast(operands); if (llvm::any_of(operands_attr, [](mlir::Attribute attr) { - return !attr.isa_and_nonnull(); + return !llvm::isa_and_nonnull( + attr); })) { return false; } @@ -1687,7 +1691,7 @@ mlir::IntegerAttr DecisionsAttr::sequence() const { auto derived = llvm::cast(*this); auto sequence = derived.get("sequence"); if (!sequence) return nullptr; - assert(sequence.isa() && + assert(llvm::isa(sequence) && "incorrect Attribute type found."); return llvm::cast(sequence); } @@ -1696,7 +1700,8 @@ mlir::ArrayAttr DecisionsAttr::loop_nest() const { auto derived = llvm::cast(*this); auto loop_nest = derived.get("loop_nest"); if (!loop_nest) return nullptr; - assert(loop_nest.isa() && "incorrect Attribute type found."); + assert(llvm::isa(loop_nest) && + "incorrect Attribute type found."); return llvm::cast(loop_nest); } @@ -1704,7 +1709,8 @@ mlir::ArrayAttr DecisionsAttr::storage() const { auto derived = llvm::cast(*this); auto storage = derived.get("storage"); if (!storage) return nullptr; - assert(storage.isa() && "incorrect Attribute type found."); + assert(llvm::isa(storage) && + "incorrect Attribute type found."); return llvm::cast(storage); } @@ -1712,7 +1718,7 @@ mlir::StringAttr DecisionsAttr::expansion() const { auto derived = llvm::cast(*this); auto expansion = derived.get("expansion"); if (!expansion) return nullptr; - assert(expansion.isa() && + assert(llvm::isa(expansion) && "incorrect Attribute type found."); return llvm::cast(expansion); } @@ -1721,7 +1727,8 @@ mlir::Attribute DecisionsAttr::copy_of() const { auto derived = llvm::cast(*this); auto copy_of = derived.get("copy_of"); if (!copy_of) return nullptr; - assert(copy_of.isa() && "incorrect Attribute type found."); + assert(llvm::isa(copy_of) && + "incorrect Attribute type found."); return llvm::cast(copy_of); } @@ -1729,7 +1736,8 @@ mlir::ArrayAttr DecisionsAttr::operands() const { auto derived = llvm::cast(*this); auto operands = derived.get("operands"); if (!operands) return nullptr; - assert(operands.isa() && "incorrect Attribute type found."); + assert(llvm::isa(operands) && + "incorrect Attribute type found."); return llvm::cast(operands); } diff --git a/sair_base.td b/sair_base.td index 3e85e6a..5afee39 100644 --- a/sair_base.td +++ b/sair_base.td @@ -158,7 +158,7 @@ def SairEmptyDomainShapeAttr : def SairResultDomainShapeAttr : DerivedAttr<"DomainShapeAttr", [{ mlir::Type type = getOperation()->getResult(0).getType(); - return type.cast().Shape(); + return llvm::cast(type).Shape(); }]> { let convertFromStorage = [{$_self}]; } @@ -248,7 +248,7 @@ def SairValue : Type($_self)">, "value">; // Predicate that checks the element type of a Sair value. class SairElementTypePred - : SubstLeaves<"$_self", "$_self.cast().ElementType()", + : SubstLeaves<"$_self", "llvm::cast($_self).ElementType()", type.predicate>; // Type constraint for Sair values with a specific element type. @@ -420,7 +420,7 @@ def SairOpInterface : OpInterface<"SairOp"> { "Returns lowering decisions for the given operation instance", "DecisionsAttr", "GetDecisions", (ins "int":$instance), [{}], [{ mlir::ArrayAttr instances = *$_op.getInstances(); - return instances.getValue()[instance].cast(); + return llvm::cast(instances.getValue()[instance]); }] >, InterfaceMethod< @@ -504,8 +504,7 @@ def SairValueProducerOp : OpInterface<"ValueProducerOp"> { "llvm::ArrayRef", "GetCopies", (ins "int":$result), [{}], [{ auto all_copies = $_op.getCopiesAttr(); if (all_copies == nullptr) return {}; - return all_copies.getValue()[result] - .template cast().getValue(); + return llvm::cast(all_copies.getValue()[result]).getValue(); }]>, InterfaceMethod< "Indicates if the operation has any copy set in its `copies` attribute`", @@ -513,7 +512,7 @@ def SairValueProducerOp : OpInterface<"ValueProducerOp"> { auto all_copies = $_op.getCopiesAttr(); if (all_copies == nullptr) return false; return llvm::any_of(all_copies.getValue(), [](mlir::Attribute attr) { - return !attr.cast().empty(); + return !llvm::cast(attr).empty(); }); }]>, InterfaceMethod< @@ -521,7 +520,7 @@ def SairValueProducerOp : OpInterface<"ValueProducerOp"> { "void", "SetCopy", (ins "int":$result, "int":$copy, "DecisionsAttr":$decisions), [{}], [{ auto all_copies = llvm::to_vector<4>(*$_op.getCopies()); - auto result_copies_attr = all_copies[result].template cast(); + auto result_copies_attr = llvm::cast(all_copies[result]); auto result_copies = llvm::to_vector<4>(result_copies_attr.getValue()); result_copies[copy] = decisions; @@ -582,10 +581,8 @@ def SairFromToMemRefOp : OpInterface<"FromToMemRefOp"> { InterfaceMethod<"Buffer name", "llvm::StringRef", "getBufferName">, InterfaceMethod<"Memref type", "mlir::MemRefType", "MemRefType", (ins), [{}], [{ - return $_op.MemRef() - .GetType() - .ElementType() - .template cast(); + return llvm::cast( + $_op.MemRef().GetType().ElementType()); }]>, InterfaceMethod<"Mapping from value domain to layout", "MappingAttr", "Layout", (ins), [{}], [{ diff --git a/sair_dialect.cc b/sair_dialect.cc index dd6ec06..a275499 100644 --- a/sair_dialect.cc +++ b/sair_dialect.cc @@ -286,9 +286,9 @@ namespace { // Accepts a ray stream so that it can be used from different flavors of // printers. void PrintMappingExpr(MappingExpr expr, llvm::raw_ostream &os) { - if (expr.isa()) { + if (llvm::isa(expr)) { os << MappingNoneExpr::kAttrName; - } else if (expr.isa()) { + } else if (llvm::isa(expr)) { os << MappingUnknownExpr::kAttrName; } else if (auto dim_expr = llvm::dyn_cast(expr)) { os << "d" << dim_expr.dimension(); @@ -325,7 +325,7 @@ void PrintDomainShapeDim(const DomainShapeDim &dimension, mlir::DialectAsmPrinter &os) { if (auto static_range = llvm::dyn_cast(dimension.type())) { Print(static_range, os); - } else if (dimension.type().isa()) { + } else if (llvm::isa(dimension.type())) { os << DynRangeType::Name(); } else { llvm_unreachable("unsupported dimension type"); diff --git a/sair_op_interfaces.cc b/sair_op_interfaces.cc index ac7f377..16a9bc1 100644 --- a/sair_op_interfaces.cc +++ b/sair_op_interfaces.cc @@ -192,7 +192,7 @@ static mlir::LogicalResult VerifyInstancesAttr(SairOp op) { for (auto en : llvm::enumerate(decisions.operands().getValue())) { mlir::Attribute operand_instance = en.value(); - if (operand_instance.isa()) continue; + if (llvm::isa(operand_instance)) continue; if (auto copy = llvm::dyn_cast(operand_instance)) { Value operand = op->getOperand(en.index()); auto defining_op = operand.getDefiningOp(); @@ -370,7 +370,7 @@ mlir::LogicalResult VerifyValueProducerOp(mlir::Operation *operation) { return op.emitError() << "cannot specify 'operands' in 'copies'"; } if (decisions.copy_of() == nullptr || - decisions.copy_of().isa()) { + llvm::isa(decisions.copy_of())) { continue; } if (auto copy = llvm::dyn_cast(decisions.copy_of())) { @@ -597,7 +597,7 @@ void ComputeOpInstance::SetLoopNest(mlir::ArrayAttr loop_nest) { BufferAttr ComputeOpInstance::Storage(int result) const { DecisionsAttr decisions = GetDecisions(); if (decisions.storage() == nullptr || - decisions.storage()[result].isa()) { + llvm::isa(decisions.storage()[result])) { return nullptr; } return llvm::cast(decisions.storage()[result]); diff --git a/sair_ops.cc b/sair_ops.cc index 02fc68e..15c7632 100644 --- a/sair_ops.cc +++ b/sair_ops.cc @@ -802,7 +802,7 @@ void PrintProjectionOp(Op op, OpAsmPrinter &printer) { op->getAttrs(), {SairFromMemRefOp::getOperandSegmentSizeAttr(), SairDialect::kShapeAttrName, SairOp::kMappingAttrName}); printer << " : " << op.getShape() << ", " - << op.getResult().getType().template cast().ElementType(); + << llvm::cast(op.getResult().getType()).ElementType(); } } // namespace @@ -906,7 +906,7 @@ static mlir::LogicalResult VerifyFromToMemRef(mlir::Operation *op, mlir::Value memref, mlir::Value value) { auto memref_type = llvm::cast( - memref.getType().cast().ElementType()); + llvm::cast(memref.getType()).ElementType()); auto value_type = llvm::cast(value.getType()); if (memref_type.getElementType() != value_type.ElementType()) { return op->emitError() diff --git a/sair_ops.td b/sair_ops.td index b87e687..0be7786 100644 --- a/sair_ops.td +++ b/sair_ops.td @@ -94,9 +94,9 @@ def SairStaticRangeOp : SairOp<"static_range", [Pure, SairRangeOp]> { DerivedAttr shape = SairEmptyDomainShapeAttr; let extraClassDeclaration = [{ - int Step() { return getType().cast().getStep(); } + int Step() { return llvm::cast(getType()).getStep(); } - int Size() { return getType().cast().size(); } + int Size() { return llvm::cast(getType()).size(); } ValueOrConstant LowerBound() { auto type = mlir::IndexType::get(getContext()); @@ -304,7 +304,7 @@ def SairLoadFromMemRefOp : SairOp<"load_from_memref", [ ValueOperand MemRef() { return ValueOperands()[0]; } mlir::MemRefType MemRefType() { - return MemRef().GetType().ElementType().cast(); + return llvm::cast(MemRef().GetType().ElementType()); } }]; @@ -411,10 +411,7 @@ def SairStoreToMemRefOp : SairOp<"store_to_memref", [ ValueOperand Value() { return ValueOperands()[1]; } mlir::MemRefType MemRefType() { - return MemRef() - .GetType() - .ElementType() - .cast(); + return llvm::cast(MemRef().GetType().ElementType()); } }]; } @@ -858,7 +855,8 @@ def SairAllocOp : SairOp<"alloc", [ let extraClassDeclaration = [{ MemRefType MemType() { - return getType().cast().ElementType().cast(); + return llvm::cast( + llvm::cast(getType()).ElementType()); } }]; } diff --git a/storage.cc b/storage.cc index 944dfb2..dbbc8d3 100644 --- a/storage.cc +++ b/storage.cc @@ -86,7 +86,7 @@ mlir::LogicalResult VerifyStorageAttrWellFormed( llvm::DenseSet buffer_names; for (auto [attr, type] : llvm::zip(storage, result_types)) { - if (attr.isa()) continue; + if (llvm::isa(attr)) continue; BufferAttr buffer = llvm::dyn_cast(attr); if (buffer == nullptr) { return mlir::emitError(loc) @@ -101,7 +101,7 @@ mlir::LogicalResult VerifyStorageAttrWellFormed( auto element_type = llvm::cast(type).ElementType(); if (buffer.space() == sair_dialect->memory_attr() && - element_type.isa()) { + llvm::isa(element_type)) { return mlir::emitError(loc) << "index and memref variables cannot be allocated in memory"; } @@ -192,7 +192,7 @@ static mlir::LogicalResult UnifyBufferShape( constraints)); DomainShapeAttr shape = op.GetShape(); for (int i = 0, e = op.domain_size(); i < e; ++i) { - if (!constraints[i].isa()) continue; + if (!llvm::isa(constraints[i])) continue; auto renaming = MappingAttr::get(context, domain.size(), constraints); auto mapping = shape.Dimension(i).dependency_mapping(); constraints[i] = MappingDimExpr::get(domain.size(), context); diff --git a/transforms/default_lowering_attributes.cc b/transforms/default_lowering_attributes.cc index 90239fb..6426282 100644 --- a/transforms/default_lowering_attributes.cc +++ b/transforms/default_lowering_attributes.cc @@ -236,7 +236,7 @@ static mlir::LogicalResult CreateBufferIfNeeded( if (FitsInRegisters(operand, iteration_spaces)) return mlir::success(); mlir::Type element_type = llvm::cast(value->GetType()).ElementType(); - if (element_type.isa()) { + if (llvm::isa(element_type)) { return value->defining_op().EmitError() << "cannot generate default storage for multi-dimensional index " "values"; @@ -301,7 +301,7 @@ class DefaultStorage : public impl::DefaultStoragePassBase { // Assign all remaining values to register and intialize layout fields. program.WalkOpInstances([&](const OpInstance &op) { for (ResultInstance value : op.Results()) { - if (!value.GetType().isa()) continue; + if (!llvm::isa(value.GetType())) continue; InitializeStorage(value, fusion_analysis, iteration_spaces, storage_analysis); } @@ -326,7 +326,7 @@ class DefaultStorage : public impl::DefaultStoragePassBase { // the layout set for the new dimensions and other places will be unknown. program.WalkOpInstances([&](const OpInstance &op) { for (ResultInstance value : op.Results()) { - if (!value.GetType().isa()) continue; + if (!llvm::isa(value.GetType())) continue; MakeLayoutFullySpecified(value, fusion_analysis, iteration_spaces, storage_analysis); } diff --git a/transforms/introduce_loops.cc b/transforms/introduce_loops.cc index 921a315..46157a9 100644 --- a/transforms/introduce_loops.cc +++ b/transforms/introduce_loops.cc @@ -282,7 +282,7 @@ mlir::LogicalResult RegisterOperations( for (mlir::Attribute attr : op.Loops()) { LoopAttr loop = llvm::cast(attr); - if (!loop.iter().isa()) { + if (!llvm::isa(loop.iter())) { return map_op.emitError() << "loop must not rematerialize or be strip-mined"; } @@ -699,7 +699,7 @@ void Fuse(SairMapOp first_op, llvm::ArrayRef first_loop_nest, MappingExpr first_iter = llvm::cast(first_attr).iter(); int first_dimension = llvm::cast(first_iter).dimension(); int second_dimension = - llvm::cast(second_attr.cast().iter()) + llvm::cast(llvm::cast(second_attr).iter()) .dimension(); first_to_second_mapping[second_dimension] = first_iter; second_block_args[second_dimension] = diff --git a/transforms/materialize_instances.cc b/transforms/materialize_instances.cc index 2c3694b..90c268a 100644 --- a/transforms/materialize_instances.cc +++ b/transforms/materialize_instances.cc @@ -41,7 +41,8 @@ std::optional FindCopiedInstance( llvm::ArrayRef result_copies, unsigned position, mlir::Location location) { auto decisions = llvm::cast(result_copies[position]); - if (decisions.copy_of() == nullptr || decisions.copy_of().isa()) { + if (decisions.copy_of() == nullptr || + llvm::isa(decisions.copy_of())) { mlir::emitError(location) << "expected the source of copy to be specified"; return std::nullopt; } @@ -179,7 +180,7 @@ mlir::LogicalResult CreateInstancesAndCopies(Operation *container) { for (int i = 0, e = op->getNumOperands(); i < e; ++i) { mlir::Value value = op->getOperand(i); mlir::Attribute key_attr = operand_attrs[i]; - if (key_attr.isa()) { + if (llvm::isa(key_attr)) { return op->emitError() << "expceted concerete instance or copy as operand #" << i; }