- May 05, 2020
-
-
River Riddle authored
This revision adds support for merging identical blocks, or those with the same operations that branch to the same successors. Operands that mismatch between the different blocks are replaced with new block arguments added to the merged block. Differential Revision: https://reviews.llvm.org/D79134
-
- Apr 30, 2020
-
-
Lucy Fox authored
There are three op conversion modes: Partial, Full, and Analysis. This change modifies the Partial mode to optionally take a set of non-legalizable ops. If this parameter is specified, all ops that are not legalizable (i.e. would cause full conversion to fail) are tracked throughout the partial legalization. Differential Revision: https://reviews.llvm.org/D78788
-
- Apr 28, 2020
-
-
Tres Popp authored
Summary: This change results in tests also being changed to prevent dead affine.load operations from being folded away during rewrites. Also move AffineStoreOp and AffineLoadOp to an ODS file. Differential Revision: https://reviews.llvm.org/D78930
-
Ehsan Toosi authored
We have provided a generic buffer assignment transformation ported from TensorFlow. This generic transformation pass automatically analyzes the values and their aliases (also in other blocks) and returns the valid positions for Alloc and Dealloc operations. To find these positions, the algorithm uses the block Dominator and Post-Dominator analyses. In our proposed algorithm, we have considered aliasing, liveness, nested regions, branches, conditional branches, critical edges, and independency to custom block terminators. This implementation doesn't support block loops. However, we have considered this in our design. For this purpose, it is only required to have a loop analysis to insert Alloc and Dealloc operations outside of these loops in some special cases. Differential Revision: https://reviews.llvm.org/D78484
-
Phoenix Meadowlark authored
- Adds a folder for integer division by one with the `divi_signed` and `divi_unsigned` ops. - Creates tests for scalar and tensor versions of these ops. - Modifies the test in `parallel-loop-collapsing.mlir` so that it doesn't assume division by one will be in the output. Differential Revision: https://reviews.llvm.org/D78518
-
- Apr 27, 2020
-
-
River Riddle authored
This revision adds support for propagating constants across symbol-based callgraph edges. It uses the existing Call/CallableOpInterfaces to detect the dataflow edges, and propagates constants through arguments and out of returns. Differential Revision: https://reviews.llvm.org/D78592
-
Tres Popp authored
Summary: Previously operations like std.load created methods for obtaining their effects but did not inherit from the SideEffect interfaces when their parameters were decorated with the information. The resulting situation was that passes had no information on the SideEffects of std.load/store and had to treat them more cautiously. This adds the inheritance information when creating the methods. As a side effect, many tests are modified, as they were using std.load for testing and this oepration would be folded away as part of pattern rewriting. Tests are modified to use store or to reutn the result of the std.load. Reviewers: mravishankar, antiagainst, nicolasvasilache, herhut, aartbik, ftynse! Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, csigg, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, bader, grosul1, frgossen, Kayjukh, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D78802
-
- Apr 24, 2020
-
-
River Riddle authored
The current implementation of this method performs the replacement directly, and thus doesn't support proper back tracking. Differential Revision: https://reviews.llvm.org/D78790
-
- Apr 23, 2020
-
-
River Riddle authored
This revision adds support for the following canonicalization: ``` cond_br %cond, ^bb1, ^bb2 ^bb1 br ^bbN(...) ^bb2 br ^bbK(...) cond_br %cond, ^bbN(...), ^bbK(...) ``` Differential Revision: https://reviews.llvm.org/D78681
-
- Apr 21, 2020
-
-
River Riddle authored
This is possible by adding two new ControlFlowInterface additions: - A new interface, RegionBranchOpInterface This interface allows for region holding operations to describe how control flows between regions. This interface initially contains two methods: * getSuccessorEntryOperands Returns the operands of this operation used as the entry arguments when entering the region at `index`, which was specified as a successor by `getSuccessorRegions`. when entering. These operands should correspond 1-1 with the successor inputs specified in `getSuccessorRegions`, and may be a subset of the entry arguments for that region. * getSuccessorRegions Returns the viable successors of a region, or the possible successor when branching from the parent op. This allows for describing which regions may be executed when entering an operation, and which regions are executed after having executed another region of the parent op. For example, a structured loop operation may always enter into the loop body region. The loop body region may branch back to itself, or exit to the operation. - A trait, ReturnLike This trait signals that a terminator exits a region and forwards all of its operands as "exiting" values. These additions allow for performing more general dataflow analysis in the presence of region holding operations. Differential Revision: https://reviews.llvm.org/D78447
-
River Riddle authored
This revision adds the initial pass for performing SCCP generically in MLIR. SCCP is an algorithm for propagating constants across control flow, and optimistically assumes all values to be constant unless proven otherwise. It currently supports branching control, with support for regions and inter-procedural propagation being added in followups. Differential Revision: https://reviews.llvm.org/D78397
-
Sean Silva authored
The previous code result a mismatch between block argument types and predecessor successor args when a type conversion was needed in a multiblock case. It was assuming the replaced result types matched the region result types. Also, slighly improve the debug output from the inliner. Differential Revision: https://reviews.llvm.org/D78415
-
- Apr 13, 2020
-
-
River Riddle authored
move it to test/Transforms/
-
- Apr 09, 2020
-
-
River Riddle authored
Summary: Some pattern rewriters, like dialect conversion, prohibit the unbounded recursion(or reapplication) of patterns on generated IR. Most patterns are not written with recursive application in mind, so will generally explode the stack if uncaught. This revision adds a hook to RewritePattern, `hasBoundedRewriteRecursion`, to signal that the pattern can safely be applied to the generated IR of a previous application of the same pattern. This allows for establishing a contract between the pattern and rewriter that the pattern knows and can handle the potential recursive application. Differential Revision: https://reviews.llvm.org/D77782
-
- Apr 08, 2020
-
-
River Riddle authored
Summary: Pass options are a better choice for various reasons and avoid the need for static constructors. Differential Revision: https://reviews.llvm.org/D77707
-
Christian Sigg authored
Reviewers: herhut Reviewed By: herhut Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, grosul1, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77709
-
- Apr 07, 2020
-
-
Uday Bondhugula authored
Introduce the alloca op for stack memory allocation. When converting to the LLVM dialect, this is lowered to an llvm.alloca. Refactor the std to llvm conversion for alloc op to reuse with alloca. Drop useAlloca option with alloc op lowering. Differential Revision: https://reviews.llvm.org/D76602
-
- Apr 05, 2020
-
-
Uday Bondhugula authored
Add a pattern rewriter utility to erase blocks (while notifying the pattern rewriting driver of the erased ops). Use this to remove trivial else blocks in affine.if ops. Differential Revision: https://reviews.llvm.org/D77083
-
- Apr 03, 2020
-
-
Alex Zinenko authored
PatternRewriter and derived classes provide a set of virtual methods to manipulate blocks, which ConversionPatternRewriter overrides to keep track of the manipulations and undo them in case the conversion fails. However, one can currently create a block only by splitting another block into two. This not only makes the API inconsistent (`splitBlock` is allowed in conversion patterns, but `createBlock` is not), but it also make it impossible for one to create blocks with argument lists different from those of already existing blocks since in-place block updates are not supported either. Such functionality precludes dialect conversion infrastructure from being used more extensively on region-containing ops, for example, for value-returning "if" operations. At the same time, ConversionPatternRewriter already allows one to undo block creation as block creation is one of the primitive operations in already supported region inlining. Support block creation in conversion patterns by hooking `createBlock` on the block action undo mechanism. This requires to make `Builder::createBlock` virtual, similarly to Op insertion. This is a minimal change to the Builder infrastructure that will later help support additional use cases such as block signature changes. `createBlock` now additionally takes the types of the block arguments that are added immediately so as to avoid in-place argument list manipulation that would be illegal in conversion patterns.
-
- Apr 01, 2020
-
-
Tres Popp authored
Summary: This is to allow optimizations like loop invariant code motion to work on the ParallelOp. Additional small cleanup on the ForOp implementation of LoopLikeInterface and the test file of loop-invariant-code-motion. Differential Revision: https://reviews.llvm.org/D77128
-
Tres Popp authored
Summary: Additionally, NFC code cleanups were done. This is to address additional comments on https://reviews.llvm.org/D76363 Differential Revision: https://reviews.llvm.org/D77052
-
- Mar 31, 2020
-
-
Uday Bondhugula authored
Move lower-affine.mlir from test/Transforms to test/Conversion/AffineToStandard/. Other related NFC. Signed-off-by:
Uday Bondhugula <uday@polymagelabs.com> Differential Revision: https://reviews.llvm.org/D77008
-
- Mar 30, 2020
-
-
Mehdi Amini authored
Differential Revision: https://reviews.llvm.org/D76903
-
- Mar 26, 2020
-
-
Tres Popp authored
This allows conversion of a ParallelLoop from N induction variables to some nuber of induction variables less than N. The first intended use of this is for the GPUDialect to convert ParallelLoops to iterate over 3 dimensions so they can be launched as GPU Kernels. To implement this: - Normalize each iteration space of the ParallelLoop - Use the same induction variable in a new ParallelLoop for multiple original iterations. - Split the new induction variable back into the original set of values inside the body of the ParallelLoop. Subscribers: mgorny, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D76363
-
- Mar 23, 2020
-
-
Uday Bondhugula authored
Move some of the affine transforms and their test cases to their respective dialect directory. This patch does not complete the move, but takes care of a good part. Renames: prefix 'affine' to affine loop tiling cl options, vectorize -> super-vectorize Signed-off-by:
Uday Bondhugula <uday@polymagelabs.com> Differential Revision: https://reviews.llvm.org/D76565
-
- Mar 22, 2020
-
-
River Riddle authored
This removes the reliance on global options, and also simplifies the pass registration. Differential Revision: https://reviews.llvm.org/D76552
-
- Mar 19, 2020
-
-
Rob Suderman authored
Summary: Utility to perform CallOp Dialect conversion, specifically handling cases where an argument type has changed and the corresponding CallOp needs to be updated. Differential Revision: https://reviews.llvm.org/D76326
-
- Mar 18, 2020
-
-
River Riddle authored
Summary: This is somewhat complex(annoying) as it involves directly tracking the uses within each of the callgraph nodes, and updating them as needed during inlining. The benefit of this is that we can have a more exact cost model, enable inlining some otherwise non-inlinable cases, and also ensure that newly dead callables are properly disposed of. Differential Revision: https://reviews.llvm.org/D75476
-
- Mar 17, 2020
-
-
Uday Bondhugula authored
- rename vars that had inst suffixes (due to ops earlier being known as insts); other renames for better readability - drop unnecessary matches in test cases - iterate without block terminator - comment/doc updates - instBodySkew -> affineForOpBodySkew Signed-off-by:
Uday Bondhugula <uday@polymagelabs.com> Differential Revision: https://reviews.llvm.org/D76214
-
- Mar 12, 2020
-
-
River Riddle authored
HasNoSideEffect can now be implemented using the MemoryEffectInterface, removing the need to check multiple things for the same information. This also removes an easy foot-gun for users as 'Operation::hasNoSideEffect' would ignore operations that dynamically, or recursively, have no side effects. This also leads to an immediate improvement in some of the existing users, such as DCE, now that they have access to more information. Differential Revision: https://reviews.llvm.org/D76036
-
Tim Shen authored
Summary: affineDataCopyGenerate is a monolithinc function that combines several steps for good reasons, but it makes customizing the behaivor even harder. The major two steps by affineDataCopyGenerate are: a) Identify interesting memrefs and collect their uses. b) Create new buffers to forward these uses. Step (a) actually has requires tremendous customization options. One could see that from the recently added filterMemRef parameter. This patch adds a function that only does (b), in the hope that (a) can be directly implemented by the callers. In fact, (a) is quite simple if the caller has only one buffer to consider, or even one use. Differential Revision: https://reviews.llvm.org/D75965
-
- Mar 10, 2020
-
-
River Riddle authored
[mlir][SideEffects] Replace the old SideEffects dialect interface with the newly added op interfaces/traits. Summary: The old interface was a temporary stopgap to allow for implementing simple LICM that took side effects of region operations into account. Now that MLIR has proper support for specifying memory effects, this interface can be deleted. Differential Revision: https://reviews.llvm.org/D74441
-
- Mar 09, 2020
-
-
Uday Bondhugula authored
- update test case for readability, avoid unnecessary matches Signed-off-by:
Uday Bondhugula <uday@polymagelabs.com> Differential Revision: https://reviews.llvm.org/D75823
-
- Mar 05, 2020
-
-
River Riddle authored
Summary: This revision removes all of the functionality related to successor operands on the core Operation class. This greatly simplifies a lot of handling of operands, as well as successors. For example, DialectConversion no longer needs a special "matchAndRewrite" for branching terminator operations.(Note, the existing method was also broken for operations with variadic successors!!) This also enables terminator operations to define their own relationships with successor arguments, instead of the hardcoded "pass-through" behavior that exists today. Differential Revision: https://reviews.llvm.org/D75318
-
River Riddle authored
This attribute details the segment sizes for operand groups within the operation. This revision add support for automatically populating this attribute in the declarative parser. Differential Revision: https://reviews.llvm.org/D75315
-
- Feb 14, 2020
-
-
Diego Caballero authored
This patch extends affine data copy optimization utility with an optional memref filter argument. When the memref filter is used, data copy optimization will only generate copies for such a memref. Note: this patch is just porting the memref filter feature from Uday's 'hop' branch: https://github.com/bondhugula/llvm-project/tree/hop. Reviewed By: bondhugula Differential Revision: https://reviews.llvm.org/D74342
-
- Feb 11, 2020
-
-
Andy Davis authored
Summary: Adds affine loop fusion transformation function to LoopFusionUtils. Updates TestLoopFusion utility to run loop fusion transformation until a fixed point is reached. Adds unit tests to test the transformation. Includes ASAN bug fix for D73190. Reviewers: bondhugula, dcaballe Reviewed By: bondhugula, dcaballe Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D74330
-
- Feb 10, 2020
-
-
Stephen Neuendorffer authored
Differential Revision: https://reviews.llvm.org/D73672
-
Stephen Neuendorffer authored
Allow this only if the types are the same. e.g.: i16 -> index -> i16 or index -> i16 -> index Differential Revision: https://reviews.llvm.org/D73671
-
Stephen Neuendorffer authored
NFC for binary operations. Differential Revision: https://reviews.llvm.org/D73670
-