summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Transforms/LoopFusion.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [mlir] NFC: Remove Value::operator* and Value::operator-> now that Value is ↵River Riddle2020-01-111-11/+11
| | | | | | | | | | properly value-typed. Summary: These were temporary methods used to simplify the transition. Reviewed By: antiagainst Differential Revision: https://reviews.llvm.org/D72548
* NFC: Replace ValuePtr with Value and remove it now that Value is value-typed.River Riddle2019-12-231-33/+32
| | | | | | ValuePtr was a temporary typedef during the transition to a value-typed Value. PiperOrigin-RevId: 286945714
* Adjust License.txt file to use the LLVM licenseMehdi Amini2019-12-231-13/+4
| | | | PiperOrigin-RevId: 286906740
* NFC: Introduce new ValuePtr/ValueRef typedefs to simplify the transition to ↵River Riddle2019-12-221-46/+47
| | | | | | | | | | Value being value-typed. This is an initial step to refactoring the representation of OpResult as proposed in: https://groups.google.com/a/tensorflow.org/g/mlir/c/XXzzKhqqF_0/m/v6bKb08WCgAJ This change will make it much simpler to incrementally transition all of the existing code to use value-typed semantics. PiperOrigin-RevId: 286844725
* NFC: Cleanup non-conforming usages of namespaces.River Riddle2019-12-181-9/+13
| | | | | | | * Fixes use of anonymous namespace for static methods. * Uses explicit qualifiers(mlir::) instead of wrapping the definition with the namespace. PiperOrigin-RevId: 286222654
* minor spelling tweaksKazuaki Ishizaki2019-12-061-3/+3
| | | | | | | Closes tensorflow/mlir#290 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/290 from kiszk:spelling_tweaks_201912 9d9afd16a723dd65754a04698b3976f150a6054a PiperOrigin-RevId: 284169681
* AffineLoopFusion: Prevent fusion of multi-out-edge producer loopsDiego Caballero2019-12-031-3/+5
| | | | | | | | | | | | | tensorflow/mlir#162 introduced a bug that incorrectly allowed fusion of producer loops with multiple outgoing edges. This commit fixes that problem. It also introduces a new flag to disable sibling loop fusion so that we can test producer-consumer fusion in isolation. Closes tensorflow/mlir#259 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/259 from dcaballe:dcaballe/fix_multi_out_edge_producer_fusion 578d5661705fd5c56c555832d5e0528df88c5282 PiperOrigin-RevId: 283531105
* Fix Affine Loop Fusion test case reported on github.Andy Davis2019-11-181-18/+64
| | | | | | 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
* Fix minor spelling tweaks (NFC)Kazuaki Ishizaki2019-10-201-10/+10
| | | | | | Closes tensorflow/mlir#177 PiperOrigin-RevId: 275692653
* NFC: Remove trivial builder get methods.River Riddle2019-10-171-3/+3
| | | | | | These don't add any value, and some are even more restrictive than the respective static 'get' method. PiperOrigin-RevId: 275391240
* Add support for some multi-store cases in affine fusionDiego Caballero2019-10-091-34/+66
| | | | | | | | | | | | | | This PR is a stepping stone towards supporting generic multi-store source loop nests in affine loop fusion. It extends the algorithm to support fusion of multi-store loop nests that: 1. have only one store that writes to a function-local live out, and 2. the remaining stores are involved in loop nest self dependences or no dependences within the function. Closes tensorflow/mlir#162 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/162 from dcaballe:dcaballe/multi-output-fusion 7fb7dec6fe8b45f5ce176f018bfe37b256420c45 PiperOrigin-RevId: 273773907
* Support symbolic operands for memref replacement; fix memrefNormalizeUday Bondhugula2019-09-181-0/+1
| | | | | | | | | | | | | - allow symbols in index remapping provided for memref replacement - fix memref normalize crash on cases with layout maps with symbols Signed-off-by: Uday Bondhugula <uday@polymagelabs.com> Reported by: Alex Zinenko Closes tensorflow/mlir#139 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/139 from bondhugula:memref-rep-symbols 2f48c1fdb5d4c58915bbddbd9f07b18541819233 PiperOrigin-RevId: 269851182
* NFC: Finish replacing FunctionPassBase/ModulePassBase with OpPassBase.River Riddle2019-09-131-1/+1
| | | | | | These directives were temporary during the generalization of FunctionPass/ModulePass to OpPass. PiperOrigin-RevId: 268970259
* Refactor / improve replaceAllMemRefUsesWithUday Bondhugula2019-08-271-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor replaceAllMemRefUsesWith to split it into two methods: the new method does the replacement on a single op, and is used by the existing one. - make the methods return LogicalResult instead of bool - Earlier, when replacement failed (due to non-deferencing uses of the memref), the set of ops that had already been processed would have been replaced leaving the IR in an inconsistent state. Now, a pass is made over all ops to first check for non-deferencing uses, and then replacement is performed. No test cases were affected because all clients of this method were first checking for non-deferencing uses before calling this method (for other reasons). This isn't true for a use case in another upcoming PR (scalar replacement); clients can now bail out with consistent IR on failure of replaceAllMemRefUsesWith. Add test case. - multiple deferencing uses of the same memref in a single op is possible (we have no such use cases/scenarios), and this has always remained unsupported. Add an assertion for this. - minor fix to another test pipeline-data-transfer case. Signed-off-by: Uday Bondhugula <uday@polymagelabs.com> Closes tensorflow/mlir#87 PiperOrigin-RevId: 265808183
* NFC: Move AffineOps dialect to the Dialect sub-directory.River Riddle2019-08-201-1/+1
| | | | PiperOrigin-RevId: 264482571
* NFC: Move LLVMIR, SDBM, and StandardOps to the Dialect/ directory.River Riddle2019-08-191-1/+1
| | | | PiperOrigin-RevId: 264193915
* Change from llvm::make_unique to std::make_uniqueJacques Pienaar2019-08-171-2/+2
| | | | | | | | Switch to C++14 standard method as llvm::make_unique has been removed ( https://reviews.llvm.org/D66259). Also mark some targets as c++14 to ease next integrates. PiperOrigin-RevId: 263953918
* Express ownership transfer in PassManager API through std::unique_ptr (NFC)Mehdi Amini2019-08-121-4/+5
| | | | | | | | | | | | | | Since raw pointers are always passed around for IR construct without implying any ownership transfer, it can be error prone to have implicit ownership transferred the same way. For example this code can seem harmless: Pass *pass = .... pm.addPass(pass); pm.addPass(pass); pm.run(module); PiperOrigin-RevId: 263053082
* NFC: Rename Function to FuncOp.River Riddle2019-07-101-3/+3
| | | | PiperOrigin-RevId: 257293379
* NFC: Remove the various "::getFunction" methods.River Riddle2019-07-081-2/+2
| | | | | | These methods assume that a function is a valid builtin top-level operation, and removing these methods allows for decoupling FuncOp and IR/. Utility "getParentOfType" methods have been added to Operation/OpState to allow for querying the first parent operation of a given type. PiperOrigin-RevId: 257018913
* Globally change load/store/dma_start/dma_wait operations over to ↵Andy Davis2019-07-031-27/+27
| | | | | | | | | | | affine.load/store/dma_start/dma_wait. In most places, this is just a name change (with the exception of affine.dma_start swapping the operand positions of its tag memref and num_elements operands). Significant code changes occur here: *) Vectorization: LoopAnalysis.cpp, Vectorize.cpp *) Affine Transforms: Transforms/Utils/Utils.cpp PiperOrigin-RevId: 256395088
* NFC: Refactor Function to be value typed.River Riddle2019-07-011-6/+6
| | | | | | Move the data members out of Function and into a new impl storage class 'FunctionStorage'. This allows for Function to become value typed, which will greatly simplify the transition of Function to FuncOp(given that FuncOp is also value typed). PiperOrigin-RevId: 255983022
* Factor fusion compute cost calculation out of LoopFusion and into ↵Andy Davis2019-06-191-221/+10
| | | | | | LoopFusionUtils (NFC). PiperOrigin-RevId: 253797886
* LoopFusion: adds support for computing forward computation slices, which ↵Andy Davis2019-06-191-9/+12
| | | | | | will enable fusion of consumer loop nests into their producers in subsequent CLs. PiperOrigin-RevId: 253601994
* Return dependence result enum to distiguish between dependence result and ↵Andy Davis2019-06-111-3/+4
| | | | | | error cases (NFC). PiperOrigin-RevId: 252437616
* NFC: Rename FuncBuilder to OpBuilder and refactor to take a top level region ↵River Riddle2019-06-091-2/+2
| | | | | | instead of a function. PiperOrigin-RevId: 251563898
* Remove "size" property of affine maps.MLIR Team2019-06-011-4/+3
| | | | | | -- PiperOrigin-RevId: 250572818
* LoopFusionUtils CL 2/n: Factor out and generalize slice union computation.Andy Davis2019-06-011-80/+6
| | | | | | | | | | | *) Factors slice union computation out of LoopFusion into Analysis/Utils (where other iteration slice utilities exist). *) Generalizes slice union computation to take the union of slices computed on all loads/stores pairs between source and destination loop nests. *) Fixes a bug in FlatAffineConstraints::addSliceBounds where redundant constraints were added. *) Takes care of a TODO to expose FlatAffineConstraints::mergeAndAlignIds as a public method. -- PiperOrigin-RevId: 250561529
* Affine Loop Fusion Utility Module (1/n).Andy Davis2019-06-011-0/+8
| | | | | | | | | | *) Adds LoopFusionUtils which will expose a set of loop fusion utilities (e.g. dependence checks, fusion cost/storage reduction, loop fusion transformation) for use by loop fusion algorithms. Support for checking block-level fusion-preventing dependences is added in this CL (additional loop fusion utilities will be added in subsequent CLs). *) Adds TestLoopFusion test pass for testing LoopFusionUtils at a fine granularity. *) Adds unit test for testing dependence check for block-level fusion-preventing dependences. -- PiperOrigin-RevId: 249861071
* [LoopFusion] Don't count terminator op in compute cost.MLIR Team2019-06-011-2/+3
| | | | | | -- PiperOrigin-RevId: 249124895
* Add user iterators to IRObjects, i.e. Values.River Riddle2019-05-201-7/+7
| | | | | | -- PiperOrigin-RevId: 248877752
* Fix lingering sign compare warnings in exposed by "ninja check-mlir".Stella Laurenzo2019-05-201-0/+1
| | | | | | -- PiperOrigin-RevId: 248050178
* Factor out loop interchange code from LoopFusion into LoopUtils (NFC).Andy Davis2019-05-201-102/+2
| | | | | | -- PiperOrigin-RevId: 247926512
* Replace Operation::isa with llvm::isa.River Riddle2019-05-201-13/+13
| | | | | | -- PiperOrigin-RevId: 247789235
* Replace Operation::cast with llvm::cast.River Riddle2019-05-201-26/+26
| | | | | | -- PiperOrigin-RevId: 247785983
* Add support for using llvm::dyn_cast/cast/isa for operation casts and ↵River Riddle2019-05-201-4/+4
| | | | | | | | replace usages of Operation::dyn_cast with llvm::dyn_cast. -- PiperOrigin-RevId: 247780086
* Automated rollback of changelist 247778391.MLIR Team2019-05-201-4/+4
| | | | PiperOrigin-RevId: 247778691
* Add support for using llvm::dyn_cast/cast/isa for operation casts and ↵River Riddle2019-05-201-4/+4
| | | | | | | | replace usages of Operation::dyn_cast with llvm::dyn_cast. -- PiperOrigin-RevId: 247778391
* Cleanups and simplifications to code, noticed by inspection. NFC.Chris Lattner2019-05-201-2/+0
| | | | | | -- PiperOrigin-RevId: 247758075
* Fix up some mixed sign warnings.Jacques Pienaar2019-05-061-1/+1
| | | | | | -- PiperOrigin-RevId: 246614498
* Prepend an "affine-" prefix to Affine pass option names - NFCNicolas Vasilache2019-05-061-2/+3
| | | | | | | | | | | Trying to activate both LLVM and MLIR passes in mlir-cpu-runner showed name collisions when registering pass names. One possible way of disambiguating that should also work across dialects is to prepend the dialect name to the passes that specifically operate on that dialect. With this CL, mlir-cpu-runner tests still run when both LLVM and MLIR passes are registered -- PiperOrigin-RevId: 246539917
* Rename isa_nonnull to isa_and_nonnull to match the upstream llvm name.River Riddle2019-04-231-1/+1
| | | | | | -- PiperOrigin-RevId: 244928036
* Factor code to compute dependence components out of loop fusion pass, ↵Andy Davis2019-04-111-35/+18
| | | | | | | | and into a reusable utility function (NFC). -- PiperOrigin-RevId: 242716259
* Fix typos in LoopFusionAmit Sabne2019-04-111-14/+17
| | | | | | -- PiperOrigin-RevId: 242679298
* Add new utilities for RTTI Operation casting: dyn_cast_or_null and ↵River Riddle2019-04-071-6/+4
| | | | | | | | | | | | | | | | | | | | | isa_nonnull * dyn_cast_or_null - This will first check if the operation is null before trying to 'dyn_cast': Value *v = ...; if (auto forOp = dyn_cast_or_null<AffineForOp>(v->getDefiningOp())) ... * isa_nonnull - This will first check if the pointer is null before trying to 'isa': Value *v = ...; if (isa_nonnull<AffineForOp>(v->getDefiningOp()); ... -- PiperOrigin-RevId: 242171343
* Create a LoopUtil function to return perfectly nested loop setMLIR Team2019-04-051-10/+1
| | | | | | -- PiperOrigin-RevId: 242019230
* Enable producer-consumer fusion for liveout memrefs if consumer read ↵Andy Davis2019-04-021-17/+23
| | | | | | | | region matches producer write region. -- PiperOrigin-RevId: 241517207
* Enable input-reuse fusion to search function arguments for fusion candidates ↵MLIR Team2019-03-291-34/+82
| | | | | | (takes care of a TODO, enables another tutorial test case). PiperOrigin-RevId: 240979894
* Remove overly conservative check in LoopFusion pass (enables fusion in ↵MLIR Team2019-03-291-8/+2
| | | | | | tutorial example). PiperOrigin-RevId: 240859227
* Replace usages of Instruction with Operation in the Transforms/ directory.River Riddle2019-03-291-136/+133
| | | | PiperOrigin-RevId: 240636130
OpenPOWER on IntegriCloud