- Nov 21, 2019
-
-
River Riddle authored
This moves the different canonicalizations of regions into one place and invokes them in the fixed-point iteration of the canonicalizer. PiperOrigin-RevId: 281617072
-
- Nov 20, 2019
-
-
Andy Davis authored
PiperOrigin-RevId: 281605471
-
Mahesh Ravishankar authored
If the sizes are specified as arguments to the subview op, then the shape must be dynamic as well. PiperOrigin-RevId: 281591608
-
Sean Silva authored
This is a simple multi-level DCE pass that operates pretty generically on the IR. Its key feature compared to the existing peephole dead op folding that happens during canonicalization is being able to delete recursively dead cycles of the use-def graph, including block arguments. PiperOrigin-RevId: 281568202
-
Mahesh Ravishankar authored
The current SubViewOp specification allows for either all offsets, shape and stride to be dynamic or all of them to be static. There are opportunities for more fine-grained canonicalization based on which of these are static. For example, if the sizes are static, the result memref is of static shape. The specification of SubViewOp is modified to allow on or more of offsets, shapes and strides to be statically specified. The verification is updated to ensure that the result type of the subview op is consistent with which of these are static and which are dynamic. PiperOrigin-RevId: 281560457
-
Nicolas Vasilache authored
This CL uses the pattern rewrite infrastructure to implement a simple VectorOps -> VectorOps legalization strategy to unroll coarse-grained vector operations into finer grained ones. The transformation is written using local pattern rewrites to allow composition with other rewrites. It proceeds by iteratively introducing fake cast ops and cleaning canonicalizing or lowering them away where appropriate. This is an example of writing transformations as compositions of local pattern rewrites that should enable us to make them significantly more declarative. PiperOrigin-RevId: 281555100
-
River Riddle authored
This interface provides more fine-grained hooks into the AsmPrinter than the dialect interface, allowing for operations to define the asm name to use for results directly on the operations themselves. The hook is also expanded to enable defining named result "groups". Get a special name to use when printing the results of this operation. The given callback is invoked with a specific result value that starts a result "pack", and the name to give this result pack. To signal that a result pack should use the default naming scheme, a None can be passed in instead of the name. For example, if you have an operation that has four results and you want to split these into three distinct groups you could do the following: setNameFn(getResult(0), "first_result"); setNameFn(getResult(1), "middle_results"); setNameFn(getResult(3), ""); // use the default numbering. This would print the operation as follows: %first_result, %middle_results:2, %0 = "my.op" ... PiperOrigin-RevId: 281546873
-
Nicolas Vasilache authored
This operator is used for internal debugging purposes. PiperOrigin-RevId: 281544152
-
Alexander Belyaev authored
PiperOrigin-RevId: 281501234
-
Stephan Herhut authored
PiperOrigin-RevId: 281483447
-
- Nov 19, 2019
-
-
Christian Sigg authored
Fix registered size of indirect MemRefType kernel arguments. PiperOrigin-RevId: 281362940
-
Nicolas Vasilache authored
The `vector.strided_slice` takes an n-D vector, k-D `offsets` integer array attribute, a k-D `sizes` integer array attribute, a k-D `strides` integer array attribute and extracts the n-D subvector at the proper offset. Returns an n-D vector where the first k-D dimensions match the `sizes` attribute. The returned subvector contains the elements starting at offset `offsets` and ending at `offsets + sizes`. Example: ``` %1 = vector.strided_slice %0 {offsets : [0, 2], sizes : [2, 4], strides : [1, 1]}: vector<4x8x16xf32> // returns a vector<2x4x16xf32> ``` This op will be useful for progressive lowering within the VectorOp dialect. PiperOrigin-RevId: 281352749
-
Nicolas Vasilache authored
In the particular case where the size of a memref dimension is 1, double printing would happen because printLast was called unconditionally. This CL fixes the print and updates an incorrect test that should have caught this in the first place. PiperOrigin-RevId: 281345142
-
Diego Caballero authored
This method is needed for N->1 conversion patterns to retrieve remapped Values used in the original N operations. Closes tensorflow/mlir#237 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/237 from dcaballe:dcaballe/getRemappedValue 1f64fadcf2b203f7b336ff0c5838b116ae3625db PiperOrigin-RevId: 281321881
-
Alex Zinenko authored
The command-line flag name `lower-to-llvm` for the pass performing dialect conversion from the Standard dialect to the LLVM dialect is misleading and inconsistent with most of the conversion passses. It leads the user to believe that there are no restrictions on what can be converted, while in fact only a subset of the Standard dialect can be converted (with operations from other dialects converted by separate passes). Use `convert-std-to-llvm` that better reflects what the pass does and is consistent with most other conversions. PiperOrigin-RevId: 281238797
-
Hanhan Wang authored
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
-
Alexander Belyaev authored
PiperOrigin-RevId: 281169885
-
Andy Davis authored
Adds unit tests for subview offset and stride argument constant folding. PiperOrigin-RevId: 281161041
-
- Nov 18, 2019
-
-
River Riddle authored
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
-
Denis Khalikov authored
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
-
Andy Davis authored
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
-
Stephan Herhut authored
PiperOrigin-RevId: 281042016
-
Alex Zinenko authored
This makes the flags consistent with the naming scheme used elsewhere in the codebase for dialect conversions. PiperOrigin-RevId: 281027517
-
- Nov 15, 2019
-
-
Denis Khalikov authored
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
-
Lei Zhang authored
This turns several hand-written functions to auto-generated ones. PiperOrigin-RevId: 280684326
-
Lei Zhang authored
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
-
Stephan Herhut authored
The same reasoning as for std.subview applies. PiperOrigin-RevId: 280639308
-
Stephan Herhut authored
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
-
Nicolas Vasilache authored
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
-
- Nov 14, 2019
-
-
Andy Davis authored
Adds canonicalizer to SubViewOp which folds constants from base memref and 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
-
Lei Zhang authored
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
-
Alex Zinenko authored
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
-
Nicolas Vasilache authored
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
-
- Nov 13, 2019
-
-
Jacques Pienaar authored
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
-
Nicolas Vasilache authored
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
-
Sean Silva authored
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
-
River Riddle authored
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
-
River Riddle authored
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
-
Hanhan Wang authored
Since VariableOp is serialized during processBlock, we add two more fields, `functionHeader` and `functionBody`, to collect instructions for a function. After all the blocks have been processed, we append them to the `functions`. Also, fix a bug in processGlobalVariableOp. The global variables should be encoded into `typesGlobalValues`. PiperOrigin-RevId: 280105366
-
- Nov 12, 2019
-
-
Mahesh Ravishankar authored
Lowering of CmpIOp, DivISOp, RemISOp, SubIOp and SelectOp to SPIR-V dialect enables the lowering of operations generated by AffineExpr -> StandardOps conversion into the SPIR-V dialect. PiperOrigin-RevId: 280039204
-