diff --git a/experimental/iterators/include/iterators/Conversion/Passes.td b/experimental/iterators/include/iterators/Conversion/Passes.td index 426acfe4c8b6..cdc4f60d1f33 100644 --- a/experimental/iterators/include/iterators/Conversion/Passes.td +++ b/experimental/iterators/include/iterators/Conversion/Passes.td @@ -82,6 +82,10 @@ def ConvertStatesToLLVM : Pass<"convert-states-to-llvm", "ModuleOp"> { // TabularToLLVM //===----------------------------------------------------------------------===// +// TODO(ingomueller): This pass should probably not exist. Instead, tabular +// views should be lowered into its constituant components, +// which could be tensors, in order to compose better with +// other dialects and passes. def ConvertTabularToLLVM : Pass<"convert-tabular-to-llvm", "ModuleOp"> { let summary = "Convert the tabular dialect to the LLVM dialect"; let description = [{ diff --git a/experimental/iterators/include/iterators/Dialect/Iterators/IR/IteratorsOps.td b/experimental/iterators/include/iterators/Dialect/Iterators/IR/IteratorsOps.td index 3cce9e528483..a03413386650 100644 --- a/experimental/iterators/include/iterators/Dialect/Iterators/IR/IteratorsOps.td +++ b/experimental/iterators/include/iterators/Dialect/Iterators/IR/IteratorsOps.td @@ -328,7 +328,12 @@ def Iterators_TabularViewToStreamOp : Iterators_Op<"tabular_view_to_stream", " .cast().getBody())">, DeclareOpInterfaceMethods]> { // TODO(ingomueller): Get rid of the LLVM dependency after designing a row - // type or similar. + // type or similar. Apart from tying the lowering to LLVM, + // which probably limits the applicability of higher-level + // passes on the components of a tabular view, the + // LLVM-based design also inherits the limitations of the + // LLVM type system, such as the missing support for signed + // and unsigned integer types. let summary = "Extracts the tuples from a tabular view as LLVM structs"; let description = [{ Produces a stream of LLVM structs from a given `tabular_view` (i.e., "scans" diff --git a/experimental/iterators/include/iterators/Dialect/Tabular/IR/TabularDialect.td b/experimental/iterators/include/iterators/Dialect/Tabular/IR/TabularDialect.td index 8e9d3e7c1572..6abb804c537f 100644 --- a/experimental/iterators/include/iterators/Dialect/Tabular/IR/TabularDialect.td +++ b/experimental/iterators/include/iterators/Dialect/Tabular/IR/TabularDialect.td @@ -15,6 +15,18 @@ include "mlir/IR/OpBase.td" // Dialect definition //===----------------------------------------------------------------------===// +// TODO(ingomueller): This dialect should probably not be lowered to LLVM +// directly. I think it would be a better design to treat +// tabular views (potentially with a different name) as a +// bundle of several tensors, which we can access (and maybe +// update) one at a time. It is then up to the consumer to +// extract rows or batches of rows from the tensors, for +// which they can use the usual means. The default lowering +// would then simple decompose the tabular view into its +// constituant tensors, which would not affect the accesses +// to rows or row batches. After that decomposition, normal +// bufferization can run without knowing the tabular +// provenance of the tensors. def Tabular_Dialect : Dialect { let name = "tabular"; let cppNamespace = "::mlir::iterators"; diff --git a/experimental/iterators/include/iterators/Dialect/Tabular/IR/TabularOps.td b/experimental/iterators/include/iterators/Dialect/Tabular/IR/TabularOps.td index 2849c1da2885..f48d5a066099 100644 --- a/experimental/iterators/include/iterators/Dialect/Tabular/IR/TabularOps.td +++ b/experimental/iterators/include/iterators/Dialect/Tabular/IR/TabularOps.td @@ -34,6 +34,10 @@ class MemRefTypeWithIdentityLayoutAndRankOf allowedTypes, def Tabular_ViewAsTabularOp : Tabular_Op<"view_as_tabular", [DeclareOpInterfaceMethods]> { + // TODO(ingomueller): We should consider allowing tensors as operands, or even + // make that the only possibility. This would allow to keep + // the highest level of abstraction, in particular, if we + // do not lower to LLVM directly. let summary = "Creates a `tabular_view` from the given memrefs"; let description = [{ Converts a variadic number of memrefs of rank 1 into the columns of a @@ -70,4 +74,8 @@ def Tabular_ViewAsTabularOp : Tabular_Op<"view_as_tabular", }]; } +// TODO(ingomueller): It may make sense to add accessors for individual columns, +// i.e., an ExtractColumnOp or similar, which would return a +// single column of the tabular view, possibly a tensor. + #endif // TABULAR_DIALECT_TABULAR_IR_TABULAROPS