aboutsummaryrefslogtreecommitdiff
path: root/mlir/lib/Transforms/LoopFusion.cpp
AgeCommit message (Collapse)AuthorFilesLines
2022-01-24[mlir:Transforms] Move out the remaining non-dialect independent transforms ↵River Riddle1-1996/+0
and utilities This has been a major TODO for a very long time, and is necessary for establishing a proper dialect-free dependency layering for the Transforms library. Code was moved to effectively two main locations: * Affine/ There was quite a bit of affine dialect related code in Transforms/ do to historical reasons (of a time way into MLIR's past). The following headers were moved to: Transforms/LoopFusionUtils.h -> Dialect/Affine/LoopFusionUtils.h Transforms/LoopUtils.h -> Dialect/Affine/LoopUtils.h Transforms/Utils.h -> Dialect/Affine/Utils.h The following transforms were also moved: AffineLoopFusion, AffinePipelineDataTransfer, LoopCoalescing * SCF/ Only one SCF pass was in Transforms/ (likely accidentally placed here): ParallelLoopCollapsing The SCF specific utilities in LoopUtils have been moved to SCF/Utils.h * Misc: mlir::moveLoopInvariantCode was also moved to LoopLikeInterface.h given that it is a simple utility defined in terms of LoopLikeOpInterface. Differential Revision: https://reviews.llvm.org/D117848
2022-01-18[mlir][Pass] Deprecate FunctionPass in favor of OperationPass<FuncOp>River Riddle1-3/+3
The only benefit of FunctionPass is that it filters out function declarations. This isn't enough to justify carrying it around, as we can simplify filter out declarations when necessary within the pass. We can also explore with better scheduling primitives to filter out declarations at the pipeline level in the future. The definition of FunctionPass is left intact for now to allow time for downstream users to migrate. Differential Revision: https://reviews.llvm.org/D117182
2022-01-18[mlir:Analysis] Move the LoopAnalysis library to Dialect/Affine/AnalysisRiver Riddle1-4/+4
The current state of the top level Analysis/ directory is that it contains two libraries; a generic Analysis library (free from dialect dependencies), and a LoopAnalysis library that contains various analysis utilities that originated from Affine loop transformations. This commit moves the LoopAnalysis to the more appropriate home of `Dialect/Affine/Analysis/`, given the use and intention of the majority of the code within it. After the move, if there are generic utilities that would fit better in the top-level Analysis/ directory, we can move them. Differential Revision: https://reviews.llvm.org/D117351
2022-01-02Apply clang-tidy fixes for bugprone-argument-comment to MLIR (NFC)Mehdi Amini1-1/+1
Differential Revision: https://reviews.llvm.org/D116244
2021-12-22Fix more clang-tidy cleanups in mlir/ (NFC)Mehdi Amini1-1/+1
2021-12-20Fix clang-tidy issues in mlir/ (NFC)Mehdi Amini1-2/+3
Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D115956
2021-12-08Adjust "end namespace" comment in MLIR to match new agree'd coding styleMehdi Amini1-3/+3
See D115115 and this mailing list discussion: https://lists.llvm.org/pipermail/llvm-dev/2021-December/154199.html Differential Revision: https://reviews.llvm.org/D115309
2021-11-13Fix some clang-tidy reports in MLIR (NFC)Mehdi Amini1-1/+1
Mostly replace uses of `container.size()` with `container.empty()` in conditionals when applicable.
2021-09-27[mlir] Mode for explicitly controlling the fusion kindSumesh Udayakumaran1-5/+25
New mode option that allows for either running the default fusion kind that happens today or doing either of producer-consumer or sibling fusion. This will also be helpful to minimize the compile-time of the fusion tests. Reviewed By: bondhugula, dcaballe Differential Revision: https://reviews.llvm.org/D110102
2021-08-17[mlir][Analysis][NFC] Clean up FlatAffineValueConstraintsMatthias Springer1-1/+1
* Rename ids to values in FlatAffineValueConstraints. * Overall cleanup of comments in FlatAffineConstraints and FlatAffineValueConstraints. Differential Revision: https://reviews.llvm.org/D107947
2021-08-17[mlir][Analysis][NFC] Split FlatAffineConstraints classMatthias Springer1-1/+1
* Extract "value" functionality of `FlatAffineConstraints` into a new derived `FlatAffineValueConstraints` class. Current users of `FlatAffineConstraints` can use `FlatAffineValueConstraints` without additional code changes, thus NFC. * `FlatAffineConstraints` no longer associates dimensions with SSA Values. All functionality that requires this, is moved to `FlatAffineValueConstraints`. * `FlatAffineConstraints` no longer makes assumptions about where Values associated with dimensions are coming from. Differential Revision: https://reviews.llvm.org/D107725
2021-07-30[mlir][affine-loop-fusion] Fix a bug that AffineIfOp prevents fusion of the ↵Tung D. Le1-7/+8
other loops The presence of AffineIfOp inside AffineFor prevents fusion of the other loops to happen. For example: ``` affine.for %i0 = 0 to 10 { affine.store %cf7, %a[%i0] : memref<10xf32> } affine.for %i1 = 0 to 10 { %v0 = affine.load %a[%i1] : memref<10xf32> affine.store %v0, %b[%i1] : memref<10xf32> } affine.for %i2 = 0 to 10 { affine.if #set(%i2) { %v0 = affine.load %b[%i2] : memref<10xf32> } } ``` The first two loops were not be fused because of `affine.if` inside the last `affine.for`. The issue seems to come from a conservative constraint that does not allow fusion if there are ops whose number of regions != 0 (affine.if is one of them). This patch just removes such a constraint when`affine.if` is inside `affine.for`. The existing `canFuseLoops` method is able to handle `affine.if` correctly. Reviewed By: bondhugula, vinayaka-polymage Differential Revision: https://reviews.llvm.org/D105963
2021-07-16[mlir] Enable cleanup of single iteration reduction loops being ↵Sumesh Udayakumaran1-2/+7
sibling-fused maximally Changes include the following: 1. Single iteration reduction loops being sibling fused at innermost insertion level are skipped from being considered as sequential loops. Otherwise, the slice bounds of these loops is reset. 2. Promote loops that are skipped in previous step into outer loops. 3. Two utility function - buildSliceTripCountMap, getSliceIterationCount - are moved from mlir/lib/Transforms/Utils/LoopFusionUtils.cpp to mlir/lib/Analysis/Utils.cpp Reviewed By: bondhugula, vinayaka-polymage Differential Revision: https://reviews.llvm.org/D104249
2021-05-18[MLIR][Affine] Privatize certain escaping memrefsVinayaka Bandishti1-3/+9
During affine loop fusion, create private memrefs for escaping memrefs too under the conditions that: -- the source is not removed after fusion, and -- the destination does not write to the memref. This creates more fusion opportunities as illustrated in the test case. Reviewed By: bondhugula, ayzhuang Differential Revision: https://reviews.llvm.org/D102604
2021-05-06[mlir] Update dstNode after DenseMap insertion in loop fusion pass.Amy Zhuang1-0/+4
Reviewed By: vinayaka-polymage Differential Revision: https://reviews.llvm.org/D101794
2021-04-15[mlir][NFC] Add a using directive for llvm::SetVectorRiver Riddle1-2/+0
Differential Revision: https://reviews.llvm.org/D100436
2021-03-15[MLIR] Create memref dialect and move dialect-specific ops from std.Julian Gross1-2/+3
Create the memref dialect and move dialect-specific ops from std dialect to this dialect. Moved ops: AllocOp -> MemRef_AllocOp AllocaOp -> MemRef_AllocaOp AssumeAlignmentOp -> MemRef_AssumeAlignmentOp DeallocOp -> MemRef_DeallocOp DimOp -> MemRef_DimOp MemRefCastOp -> MemRef_CastOp MemRefReinterpretCastOp -> MemRef_ReinterpretCastOp GetGlobalMemRefOp -> MemRef_GetGlobalOp GlobalMemRefOp -> MemRef_GlobalOp LoadOp -> MemRef_LoadOp PrefetchOp -> MemRef_PrefetchOp ReshapeOp -> MemRef_ReshapeOp StoreOp -> MemRef_StoreOp SubViewOp -> MemRef_SubViewOp TransposeOp -> MemRef_TransposeOp TensorLoadOp -> MemRef_TensorLoadOp TensorStoreOp -> MemRef_TensorStoreOp TensorToMemRefOp -> MemRef_BufferCastOp ViewOp -> MemRef_ViewOp The roadmap to split the memref dialect from std is discussed here: https://llvm.discourse.group/t/rfc-split-the-memref-dialect-from-std/2667 Differential Revision: https://reviews.llvm.org/D98041
2021-03-02[mlir][NFC] Rename `MemRefType::getMemorySpace` to `getMemorySpaceAsInt`Vladislav Vinogradov1-1/+1
Just a pure method renaming. It is a preparation step for replacing "memory space as raw integer" with more generic "memory space as attribute", which will be done in separate commit. The `MemRefType::getMemorySpace` method will return `Attribute` and become the main API, while `getMemorySpaceAsInt` will be declared as deprecated and will be replaced in all in-tree dialects (also in separate commits). Reviewed By: mehdi_amini, rriddle Differential Revision: https://reviews.llvm.org/D97476
2021-02-26[MLIR][affine] Certain Call Ops to prevent fusionVinayaka Bandishti1-0/+9
Fixes a bug in affine fusion pipeline where an incorrect fusion is performed despite a Call Op that potentially modifies memrefs under consideration exists between source and target. Fixes part of https://bugs.llvm.org/show_bug.cgi?id=49220 Reviewed By: bondhugula, dcaballe Differential Revision: https://reviews.llvm.org/D97252
2021-02-25[MLIR][affine-loop-fusion] Handle defining ops between the source and dest loopsTung D. Le1-5/+37
This patch handles defining ops between the source and dest loop nests, and prevents loop nests with `iter_args` from being fused. If there is any SSA value in the dest loop nest whose defining op has dependence from the source loop nest, we cannot fuse the loop nests. If there is a `affine.for` with `iter_args`, prevent it from being fused. Reviewed By: dcaballe, bondhugula Differential Revision: https://reviews.llvm.org/D97030
2021-02-22[MLIR][affine] Prevent fusion when ops with memory effect free are present ↵Vinayaka Bandishti1-1/+2
between producer and consumer This commit fixes a bug in affine fusion pipeline where an incorrect fusion is performed despite a dealloc op is present between a producer and a consumer. This is done by creating a node for dealloc op in the MDG. Reviewed By: bondhugula, dcaballe Differential Revision: https://reviews.llvm.org/D97032
2021-02-18Revert "[MLIR] Create memref dialect and move several dialect-specific ops ↵Alexander Belyaev1-3/+2
from std." This commit introduced a cyclic dependency: Memref dialect depends on Standard because it used ConstantIndexOp. Std depends on the MemRef dialect in its EDSC/Intrinsics.h Working on a fix. This reverts commit 8aa6c3765b924d86f623d452777eb76b83bf2787.
2021-02-18[MLIR] Create memref dialect and move several dialect-specific ops from std.Julian Gross1-2/+3
Create the memref dialect and move several dialect-specific ops without dependencies to other ops from std dialect to this dialect. Moved ops: AllocOp -> MemRef_AllocOp AllocaOp -> MemRef_AllocaOp DeallocOp -> MemRef_DeallocOp MemRefCastOp -> MemRef_CastOp GetGlobalMemRefOp -> MemRef_GetGlobalOp GlobalMemRefOp -> MemRef_GlobalOp PrefetchOp -> MemRef_PrefetchOp ReshapeOp -> MemRef_ReshapeOp StoreOp -> MemRef_StoreOp TransposeOp -> MemRef_TransposeOp ViewOp -> MemRef_ViewOp The roadmap to split the memref dialect from std is discussed here: https://llvm.discourse.group/t/rfc-split-the-memref-dialect-from-std/2667 Differential Revision: https://reviews.llvm.org/D96425
2021-02-16separate AffineMapAccessInterface from AffineRead/WriteOpInterfaceAdam Straw1-9/+3
Separating the AffineMapAccessInterface from AffineRead/WriteOp interface so that dialects which extend Affine capabilities (e.g. PlaidML PXA = parallel extensions for Affine) can utilize relevant passes (e.g. MemRef normalization). Reviewed By: bondhugula Differential Revision: https://reviews.llvm.org/D96284
2021-02-06[MLIR] [affine-loop-fusion] Fix a bug about non-result ops in affine-loop-fusionTung D. Le1-0/+11
This patch fixes the following bug when calling --affine-loop-fusion Input program: ```mlir func @should_not_fuse_since_top_level_non_affine_non_result_users( %in0 : memref<32xf32>, %in1 : memref<32xf32>) { %c0 = constant 0 : index %cst_0 = constant 0.000000e+00 : f32 affine.for %d = 0 to 32 { %lhs = affine.load %in0[%d] : memref<32xf32> %rhs = affine.load %in1[%d] : memref<32xf32> %add = addf %lhs, %rhs : f32 affine.store %add, %in0[%d] : memref<32xf32> } store %cst_0, %in0[%c0] : memref<32xf32> affine.for %d = 0 to 32 { %lhs = affine.load %in0[%d] : memref<32xf32> %rhs = affine.load %in1[%d] : memref<32xf32> %add = addf %lhs, %rhs: f32 affine.store %add, %in0[%d] : memref<32xf32> } return } ``` call --affine-loop-fusion, we got an incorrect output: ```mlir func @should_not_fuse_since_top_level_non_affine_non_result_users(%arg0: memref<32xf32>, %arg1: memref<32xf32>) { %c0 = constant 0 : index %cst = constant 0.000000e+00 : f32 store %cst, %arg0[%c0] : memref<32xf32> affine.for %arg2 = 0 to 32 { %0 = affine.load %arg0[%arg2] : memref<32xf32> %1 = affine.load %arg1[%arg2] : memref<32xf32> %2 = addf %0, %1 : f32 affine.store %2, %arg0[%arg2] : memref<32xf32> %3 = affine.load %arg0[%arg2] : memref<32xf32> %4 = affine.load %arg1[%arg2] : memref<32xf32> %5 = addf %3, %4 : f32 affine.store %5, %arg0[%arg2] : memref<32xf32> } return } ``` This happened because when analyzing the source and destination nodes, affine loop fusion ignored non-result ops sandwitched between them. In other words, the MemRefDependencyGraph in the affine loop fusion ignored these non-result ops. This patch solves the issue by adding these non-result ops to the MemRefDependencyGraph. Reviewed By: bondhugula Differential Revision: https://reviews.llvm.org/D95668
2021-01-25[mlir][Affine] Add support for multi-store producer fusionDiego Caballero1-353/+346
This patch adds support for producer-consumer fusion scenarios with multiple producer stores to the AffineLoopFusion pass. The patch introduces some changes to the producer-consumer algorithm, including: * For a given consumer loop, producer-consumer fusion iterates over its producer candidates until a fixed point is reached. * Producer candidates are gathered beforehand for each iteration of the consumer loop and visited in reverse program order (not strictly guaranteed) to maximize the number of loops fused per iteration. In general, these changes were needed to simplify the multi-store producer support and remove some of the workarounds that were introduced in the past to support more fusion cases under the single-store producer limitation. This patch also preserves the existing functionality of AffineLoopFusion with one minor change in behavior. Producer-consumer fusion didn't fuse scenarios with escaping memrefs and multiple outgoing edges (from a single store). Multi-store producer scenarios will usually (always?) have multiple outgoing edges so we couldn't fuse any with escaping memrefs, which would greatly limit the applicability of this new feature. Therefore, the patch enables fusion for these scenarios. Please, see modified tests for specific details. Reviewed By: andydavis1, bondhugula Differential Revision: https://reviews.llvm.org/D92876
2021-01-21Revert "[mlir][Affine] Add support for multi-store producer fusion"Diego Caballero1-324/+334
This reverts commit 7dd198852b4db52ae22242dfeda4eccda83aa8b2. ASAN issue.
2021-01-20Avoid unused variable warning in opt modeJacques Pienaar1-0/+2
2021-01-20[mlir][Affine] Add support for multi-store producer fusionDiego Caballero1-334/+322
This patch adds support for producer-consumer fusion scenarios with multiple producer stores to the AffineLoopFusion pass. The patch introduces some changes to the producer-consumer algorithm, including: * For a given consumer loop, producer-consumer fusion iterates over its producer candidates until a fixed point is reached. * Producer candidates are gathered beforehand for each iteration of the consumer loop and visited in reverse program order (not strictly guaranteed) to maximize the number of loops fused per iteration. In general, these changes were needed to simplify the multi-store producer support and remove some of the workarounds that were introduced in the past to support more fusion cases under the single-store producer limitation. This patch also preserves the existing functionality of AffineLoopFusion with one minor change in behavior. Producer-consumer fusion didn't fuse scenarios with escaping memrefs and multiple outgoing edges (from a single store). Multi-store producer scenarios will usually (always?) have multiple outgoing edges so we couldn't fuse any with escaping memrefs, which would greatly limit the applicability of this new feature. Therefore, the patch enables fusion for these scenarios. Please, see modified tests for specific details. Reviewed By: andydavis1, bondhugula Differential Revision: https://reviews.llvm.org/D92876
2020-12-02Add `Operation* OpState::operator->()` to provide more convenient access to ↵Christian Sigg1-2/+2
members of Operation. Given that OpState already implicit converts to Operator*, this seems reasonable. The alternative would be to add more functions to OpState which forward to Operation. Reviewed By: rriddle, ftynse Differential Revision: https://reviews.llvm.org/D92266
2020-11-18[mlir][Affine] Refactor affine fusion code in pass to utilitiesDiego Caballero1-303/+216
Refactoring/clean-up step needed to add support for producer-consumer fusion with multi-store producer loops and, in general, to implement more general loop fusion strategies in Affine. It introduces the following changes: - AffineLoopFusion pass now uses loop fusion utilities more broadly to compute fusion legality (canFuseLoops utility) and perform the fusion transformation (fuseLoops utility). - Loop fusion utilities have been extended to deal with AffineLoopFusion requirements and assumptions while preserving both loop fusion utilities and AffineLoopFusion current functionality within a unified implementation. 'FusionStrategy' has been introduced for this purpose and, in the future, it will allow us to have a single loop fusion core implementation that will produce different fusion outputs depending on the strategy used. - Improve separation of concerns for legality and profitability analysis: 'isFusionProfitable' no longer filters out illegal scenarios that 'canFuse' didn't detect, or the other way around. 'canFuse' now takes loop dependences into account to determine the fusion loop depth (producer-consumer fusion only). - As a result, maximal fusion now doesn't require any profitability analysis. - Slices are now computed only once and reused across the legality, profitability and fusion transformation steps (producer-consumer). - Refactor some utilities and remove redundant copies of them. This patch is NFCI and should preserve the existing functionality of both the AffineLoopFusion pass and the affine fusion utilities. Reviewed By: andydavis1, bondhugula Differential Revision: https://reviews.llvm.org/D90798
2020-08-04[MLIR][Affine] Fix createPrivateMemRef in affine fusionDiego Caballero1-8/+4
Always define a remapping for the memref replacement (`indexRemap`) with the proper number of inputs, including all the `outerIVs`, so that the number of inputs and the operands provided for the map don't mismatch. Reviewed By: bondhugula, andydavis1 Differential Revision: https://reviews.llvm.org/D85177
2020-07-16[MLIR][NFC] Fix clang tidy warnings in misc utilitiesUday Bondhugula1-2/+2
Fix clang tidy warnings in misc utilities - missing const or a star in declaration. Differential Revision: https://reviews.llvm.org/D83861
2020-07-07[mlir][NFC] Remove usernames and google bug numbers from TODO comments.River Riddle1-25/+26
These were largely leftover from when MLIR was a google project, and don't really follow LLVM guidelines.
2020-06-26[MLIR][Affine-loop-fusion] Fix a bug in affine-loop-fusion pass when there ↵Tung D. Le1-0/+71
are non-affine operations When there is a mix of affine load/store and non-affine operations (e.g. std.load, std.store), affine-loop-fusion ignores the present of non-affine ops, thus changing the program semantics. E.g. we have a program of three affine loops operating on the same memref in which one of them uses std.load and std.store, as follows. ``` affine.for affine.store %1 affine.for std.load %1 std.store %1 affine.for affine.load %1 affine.store %1 ``` affine-loop-fusion will produce the following result which changed the program semantics: ``` affine.for std.load %1 std.store %1 affine.for affine.store %1 affine.load %1 affine.store %1 ``` This patch is to fix the above problem by checking non-affine users of the memref that are between the source and destination nodes of interest. Differential Revision: https://reviews.llvm.org/D82158
2020-06-24[MLIR][NFC] Adopt variadic isa<>Rahul Joshi1-4/+2
Differential Revision: https://reviews.llvm.org/D82489
2020-06-24[MLIR] Fix affine loop fusion private memref allocUday Bondhugula1-11/+3
Drop stale code that provided the wrong operands to alloc. Reported-by: rjnw on discourse Differential Revision: https://reviews.llvm.org/D82409
2020-06-17[NFC] Use llvm::hasSingleElement() in place of .size() == 1Rahul Joshi1-1/+1
- Also use functions in Region instead of Region::getBlocks() where possible. Differential Revision: https://reviews.llvm.org/D82032
2020-06-11[mlir][Affine] Revisit fusion candidates after successful fusionDiego Caballero1-4/+12
This patch changes the fusion algorithm so that after fusing two loop nests we revisit previously visited nodes so that they are considered again for fusion in the context of the new fused loop nest. Reviewed By: bondhugula Differential Revision: https://reviews.llvm.org/D81609
2020-05-19[mlir][Affine] Introduce affine memory interfacesDiego Caballero1-34/+40
This patch introduces interfaces for read and write ops with affine restrictions. I used `read`/`write` intead of `load`/`store` for the interfaces so that they can also be implemented by dma ops. For now, they are only implemented by affine.load, affine.store, affine.vector_load and affine.vector_store. For testing purposes, this patch also migrates affine loop fusion and required analysis to use the new interfaces. No other changes are made beyond that. Co-authored-by: Alex Zinenko <zinenko@google.com> Reviewed By: bondhugula, ftynse Differential Revision: https://reviews.llvm.org/D79829
2020-05-07[MLIR] Fix affine fusion bug/efficiency issue / enable more fusionUday Bondhugula1-1/+4
The list of destination load ops while evaluating producer-consumer fusion wasn't being maintained as a set, and as such, duplicate load ops were being added to it. Although this is harmless correctness-wise, it's a killer efficiency-wise and it prevents interesting/useful fusions (including for eg. reshapes into a matmul). The reason the latter fusions would be missed is that a slice union would be unnecessarily needed due to the duplicate load ops on a memref added to the 'dst loads' list. Since slice union is unimplemented for the local var case, a single destination load op that leads to local vars (like a floordiv / mod producing fusion), a common case, would not get fused due to an unnecessary union being tried with itself. (The union would actually be the same thing but we would bail out.) Besides the above, this would also significantly speed up fusion as all the unnecessary slice computations / unions, checks, etc. due to the duplicates go away. Differential Revision: https://reviews.llvm.org/D79547
2020-05-06[MLIR][NFC] Fix/update debug messages for analysis utils and affine fusionUday Bondhugula1-2/+2
Drop trailing period in debug messages. Add an extra line for fusion debug info. Differential Revision: https://reviews.llvm.org/D79471
2020-04-15[MLIR] Improve support for 0-dimensional Affine Maps.Jeremy Bruestle1-1/+2
Summary: Modified AffineMap::get to remove support for the overload which allowed an ArrayRef of AffineExpr but no context (and gathered the context from a presumed first entry, resulting in bugs when there were 0 results). Instead, we support only a ArrayRef and a context, and a version which takes a single AffineExpr. Additionally, removed some now needless case logic which previously special cased which call to AffineMap::get to use. Reviewers: flaub, bondhugula, rriddle!, nicolasvasilache, ftynse, ulysseB, mravishankar, antiagainst, aartbik Subscribers: mehdi_amini, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, bader, grosul1, frgossen, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D78226
2020-04-14[MLIR] NFC cleanup/modernize memref-dataflow-opt / getNestingDepthUday Bondhugula1-1/+1
Bring code to date with recent changes to the core infrastructure / coding style. Differential Revision: https://reviews.llvm.org/D77998
2020-04-08[mlir] Eliminate the remaining usages of cl::opt instead of PassOption.River Riddle1-72/+29
Summary: Pass options are a better choice for various reasons and avoid the need for static constructors. Differential Revision: https://reviews.llvm.org/D77707
2020-04-07[mlir][Pass] Update the PassGen to generate base classes instead of utilitiesRiver Riddle1-6/+2
Summary: This is much cleaner, and fits the same structure as many other tablegen backends. This was not done originally as the CRTP in the pass classes made it overly verbose/complex. Differential Revision: https://reviews.llvm.org/D77367
2020-04-07[mlir][Pass] Remove the use of CRTP from the Pass classesRiver Riddle1-2/+2
This revision removes all of the CRTP from the pass hierarchy in preparation for using the tablegen backend instead. This creates a much cleaner interface in the C++ code, and naturally fits with the rest of the infrastructure. A new utility class, PassWrapper, is added to replicate the existing behavior for passes not suitable for using the tablegen backend. Differential Revision: https://reviews.llvm.org/D77350
2020-04-01[mlir][Pass] Add support for generating pass utilities via tablegenRiver Riddle1-1/+4
This revision adds support for generating utilities for passes such as options/statistics/etc. that can be inferred from the tablegen definition. This removes additional boilerplate from the pass, and also makes it easier to remove the reliance on the pass registry to provide certain things(e.g. the pass argument). Differential Revision: https://reviews.llvm.org/D76659
2020-04-01[mlir][Pass] Add a tablegen backend for defining Pass informationRiver Riddle1-3/+0
This will greatly simplify a number of things related to passes: * Enables generation of pass registration * Enables generation of boiler plate pass utilities * Enables generation of pass documentation This revision focuses on adding the basic structure and adds support for generating the registration for passes in the Transforms/ directory. Future revisions will add more support and move more passes over. Differential Revision: https://reviews.llvm.org/D76656
2020-03-20[mlir][NFC] Cleanup AffineOps directory structureRob Suderman1-1/+1
Summary: Change AffineOps Dialect structure to better group both IR and Tranforms. This included extracting transforms directly related to AffineOps. Also move AffineOps to Affine. Differential Revision: https://reviews.llvm.org/D76161