Skip to content

Commit

Permalink
[mlir] Flip to prefixed accessors (NFC)
Browse files Browse the repository at this point in the history
Missed these in td files.
  • Loading branch information
jpienaar committed Aug 7, 2022
1 parent ea540bc commit 7602e28
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
Expand Up @@ -309,7 +309,7 @@ def LinalgStructuredInterface : OpInterface<"LinalgOp"> {
/*args=*/(ins),
/*methodBody=*/"",
/*defaultImplementation=*/[{
return $_op.inputs().size();
return $_op.getInputs().size();
}]
>,
// `outputs` must be defined by each op that wants to implement the
Expand Down
8 changes: 4 additions & 4 deletions mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td
Expand Up @@ -64,15 +64,15 @@ def Linalg_InitTensorOp : Linalg_Op<"init_tensor",

// Return true if the size of the tensor is dynamic at `idx`
bool isDynamicSize(unsigned idx) {
APInt v = *(static_sizes().getAsValueRange<IntegerAttr>().begin() + idx);
APInt v = *(getStaticSizes().getAsValueRange<IntegerAttr>().begin() + idx);
return ShapedType::isDynamic(v.getSExtValue());
}

// Assert that the size of the result tensor is static at `idx`
// and return the shape.
int64_t getStaticSize(unsigned idx) {
assert(!isDynamicSize(idx) && "expected static size");
APInt v = *(static_sizes().
APInt v = *(getStaticSizes().
template getAsValueRange<IntegerAttr>().begin() + idx);
return v.getSExtValue();
}
Expand All @@ -83,8 +83,8 @@ def Linalg_InitTensorOp : Linalg_Op<"init_tensor",
unsigned getIndexOfDynamicSize(unsigned idx) {
assert(isDynamicSize(idx) && "expected dynamic size");
return std::count_if(
static_sizes().getValue().begin(),
static_sizes().getValue().begin() + idx,
getStaticSizes().getValue().begin(),
getStaticSizes().getValue().begin() + idx,
[&](Attribute attr) {
return ShapedType::isDynamic(attr.cast<IntegerAttr>().getInt());
});
Expand Down
4 changes: 2 additions & 2 deletions mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td
Expand Up @@ -202,8 +202,8 @@ def GenericOp : LinalgStructuredBase_Op<"generic", [AttrSizedOperandSegments]> {
};
}
std::string getLibraryCallName() {
return library_call() ?
library_call()->str() : "op_has_no_registered_library_name";
return getLibraryCall() ?
getLibraryCall()->str() : "op_has_no_registered_library_name";
}

static std::function<void(ImplicitLocOpBuilder &,
Expand Down

0 comments on commit 7602e28

Please sign in to comment.