Index: mlir/include/mlir/Interfaces/CallInterfaces.td =================================================================== --- mlir/include/mlir/Interfaces/CallInterfaces.td +++ mlir/include/mlir/Interfaces/CallInterfaces.td @@ -38,13 +38,13 @@ SSA value. If the reference is an SSA value, the SSA value corresponds to a region of a lambda-like operation. }], - "CallInterfaceCallable", "getCallableForCallee" + "::mlir::CallInterfaceCallable", "getCallableForCallee" >, InterfaceMethod<[{ Returns the operands within this call that are used as arguments to the callee. }], - "Operation::operand_range", "getArgOperands" + "::mlir::Operation::operand_range", "getArgOperands" >, ]; @@ -76,13 +76,13 @@ return null in the case of an external callable object, e.g. an external function. }], - "Region *", "getCallableRegion" + "::mlir::Region *", "getCallableRegion" >, InterfaceMethod<[{ Returns the results types that the callable region produces when executed. }], - "ArrayRef", "getCallableResults" + "::mlir::ArrayRef", "getCallableResults" >, ]; } Index: mlir/include/mlir/Interfaces/CastInterfaces.td =================================================================== --- mlir/include/mlir/Interfaces/CastInterfaces.td +++ mlir/include/mlir/Interfaces/CastInterfaces.td @@ -32,7 +32,7 @@ to cast using this cast operation. }], "bool", "areCastCompatible", - (ins "mlir::TypeRange":$inputs, "mlir::TypeRange":$outputs) + (ins "::mlir::TypeRange":$inputs, "::mlir::TypeRange":$outputs) >, ]; Index: mlir/include/mlir/Interfaces/ControlFlowInterfaces.td =================================================================== --- mlir/include/mlir/Interfaces/ControlFlowInterfaces.td +++ mlir/include/mlir/Interfaces/ControlFlowInterfaces.td @@ -34,7 +34,7 @@ successor are non-materialized values, i.e. they are internal to the operation. }], - "Optional", "getMutableSuccessorOperands", + "::mlir::Optional<::mlir::MutableOperandRange>", "getMutableSuccessorOperands", (ins "unsigned":$index) >, InterfaceMethod<[{ @@ -43,11 +43,11 @@ successor are non-materialized values, i.e. they are internal to the operation. }], - "Optional", "getSuccessorOperands", + "::mlir::Optional<::mlir::OperandRange>", "getSuccessorOperands", (ins "unsigned":$index), [{}], [{ ConcreteOp *op = static_cast(this); auto operands = op->getMutableSuccessorOperands(index); - return operands ? Optional(*operands) : llvm::None; + return operands ? ::mlir::Optional<::mlir::OperandRange>(*operands) : ::llvm::None; }] >, InterfaceMethod<[{ @@ -55,36 +55,36 @@ some successor, or None if `operandIndex` isn't a successor operand index. }], - "Optional", "getSuccessorBlockArgument", + "::mlir::Optional<::mlir::BlockArgument>", "getSuccessorBlockArgument", (ins "unsigned":$operandIndex), [{ - Operation *opaqueOp = $_op; + ::mlir::Operation *opaqueOp = $_op; for (unsigned i = 0, e = opaqueOp->getNumSuccessors(); i != e; ++i) { - if (Optional arg = detail::getBranchSuccessorArgument( + if (::llvm::Optional arg = ::mlir::detail::getBranchSuccessorArgument( $_op.getSuccessorOperands(i), operandIndex, opaqueOp->getSuccessor(i))) return arg; } - return llvm::None; + return ::llvm::None; }] >, InterfaceMethod<[{ Returns the successor that would be chosen with the given constant operands. Returns nullptr if a single successor could not be chosen. }], - "Block *", "getSuccessorForOperands", - (ins "ArrayRef":$operands), [{}], + "::mlir::Block *", "getSuccessorForOperands", + (ins "::mlir::ArrayRef<::mlir::Attribute>":$operands), [{}], /*defaultImplementation=*/[{ return nullptr; }] > ]; let verify = [{ - auto concreteOp = cast($_op); + auto concreteOp = ::mlir::cast($_op); for (unsigned i = 0, e = $_op->getNumSuccessors(); i != e; ++i) { - Optional operands = concreteOp.getSuccessorOperands(i); - if (failed(detail::verifyBranchSuccessorOperands($_op, i, operands))) - return failure(); + ::mlir::Optional operands = concreteOp.getSuccessorOperands(i); + if (::mlir::failed(::mlir::detail::verifyBranchSuccessorOperands($_op, i, operands))) + return ::mlir::failure(); } - return success(); + return ::mlir::success(); }]; } @@ -107,10 +107,10 @@ operation by `getSuccessorRegions`. These operands should correspond 1-1 with the successor inputs specified in `getSuccessorRegions`. }], - "OperandRange", "getSuccessorEntryOperands", + "::mlir::OperandRange", "getSuccessorEntryOperands", (ins "unsigned":$index), [{}], /*defaultImplementation=*/[{ auto operandEnd = this->getOperation()->operand_end(); - return OperandRange(operandEnd, operandEnd); + return ::mlir::OperandRange(operandEnd, operandEnd); }] >, InterfaceMethod<[{ @@ -128,8 +128,8 @@ successor region must be non-empty. }], "void", "getSuccessorRegions", - (ins "Optional":$index, "ArrayRef":$operands, - "SmallVectorImpl &":$regions) + (ins "::mlir::Optional":$index, "::mlir::ArrayRef":$operands, + "::mlir::SmallVectorImpl<::mlir::RegionSuccessor> &":$regions) >, InterfaceMethod<[{ Populates countPerRegion with the number of times this operation will @@ -143,8 +143,8 @@ operand is not a constant. }], "void", "getNumRegionInvocations", - (ins "ArrayRef":$operands, - "SmallVectorImpl &":$countPerRegion), [{}], + (ins "::mlir::ArrayRef<::mlir::Attribute>":$operands, + "::mlir::SmallVectorImpl &":$countPerRegion), [{}], /*defaultImplementation=*/[{ unsigned numRegions = this->getOperation()->getNumRegions(); assert(countPerRegion.empty()); Index: mlir/include/mlir/Interfaces/DataLayoutInterfaces.td =================================================================== --- mlir/include/mlir/Interfaces/DataLayoutInterfaces.td +++ mlir/include/mlir/Interfaces/DataLayoutInterfaces.td @@ -98,7 +98,7 @@ "innermost (newest). Returns null on failure.", /*retTy=*/"::mlir::DataLayoutSpecInterface", /*methodName=*/"combineWith", - /*args=*/(ins "::llvm::ArrayRef":$specs) + /*args=*/(ins "::llvm::ArrayRef<::mlir::DataLayoutSpecInterface>":$specs) >, InterfaceMethod< /*description=*/"Returns the list of layout entries.", Index: mlir/include/mlir/Interfaces/DerivedAttributeOpInterface.td =================================================================== --- mlir/include/mlir/Interfaces/DerivedAttributeOpInterface.td +++ mlir/include/mlir/Interfaces/DerivedAttributeOpInterface.td @@ -30,14 +30,14 @@ /*desc=*/"Returns whether name corresponds to a derived attribute.", /*retTy=*/"bool", /*methodName=*/"isDerivedAttribute", - /*args=*/(ins "StringRef":$name) + /*args=*/(ins "::mlir::StringRef":$name) >, InterfaceMethod< /*desc=*/[{ Materializes the derived attributes. Returns null attribute where unable to materialize a derived attribute as attribute. }], - /*retTy=*/"DictionaryAttr", + /*retTy=*/"::mlir::DictionaryAttr", /*methodName=*/"materializeDerivedAttributes" >, ]; Index: mlir/include/mlir/Interfaces/SideEffectInterfaceBase.td =================================================================== --- mlir/include/mlir/Interfaces/SideEffectInterfaceBase.td +++ mlir/include/mlir/Interfaces/SideEffectInterfaceBase.td @@ -52,7 +52,7 @@ Collects all of the operation's effects into `effects`. }], "void", "getEffects", - (ins "SmallVectorImpl<::mlir::SideEffects::EffectInstance<" + (ins "::mlir::SmallVectorImpl<::mlir::SideEffects::EffectInstance<" # baseEffect # ">> &":$effects) >, ]; Index: mlir/include/mlir/Interfaces/VectorInterfaces.td =================================================================== --- mlir/include/mlir/Interfaces/VectorInterfaces.td +++ mlir/include/mlir/Interfaces/VectorInterfaces.td @@ -28,17 +28,17 @@ `targetShape`. Return `None` if the op cannot be unrolled to the target vector shape. }], - /*retTy=*/"Optional>", + /*retTy=*/"::mlir::Optional<::mlir::SmallVector>", /*methodName=*/"getShapeForUnroll", /*args=*/(ins), /*methodBody=*/"", /*defaultImplementation=*/[{ assert($_op->getNumResults() == 1); auto vt = $_op.getResult().getType(). - template dyn_cast(); + template dyn_cast<::mlir::VectorType>(); if (!vt) - return None; - SmallVector res(vt.getShape().begin(), vt.getShape().end()); + return ::mlir::None; + ::mlir::SmallVector res(vt.getShape().begin(), vt.getShape().end()); return res; }] >, @@ -54,7 +54,7 @@ let methods = [ StaticInterfaceMethod< /*desc=*/"Return the `in_bounds` attribute name.", - /*retTy=*/"StringRef", + /*retTy=*/"::mlir::StringRef", /*methodName=*/"getInBoundsAttrName", /*args=*/(ins), /*methodBody=*/"", @@ -62,7 +62,7 @@ >, StaticInterfaceMethod< /*desc=*/"Return the `permutation_map` attribute name.", - /*retTy=*/"StringRef", + /*retTy=*/"::mlir::StringRef", /*methodName=*/"getPermutationMapAttrName", /*args=*/(ins), /*methodBody=*/"", @@ -78,13 +78,13 @@ /*defaultImplementation=*/[{ return $_op.isBroadcastDim(dim) || ($_op.in_bounds() - && $_op.in_bounds()->template cast()[dim] - .template cast().getValue()); + && $_op.in_bounds()->template cast<::mlir::ArrayAttr>()[dim] + .template cast<::mlir::BoolAttr>().getValue()); }] >, InterfaceMethod< /*desc=*/"Return the memref or ranked tensor operand.", - /*retTy=*/"Value", + /*retTy=*/"::mlir::Value", /*methodName=*/"source", /*args=*/(ins), /*methodBody=*/"return $_op.source();" @@ -92,7 +92,7 @@ >, InterfaceMethod< /*desc=*/"Return the vector operand or result.", - /*retTy=*/"Value", + /*retTy=*/"::mlir::Value", /*methodName=*/"vector", /*args=*/(ins), /*methodBody=*/"return $_op.vector();" @@ -100,7 +100,7 @@ >, InterfaceMethod< /*desc=*/"Return the indices operands.", - /*retTy=*/"ValueRange", + /*retTy=*/"::mlir::ValueRange", /*methodName=*/"indices", /*args=*/(ins), /*methodBody=*/"return $_op.indices();" @@ -108,7 +108,7 @@ >, InterfaceMethod< /*desc=*/"Return the permutation map.", - /*retTy=*/"AffineMap", + /*retTy=*/"::mlir::AffineMap", /*methodName=*/"permutation_map", /*args=*/(ins), /*methodBody=*/"return $_op.permutation_map();" @@ -122,8 +122,8 @@ /*methodBody=*/"", /*defaultImplementation=*/[{ auto expr = $_op.permutation_map().getResult(idx); - return expr.template isa() && - expr.template dyn_cast().getValue() == 0; + return expr.template isa<::mlir::AffineConstantExpr>() && + expr.template dyn_cast<::mlir::AffineConstantExpr>().getValue() == 0; }] >, InterfaceMethod< @@ -143,7 +143,7 @@ >, InterfaceMethod< /*desc=*/"Return the `in_bounds` boolean ArrayAttr.", - /*retTy=*/"Optional", + /*retTy=*/"::mlir::Optional<::mlir::ArrayAttr>", /*methodName=*/"in_bounds", /*args=*/(ins), /*methodBody=*/"return $_op.in_bounds();" @@ -151,34 +151,34 @@ >, InterfaceMethod< /*desc=*/"Return the ShapedType.", - /*retTy=*/"ShapedType", + /*retTy=*/"::mlir::ShapedType", /*methodName=*/"getShapedType", /*args=*/(ins), /*methodBody=*/"", /*defaultImplementation=*/ - "return $_op.source().getType().template cast();" + "return $_op.source().getType().template cast<::mlir::ShapedType>();" >, InterfaceMethod< /*desc=*/"Return the VectorType.", - /*retTy=*/"VectorType", + /*retTy=*/"::mlir::VectorType", /*methodName=*/"getVectorType", /*args=*/(ins), /*methodBody=*/"", /*defaultImplementation=*/[{ - return $_op.vector().getType().template dyn_cast(); + return $_op.vector().getType().template dyn_cast<::mlir::VectorType>(); }] >, InterfaceMethod< /*desc=*/"Return the mask type if the op has a mask.", - /*retTy=*/"VectorType", + /*retTy=*/"::mlir::VectorType", /*methodName=*/"getMaskType", /*args=*/(ins), /*methodBody=*/"", /*defaultImplementation=*/[{ return $_op.mask() - ? mlir::vector::detail::transferMaskType( + ? ::mlir::vector::detail::transferMaskType( $_op.getVectorType(), $_op.permutation_map()) - : VectorType(); + : ::mlir::VectorType(); }] >, InterfaceMethod< @@ -232,7 +232,7 @@ }], /*retTy=*/"void", /*methodName=*/"zipResultAndIndexing", - /*args=*/(ins "llvm::function_ref":$fun), + /*args=*/(ins "::llvm::function_ref":$fun), /*methodBody=*/"", /*defaultImplementation=*/[{ for (int64_t resultIdx = 0,