summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
...
* NFC: Move LLVMIR, SDBM, and StandardOps to the Dialect/ directory.River Riddle2019-08-198-8/+8
| | | | PiperOrigin-RevId: 264193915
* Change from llvm::make_unique to std::make_uniqueJacques Pienaar2019-08-173-3/+3
| | | | | | | | 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
* NFC: Standardize the terminology used for parent ops/regions/etc.River Riddle2019-08-093-4/+4
| | | | | | 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
* Add a higher-order vector.extractelement operation in MLIRNicolas Vasilache2019-08-092-3/+4
| | | | | | | | This CL is step 2/n towards building a simple, programmable and portable vector abstraction in MLIR that can go all the way down to generating assembly vector code via LLVM's opt and llc tools. This CL adds the vector.extractelement operation to the MLIR vector dialect as well as the appropriate roundtrip test. Lowering to LLVM will occur in the following CL. PiperOrigin-RevId: 262545089
* Fix clang 5.0 by using type aliases for LLVM DenseSet/MapMehdi Amini2019-08-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | When inlining the declaration for llvm::DenseSet/DenseMap in the mlir namespace from a forward declaration, clang does not take the default for the template parameters if their are declared later. namespace llvm { template<typename Foo> class DenseMap; } namespace mlir { using llvm::DenseMap; } namespace llvm { template<typename Foo = int> class DenseMap {}; } namespace mlir { DenseMap<> map; } PiperOrigin-RevId: 261495612
* Fix backward slice corner caseNicolas Vasilache2019-07-261-3/+7
| | | | | | | In the backward slice computation, BlockArgument coming from function arguments represent a natural boundary for the traversal and should not trigger llvm_unreachable. This CL also improves the error message and adds a relevant test. PiperOrigin-RevId: 260118630
* Fix backward slice computation to iterate through known control flowNicolas Vasilache2019-07-251-2/+15
| | | | | | | | | This CL fixes an oversight with dealing with loops in slicing analysis. The forward slice computation properly propagates through loops but not the backward slice. Add relevant unit tests. PiperOrigin-RevId: 259903396
* Affine loop parallelism detection: conservatively handle unknown opsAlex Zinenko2019-07-232-1/+11
| | | | | | | | | | | | | | | | | The loop parallelism detection utility only collects the affine.load and affine.store operations appearing inside the loop to analyze the access patterns for the absence of dependences. However, any operation, including unregistered operations, can appear in a body of an affine loop. If such operation has side effects, the result of parallelism analysis is incorrect. Conservatively assume affine loops are not parallel in presence of operations other than affine.load, affine.store, affine.for, affine.terminator that may have side effects. This required to update the loop-fusion unit test that relies on parallelism analysis and was exercising loop fusion in presence of an unregistered operation. PiperOrigin-RevId: 259560935
* Uniformize the API for the mlir::tile functions on AffineForOp and loop::ForOpNicolas Vasilache2019-07-192-3/+13
| | | | | | | | | | | This CL adapts the recently introduced parametric tiling to have an API matching the tiling of AffineForOp. The transformation using stripmineSink is more general and produces imperfectly nested loops. Perfect nesting invariants of the tiled version are obtained by selectively applying hoisting of ops to isolate perfectly nested bands. Such hoisting may fail to produce a perfect loop nest in cases where ForOp transitively depend on enclosing induction variables. In such cases, the API provides a LogicalResult return but the SimpleParametricLoopTilingPass does not currently use this result. A new unit test is added with a triangular loop for which the perfect nesting property does not hold. For this example, the old behavior was to produce IR that did not verify (some use was not dominated by its def). PiperOrigin-RevId: 258928309
* 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: Rename Function to FuncOp.River Riddle2019-07-101-1/+1
| | | | PiperOrigin-RevId: 257293379
* NFC: Remove `Module::getFunctions` in favor of a general `getOps<T>`.River Riddle2019-07-081-2/+2
| | | | | | Modules can now contain more than just Functions, this just updates the iteration API to reflect that. The 'begin'/'end' methods have also been updated to iterate over opaque Operations. PiperOrigin-RevId: 257099084
* Remove dead code.Jacques Pienaar2019-07-081-7/+0
| | | | PiperOrigin-RevId: 257012369
* NFC: Remove Region::getContainingFunction as Functions are now Operations.River Riddle2019-07-041-1/+1
| | | | PiperOrigin-RevId: 256579717
* Replace the implementation of Function and Module with FuncOp and ModuleOp.River Riddle2019-07-032-151/+18
| | | | | | This is an important step in allowing for the top-level of the IR to be extensible. FuncOp and ModuleOp contain all of the necessary functionality, while using the existing operation infrastructure. As an interim step, many of the usages of Function and Module, including the name, will remain the same. In the future, many of these will be relaxed to allow for many different types of top-level operations to co-exist. PiperOrigin-RevId: 256427100
* Globally change load/store/dma_start/dma_wait operations over to ↵Andy Davis2019-07-037-58/+67
| | | | | | | | | | | 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: Move the Function/Module/Operation::verify methods out-of-line.River Riddle2019-07-021-31/+33
| | | | | | As Functions/Modules becomes operations, these methods will conflict with the 'verify' hook already on derived operation types. PiperOrigin-RevId: 256246112
* Generalize the CFG graph printing for Functions to work on Regions instead.River Riddle2019-07-011-0/+6
| | | | PiperOrigin-RevId: 256029944
* NFC: Refactor Function to be value typed.River Riddle2019-07-014-14/+13
| | | | | | 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
* Extract the automatic function renaming and symbol table out of Module.River Riddle2019-07-011-1/+12
| | | | | | This functionality is now moved to a new class, ModuleManager. This class allows for inserting functions into a module, and will auto-rename them on insert to ensure a unique name. This now means that users adding new functions to a module must ensure that the function name is unique, as the Module will no longer do it automatically. This also means that Module::getNamedFunction now operates in O(N) instead of the O(c) time it did before. This simplifies the move of Modules to Operations as the ModuleOp will not be able to have this functionality. PiperOrigin-RevId: 255846088
* Move the emitError/Warning/Remark utility methods out of MLIRContext and ↵River Riddle2019-06-251-3/+3
| | | | | | | | into the mlir namespace. Now that Locations are attributes, they have direct access to the MLIR context. This allows for simplifying error emission by removing unnecessary context lookups. PiperOrigin-RevId: 255112791
* LoopFusion: adds support for computing forward computation slices, which ↵Andy Davis2019-06-192-107/+191
| | | | | | will enable fusion of consumer loop nests into their producers in subsequent CLs. PiperOrigin-RevId: 253601994
* Add a general Operation::verify that verifies an operation instance and the ↵River Riddle2019-06-112-18/+50
| | | | | | dominance of operations in any nested regions. PiperOrigin-RevId: 252529850
* Return dependence result enum to distiguish between dependence result and ↵Andy Davis2019-06-113-27/+34
| | | | | | error cases (NFC). PiperOrigin-RevId: 252437616
* NFC: Cleanup FuncVerifier and refactor it into a general OperationVerifier. ↵River Riddle2019-06-091-143/+138
| | | | | | The function specific verification has been moved into Function::verify. This is in preparation for adding a general Operation::verify method. PiperOrigin-RevId: 252065646
* Support constructing DominanceInfo with an Operation. This computes the ↵River Riddle2019-06-091-1/+19
| | | | | | dominance information for any nested regions within the operation. PiperOrigin-RevId: 251896520
* NFC: Rename FuncBuilder to OpBuilder and refactor to take a top level region ↵River Riddle2019-06-093-3/+3
| | | | | | instead of a function. PiperOrigin-RevId: 251563898
* Add a utility function to OperationName for extracting the dialect name.River Riddle2019-06-031-3/+2
| | | | PiperOrigin-RevId: 251333376
* Some cleanup of ShapedType now that MemRef subclasses it.Geoffrey Martin-Noble2019-06-011-1/+1
| | | | | | | | | | | Extract common methods into ShapedType. Simplify methods. Remove some extraneous asserts. Replace sentinel value with a helper method to check the same. -- PiperOrigin-RevId: 250945261
* Replace checks against numDynamicDims with hasStaticShapeGeoffrey Martin-Noble2019-06-011-1/+1
| | | | | | -- PiperOrigin-RevId: 250782165
* Remove "size" property of affine maps.MLIR Team2019-06-013-17/+12
| | | | | | -- PiperOrigin-RevId: 250572818
* LoopFusionUtils CL 2/n: Factor out and generalize slice union computation.Andy Davis2019-06-012-9/+163
| | | | | | | | | | | *) 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
* NFC: Switch std::vector to SmallVector. This fixes a compiler error on ↵River Riddle2019-06-011-1/+1
| | | | | | | | MSVC as the StringMap key dereference method is non-const. -- PiperOrigin-RevId: 250538085
* Address some build warnings.Jacques Pienaar2019-06-011-1/+2
| | | | | | -- PiperOrigin-RevId: 249986120
* Refactor FunctionAttr to hold the internal function reference by name ↵River Riddle2019-06-011-33/+0
| | | | | | | | | | | | | | | | instead of pointer. The one downside to this is that the function reference held by a FunctionAttr needs to be explicitly looked up from the parent module. This provides several benefits though: * There is no longer a need to explicitly remap function attrs. - This removes a potentially expensive call from the destructor of Function. - This will enable some interprocedural transformations to now run intraprocedurally. - This wasn't scalable and forces dialect defined attributes to override a virtual function. * Replacing a function is now a trivial operation. * This is a necessary first step to representing functions as operations. -- PiperOrigin-RevId: 249510802
* Drop AffineExpr::NullAlex Zinenko2019-06-011-2/+2
| | | | | | | | | | | Similarly to other value-type wrappers, the default constructor of AffineExpr constructs a null object and removes the need for an explicit ::Null constructor. Drop it and remove the only user which can trivially rely on the default constructor. -- PiperOrigin-RevId: 249207502
* Add user iterators to IRObjects, i.e. Values.River Riddle2019-05-202-12/+6
| | | | | | -- PiperOrigin-RevId: 248877752
* 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
* Remove unnecessary C++ specifier in CPP files. NFC.Jacques Pienaar2019-05-203-3/+3
| | | | | | | | These are only required in .h files to disambiguate between C and C++ header files. -- PiperOrigin-RevId: 248219135
* Remove unused function and avoid unused variable warning. NFC.Jacques Pienaar2019-05-201-0/+1
| | | | | | -- PiperOrigin-RevId: 247991231
* Update cmakelist to reflect renamed filename.Jacques Pienaar2019-05-201-1/+1
| | | | | | -- PiperOrigin-RevId: 247946677
* Replace Operation::isa with llvm::isa.River Riddle2019-05-206-18/+18
| | | | | | -- PiperOrigin-RevId: 247789235
* Replace Operation::cast with llvm::cast.River Riddle2019-05-203-4/+4
| | | | | | -- PiperOrigin-RevId: 247785983
* Add support for using llvm::dyn_cast/cast/isa for operation casts and ↵River Riddle2019-05-205-17/+17
| | | | | | | | replace usages of Operation::dyn_cast with llvm::dyn_cast. -- PiperOrigin-RevId: 247780086
* Automated rollback of changelist 247778391.MLIR Team2019-05-205-17/+17
| | | | PiperOrigin-RevId: 247778691
* Add support for using llvm::dyn_cast/cast/isa for operation casts and ↵River Riddle2019-05-205-17/+17
| | | | | | | | replace usages of Operation::dyn_cast with llvm::dyn_cast. -- PiperOrigin-RevId: 247778391
* rename -memref-dependence-check to -test-memref-dependence-check since itChris Lattner2019-05-201-13/+13
| | | | | | | | | | | | generates remarks for testing, it isn't itself a transformation. While there, upgrade its diagnostic emission to use the streaming interface. Prune some unnecessary #includes. -- PiperOrigin-RevId: 247768062
* Cleanups and simplifications to code, noticed by inspection. NFC.Chris Lattner2019-05-201-2/+0
| | | | | | -- PiperOrigin-RevId: 247758075
* Remove extra `;` after function definition (NFC)Mehdi Amini2019-05-101-1/+1
| | | | | | | | Fix a GCC warning -- PiperOrigin-RevId: 247670176
* Remove unused `hasSingleNonZeroAt` function (NFC)Mehdi Amini2019-05-101-15/+0
| | | | | | | | Fix clang warning. -- PiperOrigin-RevId: 247623306
OpenPOWER on IntegriCloud