summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Analysis/AffineAnalysis.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make helper functions static or move them into anonymous namespaces. NFC.Benjamin Kramer2020-01-141-6/+7
|
* [mlir] NFC: Remove Value::operator* and Value::operator-> now that Value is ↵River Riddle2020-01-111-2/+2
| | | | | | | | | | 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-24/+24
| | | | | | 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-30/+30
| | | | | | | | | | 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: Remove unnecessary 'llvm::' prefix from uses of llvm symbols declared ↵River Riddle2019-12-181-5/+4
| | | | | | | | in `mlir` namespace. Aside from being cleaner, this also makes the codebase more consistent. PiperOrigin-RevId: 286206974
* Replace some remnant uses of "inst" with "op".Sean Silva2019-11-061-2/+2
| | | | PiperOrigin-RevId: 278961676
* Fix minor spelling tweaks (NFC)Kazuaki Ishizaki2019-10-201-8/+8
| | | | | | Closes tensorflow/mlir#177 PiperOrigin-RevId: 275692653
* Fix typos, NFC.Christian Sigg2019-10-041-1/+1
| | | | PiperOrigin-RevId: 272851237
* 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
* NFC: Standardize the terminology used for parent ops/regions/etc.River Riddle2019-08-091-2/+2
| | | | | | There are currently several different terms used to refer to a parent IR unit in 'get' methods: getParent/getEnclosing/getContaining. This cl standardizes all of these methods to use 'getParent*'. PiperOrigin-RevId: 262680287
* Rename FunctionAttr to SymbolRefAttr.River Riddle2019-07-121-0/+1
| | | | | | This allows for the attribute to hold symbolic references to other operations than FuncOp. This also allows for removing the dependence on FuncOp from the base Builder. PiperOrigin-RevId: 257650017
* NFC: Remove Region::getContainingFunction as Functions are now Operations.River Riddle2019-07-041-1/+1
| | | | PiperOrigin-RevId: 256579717
* Globally change load/store/dma_start/dma_wait operations over to ↵Andy Davis2019-07-031-8/+10
| | | | | | | | | | | 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
* Return dependence result enum to distiguish between dependence result and ↵Andy Davis2019-06-111-18/+21
| | | | | | error cases (NFC). PiperOrigin-RevId: 252437616
* Fixes a small bug in computing dependence direction vectors, where ↵Andy Davis2019-05-201-1/+4
| | | | | | | | equality constraint can be created on the wrong loop IVs when source/sink of the dependence are at different loop depths. Adds unit tests for cases where source/sink of the dependence are at varying loop depths. -- PiperOrigin-RevId: 248627490
* Replace Operation::isa with llvm::isa.River Riddle2019-05-201-3/+3
| | | | | | -- PiperOrigin-RevId: 247789235
* Remove unused `hasSingleNonZeroAt` function (NFC)Mehdi Amini2019-05-101-15/+0
| | | | | | | | Fix clang warning. -- PiperOrigin-RevId: 247623306
* 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-3/+47
| | | | | | | | and into a reusable utility function (NFC). -- PiperOrigin-RevId: 242716259
* Add new utilities for RTTI Operation casting: dyn_cast_or_null and ↵River Riddle2019-04-071-7/+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
* Adds dependence analysis support for iteration domains with local ↵Andy Davis2019-04-051-49/+56
| | | | | | | | variables (enables dependence analysis of loops with non-unit step). -- PiperOrigin-RevId: 241957023
* Replace usages of Instruction with Operation in the /Analysis directory.River Riddle2019-03-291-35/+32
| | | | PiperOrigin-RevId: 240569775
* Replace usages of Instruction with Operation in the /IR directory.River Riddle2019-03-291-5/+5
| | | | | | This is step 2/N to renaming Instruction to Operation. PiperOrigin-RevId: 240459216
* Rename the Instruction class to Operation. This just renames the class, ↵River Riddle2019-03-291-1/+1
| | | | | | | | usages of Instruction will still refer to a typedef in the interim. This is step 1/N to renaming Instruction to Operation. PiperOrigin-RevId: 240431520
* Replace usages of "operator->" with "." for the AffineOps.River Riddle2019-03-291-1/+1
| | | | | Note: The "operator->" method is a temporary helper for the de-const transition and is gradually being phased out. PiperOrigin-RevId: 240179439
* NFC: Rename the 'for' operation in the AffineOps dialect to 'affine.for' and ↵River Riddle2019-03-291-4/+4
| | | | | | set the namespace of the AffineOps dialect to 'affine'. PiperOrigin-RevId: 240165792
* Remove OpPointer, cleaning up a ton of code. This also moves Ops to usingChris Lattner2019-03-291-3/+3
| | | | | | | | | inherited constructors, which is cleaner and means you can now use DimOp() to get a null op, instead of having to use Instruction::getNull<DimOp>(). This removes another 200 lines of code. PiperOrigin-RevId: 240068113
* Remove const from Value, Instruction, Argument, and the various methods on theChris Lattner2019-03-291-14/+14
| | | | | | *Op classes. This is a net reduction by almost 400LOC. PiperOrigin-RevId: 239972443
* Remove const from mlir::Block.Chris Lattner2019-03-291-4/+4
| | | | | | This also eliminates some incorrect reinterpret_cast logic working around it, and numerous const-incorrect issues (like block argument iteration). PiperOrigin-RevId: 239712029
* Fix misc bugs / TODOs / other improvements to analysis utilsUday Bondhugula2019-03-291-0/+1
| | | | | | | | | | | | | | - fix for getConstantBoundOnDimSize: floordiv -> ceildiv for extent - make getConstantBoundOnDimSize also return the identifier upper bound - fix unionBoundingBox to correctly use the divisor and upper bound identified by getConstantBoundOnDimSize - deal with loop step correctly in addAffineForOpDomain (covers most cases now) - fully compose bound map / operands and simplify/canonicalize before adding dim/symbol to FlatAffineConstraints; fixes false positives in -memref-bound-check; add test case there - expose mlir::isTopLevelSymbol from AffineOps PiperOrigin-RevId: 238050395
* Move the success/failure functions out of LogicalResult and into the mlir ↵River Riddle2019-03-291-5/+5
| | | | | | namespace. PiperOrigin-RevId: 237712180
* Rename Status to LogicalResult to avoid conflictions with the Status in ↵River Riddle2019-03-291-10/+10
| | | | | | xla/tensorflow/etc. PiperOrigin-RevId: 237537341
* Convert ambiguous bool returns in /Analysis to use Status instead.River Riddle2019-03-291-23/+23
| | | | PiperOrigin-RevId: 237390240
* NFC. Move all of the remaining operations left in BuiltinOps to StandardOps. ↵River Riddle2019-03-291-1/+0
| | | | | | The only thing left in BuiltinOps are the core MLIR types. The standard types can't be moved because they are referenced within the IR directory, e.g. in things like Builder. PiperOrigin-RevId: 236403665
* Use consistent names for dialect op source filesLei Zhang2019-03-291-1/+1
| | | | | | | | | | | | | | | This CL changes dialect op source files (.h, .cpp, .td) to follow the following convention: <full-dialect-name>/<dialect-namespace>Ops.{h|cpp|td} Builtin and standard dialects are specially treated, though. Both of them do not have dialect namespace; the former is still named as BuiltinOps.* and the latter is named as Ops.*. Purely mechanical. NFC. PiperOrigin-RevId: 236371358
* Loop fusion for input reuse.MLIR Team2019-03-291-3/+7
| | | | | | | | | | | | | *) Breaks fusion pass into multiple sub passes over nodes in data dependence graph: - first pass fuses single-use producers into their unique consumer. - second pass enables fusing for input-reuse by fusing sibling nodes which read from the same memref, but which do not share dependence edges. - third pass fuses remaining producers into their consumers (Note that the sibling fusion pass may have transformed a producer with multiple uses into a single-use producer). *) Fusion for input reuse is enabled by computing a sibling node slice using the load/load accesses to the same memref, and fusion safety is guaranteed by checking that the sibling node memref write region (to a different memref) is preserved. *) Enables output vector and output matrix computations from KFAC patches-second-moment operation to fuse into a single loop nest and reuse input from the image patches operation. *) Adds a generic loop utilitiy for finding all sequential loops in a loop nest. *) Adds and updates unit tests. PiperOrigin-RevId: 236350987
* Use Instruction::isBeforeInBlock instead of a linear scanUday Bondhugula2019-03-291-15/+7
| | | | | | | - use Instruction::isBeforeInBlock instead of a linear scan in AffineAnalysis.cpp PiperOrigin-RevId: 236235824
* Refactor AffineExprFlattener and move FlatAffineConstraints out of IR intoUday Bondhugula2019-03-291-2/+2
| | | | | | | | | | | | | | | | | Analysis - NFC - refactor AffineExprFlattener (-> SimpleAffineExprFlattener) so that it doesn't depend on FlatAffineConstraints, and so that FlatAffineConstraints could be moved out of IR/; the simplification that the IR needs for AffineExpr's doesn't depend on FlatAffineConstraints - have AffineExprFlattener derive from SimpleAffineExprFlattener to use for all Analysis/Transforms purposes; override addLocalFloorDivId in the derived class - turn addAffineForOpDomain into a method on FlatAffineConstraints - turn AffineForOp::getAsValueMap into an AffineValueMap ctor PiperOrigin-RevId: 235283610
* Update direction vector computation to use ↵MLIR Team2019-03-291-48/+8
| | | | | | | | FlatAffineConstraints::getLower/UpperBounds. Update FlatAffineConstraints::getLower/UpperBounds to project to the identifier for which bounds are being computed. This change enables computing bounds on an identifier which were previously dependent on the bounds of another identifier. PiperOrigin-RevId: 234017514
* Automated rollback of changelist 232717775.Uday Bondhugula2019-03-291-4/+4
| | | | PiperOrigin-RevId: 232807986
* NFC: Rename the 'for' operation in the AffineOps dialect to 'affine.for'. ↵River Riddle2019-03-291-4/+4
| | | | | | The is the second step to adding a namespace to the AffineOps dialect. PiperOrigin-RevId: 232717775
* NFC: Rename affine_apply to affine.apply. This is the first step to adding a ↵River Riddle2019-03-291-2/+2
| | | | | | namespace to the affine dialect. PiperOrigin-RevId: 232707862
* Refactor the affine analysis by moving some functionality to IR and some to ↵River Riddle2019-03-291-663/+2
| | | | | | | | | | | | | | AffineOps. This is important for allowing the affine dialect to define canonicalizations directly on the operations instead of relying on transformation passes, e.g. ComposeAffineMaps. A summary of the refactoring: * AffineStructures has moved to IR. * simplifyAffineExpr/simplifyAffineMap/getFlattenedAffineExpr have moved to IR. * makeComposedAffineApply/fullyComposeAffineMapAndOperands have moved to AffineOps. * ComposeAffineMaps is replaced by AffineApplyOp::canonicalize and deleted. PiperOrigin-RevId: 232586468
* NFC: Move AffineApplyOp to the AffineOps dialect. This also moves the ↵River Riddle2019-03-291-3/+3
| | | | | | isValidDim/isValidSymbol methods from Value to the AffineOps dialect. PiperOrigin-RevId: 232386632
* Refactor common code getting memref access in getMemRefRegion - NFCUday Bondhugula2019-03-291-1/+2
| | | | | | | | | | | | | | | - use getAccessMap() instead of repeating it - fold getMemRefRegion into MemRefRegion ctor (more natural, avoid heap allocation and unique_ptr where possible) - change extractForInductionVars - MutableArrayRef -> ArrayRef for the arguments. Since the method is just returning copies of 'Value *', the client can't mutate the pointers themselves; it's fine to mutate the 'Value''s themselves, but that doesn't mutate the pointers to those. - change the way extractForInductionVars returns (see b/123437690) PiperOrigin-RevId: 232359277
* Update MemRefAccess::getAccessMap to always canonicalize map + operandsUday Bondhugula2019-03-291-0/+1
| | | | | | | | | | - with this we won't see duplicate / unused operands when getting access maps, or when constructing FlatAffineConstraints based on such maps - we can probably change fullyComposeAffineMapAndOperands to ensure this TODO(b/123879896). PiperOrigin-RevId: 232356600
* Begin the process of fully removing OperationInst. This patch cleans up ↵River Riddle2019-03-291-3/+3
| | | | | | references to OperationInst in the /include, /AffineOps, and lib/Analysis. PiperOrigin-RevId: 232199262
* Fold the functionality of OperationInst into Instruction. OperationInst ↵River Riddle2019-03-291-1/+1
| | | | | | still exists as a forward declaration and will be removed incrementally in a set of followup cleanup patches. PiperOrigin-RevId: 232198540
OpenPOWER on IntegriCloud