| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The toy language uses element-wise multiplication. Transposing and multiplying
two tensors with shape <2, 3> gives a tensor with shape <3, 2>.
Closes tensorflow/mlir#227
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/227 from ombre5733:toy-ch1-docu-fix d79e5d3f9e3d5150a7ac8aac28b899df5a0d10a0
PiperOrigin-RevId: 281221671
|
| |
| |
| |
| |
| |
| |
| |
| | |
Iterates each element to build the array. This includes a little refactor to
combine bool/int/float into a function, since they are similar. The only
difference is calling different function in the end.
PiperOrigin-RevId: 281210288
|
| |
| |
| |
| |
| |
| | |
Closes tensorflow/mlir#247
PiperOrigin-RevId: 281185661
|
| |
| |
| |
| | |
PiperOrigin-RevId: 281169885
|
| |
| |
| |
| |
| |
| |
| | |
Closes tensorflow/mlir#243
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/243 from bondhugula:patch-2 fb682996efde001189414a4c7aa59ce42ace7831
PiperOrigin-RevId: 281167834
|
| |
| |
| |
| |
| |
| | |
Adds unit tests for subview offset and stride argument constant folding.
PiperOrigin-RevId: 281161041
|
| |
| |
| |
| |
| |
| | |
The variant that accepts a type will check that the parsed attribute is a valid instance of AttrType. The non-type variant would silently fail in this case, leading to garbage attribute values.
PiperOrigin-RevId: 281136528
|
| |
| |
| |
| | |
PiperOrigin-RevId: 281131561
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Convert chained `spirv::BitcastOp` operations into
one `spirv::BitcastOp` operation.
Closes tensorflow/mlir#238
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/238 from denis0x0D:sandbox/canon_bitcast 4352ed4f81b959ec92f849c599e733b62a99c010
PiperOrigin-RevId: 281129234
|
| |
| |
| |
| | |
PiperOrigin-RevId: 281114034
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The assertion was introduced in the early days of dialect conversion
infrastructure when we had the matching function separate from the rewriting
function. The infrastructure evolved to have a common matchAndRewrite function
and the separate matching function was dropped without chaning the rewriting
that became matchAndRewrite. This has led to assertion being triggered. Return
a matchFailure instead of failing an assertion on unsupported types.
Closes tensorflow/mlir#230
PiperOrigin-RevId: 281113741
|
| |
| |
| |
| |
| |
| | |
This CL utilizies the more robust fusion feasibility analysis being built out in LoopFusionUtils, which will eventually be used to replace the current affine loop fusion pass.
PiperOrigin-RevId: 281112340
|
| |
| |
| |
| |
| |
| | |
This improves consistency and will concretely avoid collisions between VectorExtractElementOp and ExtractElementOp when they are included in the same transforms / rewrites.
PiperOrigin-RevId: 281101588
|
| |
| |
| |
| | |
PiperOrigin-RevId: 281042016
|
| |
| |
| |
| |
| |
| |
| | |
This makes the flags consistent with the naming scheme used elsewhere in the
codebase for dialect conversions.
PiperOrigin-RevId: 281027517
|
| |
| |
| |
| | |
PiperOrigin-RevId: 280888290
|
| |
| |
| |
| |
| |
| | |
This commit fixes several attribute dict syntax errors in the documentation.
PiperOrigin-RevId: 280726269
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This CL added op definitions for a few bit operations:
* OpBitFieldInsert
* OpBitFieldSExtract
* OpBitFieldUExtract
Closes tensorflow/mlir#233
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/233 from denis0x0D:sandbox/bit_field_ops e7fd85b00d72d483d7992dc42b9cc4d673903455
PiperOrigin-RevId: 280691816
|
| |
| |
| |
| |
| |
| |
| | |
Update LangRef to explicitly mention the type canonicalization rule applied to
MemRef types: identity maps do not contribute to type identification.
PiperOrigin-RevId: 280684904
|
| |
| |
| |
| |
| |
| | |
This turns several hand-written functions to auto-generated ones.
PiperOrigin-RevId: 280684326
|
| |
| |
| |
| |
| |
| | |
correctness.
PiperOrigin-RevId: 280678392
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Changes from:
https://github-lightshow.herokuapp.com/?utf8=%E2%9C%93&scope=from-url&grammar_format=auto&grammar_url=https%3A%2F%2Fraw.githubusercontent.com%2Fjpienaar%2Fmlir-grammar%2Fmaster%2Fgrammars%2Fmlir.json&grammar_text=&code_source=from-url&code_url=https%3A%2F%2Fraw.githubusercontent.com%2Fjpienaar%2Fmlir-grammar%2Fmaster%2Fsample.mlir&code=
To:
https://github-lightshow.herokuapp.com/?utf8=%E2%9C%93&scope=from-url&grammar_format=auto&grammar_url=https%3A%2F%2Fraw.githubusercontent.com%2Fjpienaar%2Fmlir-grammar%2Fsimpler%2Fgrammars%2Fmlir.json&grammar_text=&code_source=from-url&code_url=https%3A%2F%2Fraw.githubusercontent.com%2Fjpienaar%2Fmlir-grammar%2Fmaster%2Fsample.mlir&code=
Which I think is an improvement.
PiperOrigin-RevId: 280674770
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Delete unused constexpr ints in LowerToLLVMDialect.
Add (void)toStringRef for non-debug builds.
Fixes tensorflow/mlir#232.
PiperOrigin-RevId: 280671014
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Thus far DRR always invokes the separate-parameter builder (i.e., requiring
a separate parameter for each result-type/operand/attribute) for creating
ops, no matter whether we can auto-generate a builder with type-deduction
ability or not.
This CL changes the path for ops that we can auto-generate type-deduction
builders, i.e., with SameOperandsAndResultType/FirstAttrDerivedResultType
traits. Now they are going through a aggregate-parameter builder (i.e.,
requiring one parameter for all result-types/operands/attributes).
attributes.)
It is expected this approach will be more friendly for future shape inference
function autogen and calling those autogen'd shape inference function without
excessive packing and repacking operand/attribute lists.
Also, it would enable better support for creating ops with optional attributes
because we are not required to provide an Attribute() as placeholder for
an optional attribute anymore.
PiperOrigin-RevId: 280654800
|
| |
| |
| |
| |
| |
| |
| | |
This modification will allow to easily plug lowering of linalg ops to different types of loops (affine, loop.for and other future constructs).
This is purely NFC for now.
PiperOrigin-RevId: 280652186
|
| |
| |
| |
| |
| |
| | |
The same reasoning as for std.subview applies.
PiperOrigin-RevId: 280639308
|
| |
| |
| |
| |
| |
| |
| |
| | |
In essence, std.subview is just an abstract indexing transformation (somewhat
akin to a gep in llvm) and by itself has no effect. From a practical perspective
this helps, as it allows to remove dead subview operations.
PiperOrigin-RevId: 280630046
|
| |
| |
| |
| |
| |
| |
| |
| | |
This comes in the form of:
1. Missing links to next chapters.
2. Table of contents for each page.
PiperOrigin-RevId: 280619053
|
| |
| |
| |
| |
| |
| | |
and op.
PiperOrigin-RevId: 280555742
|
| |
| |
| |
| |
| |
| | |
This is step 1/n in refactoring infrastructure along the Vector dialect to make it ready for retargetability and composable progressive lowering.
PiperOrigin-RevId: 280529784
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Refactoring the conversion from StandardOps/GPU dialect to SPIR-V
dialect:
1) Move the SPIRVTypeConversion and SPIRVOpLowering class into SPIR-V
dialect.
2) Add header files that expose functions to add patterns for the
dialects to SPIR-V lowering, as well as a pass that does the
dialect to SPIR-V lowering.
3) Make SPIRVOpLowering derive from OpLowering class.
PiperOrigin-RevId: 280486871
|
| |
| |
| |
| |
| |
| |
| |
| | |
operands into the subview result memref type.
Changes SubViewOp to support zero operands case, when offset, strides and sizes are all constant.
PiperOrigin-RevId: 280485075
|
| |
| |
| |
| | |
PiperOrigin-RevId: 280470142
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The `Operator` class keeps an `arguments` field, which contains pointers
to `operands` and `attributes` elements. Thus it must be populated after
`operands` and `attributes` are finalized so to have stable pointers.
SmallVector may re-allocate when still having new elements added, which
will invalidate pointers.
PiperOrigin-RevId: 280466896
|
| |
| |
| |
| |
| |
| |
| | |
This is essentially a dialect conversion and conceptually belongs to
conversions.
PiperOrigin-RevId: 280460034
|
| |
| |
| |
| |
| |
| |
| |
| | |
Previous commits removed all uses of LLVMTypeConverter::k*PosInMemRefDescriptor
outside of the MemRefDescriptor class. These numbers are an implementation
detail and can be hidden under a layer of more semantic APIs.
PiperOrigin-RevId: 280442444
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Following up on the consolidation of MemRef descriptor conversion, update
Vector-to-LLVM conversion to use the helper class that abstracts away the
implementation details of the MemRef descriptor. This also makes the types of
the attributes in emitted llvm.insert/extractelement operations consistently
i64 instead of a mix of index and i64.
PiperOrigin-RevId: 280441451
|
| |
| |
| |
| | |
PiperOrigin-RevId: 280431812
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This CL moves VectorOps to Tablegen and cleans up the implementation.
This is almost NFC but 2 changes occur:
1. an interface change occurs in the padding value specification in vector_transfer_read:
the value becomes non-optional. As a shortcut we currently use %f0 for all paddings.
This should become an OpInterface for vectorization in the future.
2. the return type of vector.type_cast is trivial and simplified to `memref<vector<...>>`
Relevant roundtrip and invalid tests that used to sit in core are moved to the vector dialect.
The op documentation is moved to the .td file.
PiperOrigin-RevId: 280430869
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Following up on the consolidation of MemRef descriptor conversion, update
Linalg-to-LLVM conversion to use the helper class that abstracts away the
implementation details of the MemRef descriptor. This required MemRefDescriptor
to become publicly visible. Since this conversion is heavily EDSC-based,
introduce locally an additional wrapper that uses builder and location pointed
to by the EDSC context while emitting descriptor manipulation operations.
PiperOrigin-RevId: 280429228
|
| |
| |
| |
| | |
PiperOrigin-RevId: 280398956
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Memref descriptor is becoming increasingly complex. Memrefs are manipulated by
multiple standard instructions, each of which has a non-trivial lowering to the
LLVM dialect. This leads to verbose code that manipulates the descriptors
exposing the internals of insert/extractelement opreations. Implement a wrapper
class that contains a memref descriptor and provides semantically named methods
that build the primitive IR operations instead.
PiperOrigin-RevId: 280371225
|
| |
| |
| |
| |
| |
| | |
Expand local scope printing to skip printing aliases as aliases are printed out at the top of a module and may not be part of the output generated by local scope print.
PiperOrigin-RevId: 280278617
|
| |
| |
| |
| | |
PiperOrigin-RevId: 280258938
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This CL uses the now standard std.subview in linalg.
Two shortcuts are currently taken to allow this port:
1. the type resulting from a view is currently degraded to fully dynamic to pass the SubViewOp verifier.
2. indexing into SubViewOp may access out of bounds since lowering to LLVM does not currently enforce it by construction.
These will be fixed in subsequent commits after discussions.
PiperOrigin-RevId: 280250129
|
| |
| |
| |
| | |
PiperOrigin-RevId: 280236761
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is a quite complex operation that users are likely to attempt to write
themselves and get wrong (citation: users=me).
Ideally, we could pull this into FunctionLike, but for now, the
FunctionType rewriting makes it FuncOp specific. We would need some hook
for rewriting the function type (which for LLVM's func op, would need to
rewrite the underlying LLVM type).
PiperOrigin-RevId: 280234164
|
| |
| |
| |
| |
| |
| | |
This refactors the implementation of block signature(type) conversion to not insert fake cast operations to perform the type conversion, but to instead create a new block containing the proper signature. This has the benefit of enabling the use of pre-computed analyses that rely on mapping values. It also leads to a much cleaner implementation overall. The major user facing change is that applySignatureConversion will now replace the entry block of the region, meaning that blocks generally shouldn't be cached over calls to applySignatureConversion.
PiperOrigin-RevId: 280226936
|
| |
| |
| |
| |
| |
| | |
This creates a central place in the documentation where MLIR-specific terminology is defined. See discussion on the MLIR forum (https://groups.google.com/a/tensorflow.org/g/mlir/c/5YXDSdu76Hk).
PiperOrigin-RevId: 280220365
|
| |
| |
| |
| |
| |
| | |
The current implementation silently fails if the '@' identifier isn't present, making it similar to the 'optional' parse methods. This change renames the current implementation to 'Optional' and adds a new 'parseSymbolName' that emits an error.
PiperOrigin-RevId: 280214610
|