summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove unused MLIRContext member from MutableAffineMap class (NFC)Mehdi Amini2019-05-101-3/+2
| | | | | | | | Fix clang warning -- PiperOrigin-RevId: 247558650
* Add memref dimension bounds as upper/lower bounds on MemRefRegion ↵Andy Davis2019-05-101-2/+18
| | | | | | | | constraints, to guard against potential over-approximation from projection. -- PiperOrigin-RevId: 247431201
* Simplify the emission of various diagnostics created in Analysis/ and ↵River Riddle2019-05-102-6/+6
| | | | | | | | Transforms/ by using the new diagnostic infrastructure. -- PiperOrigin-RevId: 246955332
* Fix up some mixed sign warnings.Jacques Pienaar2019-05-061-1/+1
| | | | | | -- PiperOrigin-RevId: 246614498
* Add the ability to attach notes to Diagnostic/InFlightDiagnostic.River Riddle2019-05-061-3/+3
| | | | | | | | | | | | | Notes are a way to add additional context to a diagnostic, but don't really make sense as standalone diagnostics. Moving forward, notes will no longer be able to be constructed directly and must be attached to a parent Diagnostic. Notes can be attached via `attachNote`: auto diag = ...; diag.attachNote() << "This is a note"; -- PiperOrigin-RevId: 246545971
* Add support for basic remark diagnostics. This is the minimal ↵River Riddle2019-05-063-3/+3
| | | | | | | | functionality needed to separate notes from remarks. It also provides a starting point to start building out better remark infrastructure. -- PiperOrigin-RevId: 246175216
* Rename isa_nonnull to isa_and_nonnull to match the upstream llvm name.River Riddle2019-04-231-1/+1
| | | | | | -- PiperOrigin-RevId: 244928036
* Remove checks guaranteed to be true by the typeLei Zhang2019-04-111-1/+1
| | | | | | | | | This addresses the compiler wraning of "comparison of unsigned expression >= 0 is always true [-Wtype-limits]". -- PiperOrigin-RevId: 242868703
* 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-073-22/+12
| | | | | | | | | | | | | | | | | | | | | 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
* NFC: Replace usages of iterator_range<operand_iterator> with operand_range.River Riddle2019-04-051-1/+1
| | | | | | -- PiperOrigin-RevId: 242031201
* Fix a few warnings for missing parentheses around '||' and extra semicolons.River Riddle2019-04-051-3/+3
| | | | | | -- PiperOrigin-RevId: 241994767
* Remove the non-postorder walk functions from Function/Block/Instruction ↵River Riddle2019-04-051-1/+1
| | | | | | | | and rename walkPostOrder to walk. -- PiperOrigin-RevId: 241965239
* Adds dependence analysis support for iteration domains with local ↵Andy Davis2019-04-052-49/+59
| | | | | | | | variables (enables dependence analysis of loops with non-unit step). -- PiperOrigin-RevId: 241957023
* Update the dialect attribute verification hooks to return LogicalResult ↵River Riddle2019-04-021-5/+5
| | | | | | | | instead of bool. This updates Function::emitError to return LogicalResult as well. -- PiperOrigin-RevId: 241598892
* Rewrite the verify hooks on operations to use LogicalResult instead of ↵River Riddle2019-04-021-1/+1
| | | | | | | | bool. This also changes the return of Operation::emitError/emitOpError to LogicalResult as well. -- PiperOrigin-RevId: 241588075
* Update the Function and Module verifiers to return LogicalResult instead ↵River Riddle2019-04-021-65/+64
| | | | | | | | of bool. -- PiperOrigin-RevId: 241553930
* Add a flag to Dialect that allows for dialects to enable support for ↵River Riddle2019-04-011-10/+39
| | | | | | | | | | | | | | | | | | | unregistered operations. This flag is off by default and can be toggled via the 'allowUnknownOperations(...)' method. This means that moving forward an error will be emitted for unknown operations if the dialect does not explicitly allow it. Example: func @unknown_std_op() { %0 = "std.foo_bar_op"() : () -> index return } Will result in: error: unregistered operation 'std.foo_bar_op' found in dialect ('std') that does not allow unknown operations -- PiperOrigin-RevId: 241266009
* Add build files and update README.Jacques Pienaar2019-03-301-0/+20
| | | | | | | | | * Add initial version of build files; * Update README with instructions to download and build MLIR from github; -- PiperOrigin-RevId: 241102092
* Cleanup SuperVectorization dialect printing and parsing.Nicolas Vasilache2019-03-292-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | On the read side, ``` %3 = vector_transfer_read %arg0, %i2, %i1, %i0 {permutation_map: (d0, d1, d2)->(d2, d0)} : (memref<?x?x?xf32>, index, index, index) -> vector<32x256xf32> ``` becomes: ``` %3 = vector_transfer_read %arg0[%i2, %i1, %i0] {permutation_map: (d0, d1, d2)->(d2, d0)} : memref<?x?x?xf32>, vector<32x256xf32> ``` On the write side, ``` vector_transfer_write %0, %arg0, %c3, %c3 {permutation_map: (d0, d1)->(d0)} : vector<128xf32>, memref<?x?xf32>, index, index ``` becomes ``` vector_transfer_write %0, %arg0[%c3, %c3] {permutation_map: (d0, d1)->(d0)} : vector<128xf32>, memref<?x?xf32> ``` Documentation will be cleaned up in a followup commit that also extracts a proper .md from the top of the file comments. PiperOrigin-RevId: 241021879
* Refactor vectorization patternsNicolas Vasilache2019-03-292-51/+62
| | | | | | | | | | This CL removes the reliance of the vectorize pass on the specification of a `fastestVaryingDim` parameter. This parameter is a restriction meant to more easily target a particular loop/memref combination for vectorization and is mainly used for testing. This also had the side-effect of restricting vectorization patterns to only the ones in which all memrefs were contiguous along the same loop dimension. This simple restriction prevented matmul to vectorize in 2-D. this CL removes the restriction and adds the matmul test which vectorizes in 2-D along the parallel loops. Support for reduction loops is left for future work. PiperOrigin-RevId: 240993827
* Rename InstOperand to OpOperand.River Riddle2019-03-291-1/+1
| | | | PiperOrigin-RevId: 240814651
* Make vectorization aware of loop semanticsNicolas Vasilache2019-03-292-33/+15
| | | | | | Now that we have a dependence analysis, we can check that loops are indeed parallel and make vectorization correct. PiperOrigin-RevId: 240682727
* Give the Vectorize pass a virtualVectorSize argument.Nicolas Vasilache2019-03-291-12/+9
| | | | | | | This CL allows vectorization to be called and configured in other ways than just via command line arguments. This allows triggering vectorization programmatically. PiperOrigin-RevId: 240638208
* Replace usages of Instruction with Operation in the /Analysis directory.River Riddle2019-03-2911-262/+254
| | | | PiperOrigin-RevId: 240569775
* Introduce affine terminatorAlex Zinenko2019-03-291-12/+1
| | | | | | | | | | | | | | | | | | | | | | Due to legacy reasons (ML/CFG function separation), regions in affine control flow operations require contained blocks not to have terminators. This is inconsistent with the notion of the block and may complicate code motion between regions of affine control operations and other regions. Introduce `affine.terminator`, a special terminator operation that must be used to terminate blocks inside affine operations and transfers the control back to he region enclosing the affine operation. For brevity and readability reasons, allow `affine.for` and `affine.if` to omit the `affine.terminator` in their regions when using custom printing and parsing format. The custom parser injects the `affine.terminator` if it is missing so as to always have it present in constructed operations. Update transformations to account for the presence of terminator. In particular, most code motion transformation between loops should leave the terminator in place, and code motion between loops and non-affine blocks should drop the terminator. PiperOrigin-RevId: 240536998
* Replace usages of Instruction with Operation in the /IR directory.River Riddle2019-03-297-28/+28
| | | | | | 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-298-8/+8
| | | | | | | | 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
* Make FunctionPass::getFunction() return a reference to the function, instead ofChris Lattner2019-03-293-4/+4
| | | | | | | a pointer. This makes it consistent with all the other methods in FunctionPass, as well as with ModulePass::getModule(). NFC. PiperOrigin-RevId: 240257910
* Replace usages of "Op::operator->" with ".".River Riddle2019-03-293-19/+19
| | | | | | This is step 2/N of removing the temporary operator-> method as part of the de-const transition. PiperOrigin-RevId: 240200792
* Replace usages of "operator->" with "." for the AffineOps.River Riddle2019-03-297-56/+56
| | | | | 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-293-11/+12
| | | | | | set the namespace of the AffineOps dialect to 'affine'. PiperOrigin-RevId: 240165792
* Using getContext() instead of getInstruction()->getContext() on Operation (NFC)Mehdi Amini2019-03-291-1/+1
| | | | PiperOrigin-RevId: 240088209
* Various small cleanups to the code, mostly removing const_cast's.Chris Lattner2019-03-293-11/+10
| | | | PiperOrigin-RevId: 240083489
* NFC: Rename the 'if' operation in the AffineOps dialect to 'affine.if'.River Riddle2019-03-291-1/+1
| | | | PiperOrigin-RevId: 240071154
* Remove OpPointer, cleaning up a ton of code. This also moves Ops to usingChris Lattner2019-03-295-63/+48
| | | | | | | | | 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-298-80/+72
| | | | | | *Op classes. This is a net reduction by almost 400LOC. PiperOrigin-RevId: 239972443
* Now that ConstOpPointer is gone, we can change the various methods generated byChris Lattner2019-03-291-1/+1
| | | | | | | | | | tblgen be non-const. This requires introducing some const_cast's at the moment, but those (and lots more stuff) will disappear in subsequent patches. This significantly simplifies those patches because the various tblgen op emitters get adjusted. PiperOrigin-RevId: 239954566
* Remove const from mlir::Block.Chris Lattner2019-03-294-26/+21
| | | | | | This also eliminates some incorrect reinterpret_cast logic working around it, and numerous const-incorrect issues (like block argument iteration). PiperOrigin-RevId: 239712029
* Continue pushing const out of the core IR types - in this case, remove constChris Lattner2019-03-291-6/+6
| | | | | | from Function. PiperOrigin-RevId: 239638635
* Continue pushing const out of the IR types - removing the notion of a 'constChris Lattner2019-03-291-1/+1
| | | | | | Module'. NFC. PiperOrigin-RevId: 239532885
* Move to new `const` model, part 1: remove ConstOpPointer.Chris Lattner2019-03-293-16/+13
| | | | | | | | This eliminate ConstOpPointer (but keeps OpPointer for now) by making OpPointer implicitly launder const in a const incorrect way. It will eventually go away entirely, this is a progressive step towards the new const model. PiperOrigin-RevId: 239512640
* Remove some statements that required >C++11, add includes and qualify names. ↵Jacques Pienaar2019-03-294-8/+8
| | | | | | NFC. PiperOrigin-RevId: 239197784
* Cleanups Vectorize and SliceAnalysis - NFCNicolas Vasilache2019-03-291-25/+34
| | | | | | This CL cleans up and refactors super-vectorization and slice analysis. PiperOrigin-RevId: 238986866
* Rename BlockList into RegionAlex Zinenko2019-03-294-23/+23
| | | | | | NFC. This is step 1/n to specifying regions as parts of any operation. PiperOrigin-RevId: 238472370
* Change parallelism detection test pass to emit a noteUday Bondhugula2019-03-291-10/+10
| | | | | | | - emit a note on the loop being parallel instead of setting a loop attribute - rename the pass -test-detect-parallel (from -detect-parallel) PiperOrigin-RevId: 238122847
* Change getMemoryFootprintBytes emitError to a warningUday Bondhugula2019-03-291-1/+3
| | | | | | | | - this is really not a hard error; emit a warning instead (for inability to compute footprint due to the union failing due to unimplemented cases) - remove a misleading warning from LoopFusion.cpp PiperOrigin-RevId: 238118711
* Fix misc bugs / TODOs / other improvements to analysis utilsUday Bondhugula2019-03-293-48/+96
| | | | | | | | | | | | | | - 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
* NFC: Remove a stray print in mlir::buildTripCountMapAndOperands.River Riddle2019-03-291-1/+1
| | | | PiperOrigin-RevId: 238033349
* Extend loop unrolling and unroll-jamming to non-matching bound operands andUday Bondhugula2019-03-291-53/+107
| | | | | | | | | | | | | | | | | | | | | multi-result upper bounds, complete TODOs, fix/improve test cases. - complete TODOs for loop unroll/unroll-and-jam. Something as simple as "for %i = 0 to %N" wasn't being unrolled earlier (unless it had been written as "for %i = ()[s0] -> (0)()[%N] to %N"; addressed now. - update/replace getTripCountExpr with buildTripCountMapAndOperands; makes it more powerful as it composes inputs into it - getCleanupLowerBound and getUnrolledLoopUpperBound actually needed the same code; refactor and remove one. - reorganize test cases, write previous ones better; most of these changes are "label replacements". - fix wrongly labeled test cases in unroll-jam.mlir PiperOrigin-RevId: 238014653
OpenPOWER on IntegriCloud