that will eventually be executed on AMD hardware.
}];
- let emitAccessorPrefix = kEmitAccessorPrefix_Both;
+ let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
}
//===----------------------------------------------------------------------===//
https://software.intel.com/content/www/us/en/develop/articles/intel-sdm.html
}];
- let emitAccessorPrefix = kEmitAccessorPrefix_Both;
+ let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
}
//===----------------------------------------------------------------------===//
let hasConstantMaterializer = 1;
let dependentDialects = ["arith::ArithmeticDialect"];
- let emitAccessorPrefix = kEmitAccessorPrefix_Both;
+ let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
}
// Base class for Affine dialect ops.
let extraClassDeclaration = [{
/// Returns the affine map to be applied by this operation.
- AffineMap getAffineMap() { return map(); }
+ AffineMap getAffineMap() { return getMap(); }
/// Returns the affine value map computed from this operation.
AffineValueMap getAffineValueMap();
void setConditional(IntegerSet set, ValueRange operands);
/// Returns true if an else block exists.
- bool hasElse() { return !elseRegion().empty(); }
+ bool hasElse() { return !getElseRegion().empty(); }
Block *getThenBlock() {
- assert(!thenRegion().empty() && "Unexpected empty 'then' region.");
- return &thenRegion().front();
+ assert(!getThenRegion().empty() && "Unexpected empty 'then' region.");
+ return &getThenRegion().front();
}
Block *getElseBlock() {
assert(hasElse() && "Empty 'else' region.");
- return &elseRegion().front();
+ return &getElseRegion().front();
}
OpBuilder getThenBodyBuilder() {
- assert(!thenRegion().empty() && "Unexpected empty 'then' region.");
- Block &body = thenRegion().front();
+ assert(!getThenRegion().empty() && "Unexpected empty 'then' region.");
+ Block &body = getThenRegion().front();
return OpBuilder(&body, std::prev(body.end()));
}
OpBuilder getElseBodyBuilder() {
assert(hasElse() && "No 'else' block");
- Block &body = elseRegion().front();
+ Block &body = getElseRegion().front();
return OpBuilder(&body, std::prev(body.end()));
}
}];
let extraClassDeclaration = [{
static StringRef getMapAttrStrName() { return "map"; }
- AffineMap getAffineMap() { return map(); }
+ AffineMap getAffineMap() { return getMap(); }
ValueRange getMapOperands() { return operands(); }
ValueRange getDimOperands() {
return OperandRange{operands().begin(),
- operands().begin() + map().getNumDims()};
+ operands().begin() + getMap().getNumDims()};
}
ValueRange getSymbolOperands() {
- return OperandRange{operands().begin() + map().getNumDims(),
+ return OperandRange{operands().begin() + getMap().getNumDims(),
operands().end()};
}
}];
/// Returns `true` if the loop bounds have min/max expressions.
bool hasMinMaxBounds() {
- return lowerBoundsMap().getNumResults() != getNumDims() ||
- upperBoundsMap().getNumResults() != getNumDims();
+ return getLowerBoundsMap().getNumResults() != getNumDims() ||
+ getUpperBoundsMap().getNumResults() != getNumDims();
}
}];
let extraClassDeclaration = [{
MemRefType getMemRefType() {
- return memref().getType().cast<MemRefType>();
+ return getMemref().getType().cast<MemRefType>();
}
/// Returns the affine map used to index the memref for this operation.
/// Impelements the AffineMapAccessInterface.
/// Returns the AffineMapAttr associated with 'memref'.
NamedAttribute getAffineMapAttrForMemRef(Value mref) {
- assert(mref == memref() &&
+ assert(mref == getMemref() &&
"Expected mref argument to match memref operand");
return {StringAttr::get(getContext(), getMapAttrStrName()),
getAffineMapAttr()};
let extraClassDeclaration = extraClassDeclarationBase # [{
VectorType getVectorType() {
- return result().getType().cast<VectorType>();
+ return getResult().getType().cast<VectorType>();
}
}];
let extraClassDeclaration = extraClassDeclarationBase # [{
VectorType getVectorType() {
- return value().getType().cast<VectorType>();
+ return getValue().getType().cast<VectorType>();
}
}];
// this dialect (such as canonicalization) do not produce entities belonging
// to the LLVMDialect (ops or types).
- let emitAccessorPrefix = kEmitAccessorPrefix_Both;
+ let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
}
//===----------------------------------------------------------------------===//
AllTypesMatch<["a", "res"]>,
PredOpTrait<
"operand `a` should be 1-dimensional",
- CPred<"a().getType().cast<VectorType>().getShape().size() == 1">
+ CPred<"getA().getType().cast<VectorType>().getShape().size() == 1">
>,
PredOpTrait<
"operand `b` should be 2-dimensional",
- CPred<"b().getType().cast<VectorType>().getShape().size() == 2">
+ CPred<"getB().getType().cast<VectorType>().getShape().size() == 2">
>,
PredOpTrait<
"operand `b` should have 4 columns",
- CPred<"b().getType().cast<VectorType>().getShape()[1] == 4">
+ CPred<"getB().getType().cast<VectorType>().getShape()[1] == 4">
>,
PredOpTrait<
"operand `b` should have as many rows as the size of operand `a`",
- CPred<"b().getType().cast<VectorType>().getShape()[0] == a().getType().cast<VectorType>().getShape()[0]">
+ CPred<"getB().getType().cast<VectorType>().getShape()[0] == getA().getType().cast<VectorType>().getShape()[0]">
>,
]
> {
scalable vector operations.
}];
- let emitAccessorPrefix = kEmitAccessorPrefix_Both;
+ let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
}
//===----------------------------------------------------------------------===//
let useDefaultAttributePrinterParser = 1;
- let emitAccessorPrefix = kEmitAccessorPrefix_Both;
+ let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
}
def DLTI_DataLayoutEntryAttr : DialectAttr<
let useDefaultTypePrinterParser = 1;
let useDefaultAttributePrinterParser = 1;
- let emitAccessorPrefix = kEmitAccessorPrefix_Both;
+ let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
}
#endif // MLIR_DIALECT_EMITC_IR_EMITCBASE
let useDefaultAttributePrinterParser = 1;
- let emitAccessorPrefix = kEmitAccessorPrefix_Both;
+ let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
}
//===----------------------------------------------------------------------===//
static StringRef getKernelFuncAttrName() { return "rocdl.kernel"; }
}];
- let emitAccessorPrefix = kEmitAccessorPrefix_Both;
+ let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
}
//===----------------------------------------------------------------------===//
LLVM_Type:$glc,
LLVM_Type:$slc)>{
string llvmBuilder = [{
- auto vdataType = moduleTranslation.convertType(op.vdata().getType());
+ auto vdataType = moduleTranslation.convertType(op.getVdata().getType());
createIntrinsicCall(builder,
llvm::Intrinsic::amdgcn_buffer_store, {$vdata, $rsrc, $vindex,
$offset, $glc, $slc}, {vdataType});
LLVM_Type:$soffset,
LLVM_Type:$aux)>{
string llvmBuilder = [{
- auto vdataType = moduleTranslation.convertType(op.vdata().getType());
+ auto vdataType = moduleTranslation.convertType(op.getVdata().getType());
createIntrinsicCall(builder,
llvm::Intrinsic::amdgcn_raw_buffer_store, {$vdata, $rsrc,
$offset, $soffset, $aux}, {vdataType});
LLVM_Type:$soffset,
LLVM_Type:$aux)>{
string llvmBuilder = [{
- auto vdataType = moduleTranslation.convertType(op.vdata().getType());
+ auto vdataType = moduleTranslation.convertType(op.getVdata().getType());
createIntrinsicCall(builder,
llvm::Intrinsic::amdgcn_raw_buffer_atomic_fadd, {$vdata, $rsrc,
$offset, $soffset, $aux}, {vdataType});
: MemRef_Op<mnemonic, traits> {
code extraBaseClassDeclaration = [{
/// Returns the dynamic sizes for this subview operation if specified.
- ::mlir::Operation::operand_range getDynamicSizes() { return sizes(); }
+ ::mlir::Operation::operand_range getDynamicSizes() { return getSizes(); }
/// Return the list of Range (i.e. offset, size, stride). Each
/// Range entry contains either the dynamic value or a ConstantIndexOp
/// Fold the given CastOp into consumer op.
static bool canFoldIntoConsumerOp(CastOp castOp);
- Value getViewSource() { return source(); }
+ Value getViewSource() { return getSource(); }
}];
let hasFolder = 1;
return getRegion().getArgument(0);
}
MemRefType getMemRefType() {
- return memref().getType().cast<MemRefType>();
+ return getMemref().getType().cast<MemRefType>();
}
}];
let hasCustomAssemblyFormat = 1;
}];
let extraClassDeclaration = [{
- bool isExternal() { return !initial_value(); }
+ bool isExternal() { return !getInitialValue(); }
bool isUninitialized() {
- return !isExternal() && initial_value()->isa<UnitAttr>();
+ return !isExternal() && getInitialValue()->isa<UnitAttr>();
}
/// Returns the constant initial value if the memref.global is a constant,
/// or null otherwise.
let extraClassDeclaration = [{
MemRefType getMemRefType() {
- return memref().getType().cast<MemRefType>();
+ return getMemref().getType().cast<MemRefType>();
}
static StringRef getLocalityHintAttrStrName() { return "localityHint"; }
static StringRef getIsWriteAttrStrName() { return "isWrite"; }
let extraClassDeclaration = extraBaseClassDeclaration # [{
// The result of the op is always a ranked memref.
MemRefType getType() { return getResult().getType().cast<MemRefType>(); }
- Value getViewSource() { return source(); }
+ Value getViewSource() { return getSource(); }
/// Return the rank of the source ShapedType.
unsigned getResultRank() {
let extraClassDeclaration = [{
MemRefType getType() { return getResult().getType().cast<MemRefType>(); }
- Value getViewSource() { return source(); }
+ Value getViewSource() { return getSource(); }
}];
let assemblyFormat = [{
SmallVector<ReassociationIndices, 4> getReassociationIndices() {
SmallVector<ReassociationIndices, 4> reassociationIndices;
- for (auto attr : reassociation())
+ for (auto attr : getReassociation())
reassociationIndices.push_back(llvm::to_vector<2>(
llvm::map_range(attr.cast<ArrayAttr>(), [&](Attribute indexAttr) {
return indexAttr.cast<IntegerAttr>().getInt();
return reassociationIndices;
};
- MemRefType getSrcType() { return src().getType().cast<MemRefType>(); }
+ MemRefType getSrcType() { return getSrc().getType().cast<MemRefType>(); }
- MemRefType getResultType() { return result().getType().cast<MemRefType>(); }
+ MemRefType getResultType() { return getResult().getType().cast<MemRefType>(); }
- Value getViewSource() { return src(); }
+ Value getViewSource() { return getSrc(); }
}];
let assemblyFormat = [{
let extraClassDeclaration = extraBaseClassDeclaration # [{
/// Returns the type of the base memref operand.
MemRefType getSourceType() {
- return source().getType().cast<MemRefType>();
+ return getSource().getType().cast<MemRefType>();
}
/// The result of a subview is always a memref.
let extraClassDeclaration = [{
static StringRef getPermutationAttrStrName() { return "permutation"; }
- ShapedType getShapedType() { return in().getType().cast<ShapedType>(); }
+ ShapedType getShapedType() { return getIn().getType().cast<ShapedType>(); }
}];
let hasCustomAssemblyFormat = 1;
/// Region *region)
/// ```
operand_range getDynamicSizes() {
- return {sizes().begin(), sizes().end()};
+ return {getSizes().begin(), getSizes().end()};
}
}];
let extraClassDeclaration = [{
MemRefType getMemRefType() {
- return memref().getType().cast<MemRefType>();
+ return getMemref().getType().cast<MemRefType>();
}
}];
let hasFolder = 1;
let useDefaultTypePrinterParser = 1;
- let emitAccessorPrefix = kEmitAccessorPrefix_Both;
+ let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
}
/// Device-side synchronization token.
let useDefaultTypePrinterParser = 1;
- let emitAccessorPrefix = kEmitAccessorPrefix_Both;
+ let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
}
//===----------------------------------------------------------------------===//
let useDefaultAttributePrinterParser = 1;
- let emitAccessorPrefix = kEmitAccessorPrefix_Both;
+ let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
}
#endif // SPARSETENSOR_BASE
"complex::ComplexDialect",
];
+ // TODO: flip post changing ViewLike interface.
let emitAccessorPrefix = kEmitAccessorPrefix_Both;
}
let name = "x86vector";
let cppNamespace = "::mlir::x86vector";
- let emitAccessorPrefix = kEmitAccessorPrefix_Both;
+ let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed;
}
//===----------------------------------------------------------------------===//
}
LogicalResult ReduceOp::verify() {
- Type inputType = x().getType();
+ Type inputType = getX().getType();
LogicalResult regionResult = success();
// Check correct number of block arguments and return type.
- Region &formula = region();
+ Region &formula = getRegion();
if (!formula.empty()) {
regionResult = verifyNumBlockArgs(
this, formula, "reduce", TypeRange{inputType, inputType}, inputType);