summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * Don't leak TargetMachine in ExecutionEngine::setupTargetTripleMLIR Team2019-09-101-2/+2
| | | | | | | | PiperOrigin-RevId: 268361054
| * Add folding rule for spv.CompositeExtractLei Zhang2019-09-103-1/+77
| | | | | | | | | | | | | | | | If the composite is a constant, we can fold it away. This only supports vector and array constants for now, given that struct constant is not supported in spv.constant yet. PiperOrigin-RevId: 268350340
| * Remove the constraint that min / max should stride zeroFeng Liu2019-09-103-39/+50
| | | | | | | | | | | | | | | | | | | | | | | | Since we apply nudging for the zero point to make sure the nudged zerop points can be in the range of [qmin, qmax], the constraint that rmin / rmax should stride zero isn't necessary. This also matches the documentation of tensorflow's FakeQuantWithMinMaxArgs op, where min and max don't need to stride zero: https://www.tensorflow.org/api_docs/python/tf/quantization/fake_quant_with_min_max_args PiperOrigin-RevId: 268296285
| * Convert ConstFakeQuantPerAxis to qcast and dcast pairFeng Liu2019-09-103-27/+89
| | | | | | | | | | | | This is also to add the test to the fakeQuantAttrsToType for per-channel fake quant. PiperOrigin-RevId: 268260032
| * Remove unused variableJacques Pienaar2019-09-101-2/+1
| | | | | | | | PiperOrigin-RevId: 268173638
| * Remove redundant qualificationJacques Pienaar2019-09-091-1/+1
| | | | | | | | | | | | Address GCC error: extra qualification not allowed [-fpermissive] PiperOrigin-RevId: 268133737
| * Avoid sign-compare warningJacques Pienaar2019-09-091-3/+3
| | | | | | | | PiperOrigin-RevId: 268132321
| * Add pass generate per block in a function a GraphViz Dot graph with ops as nodesJacques Pienaar2019-09-095-0/+285
| | | | | | | | | | | | | | | | | | | | | | * Add GraphTraits that treat a block as a graph, Operation* as node and use-relationship for edges; - Just basic graph output; * Add use iterator to iterate over all uses of an Operation; * Add testing pass to generate op graph; This does not support arbitrary operations other than function nor nested regions yet. PiperOrigin-RevId: 268121782
| * Add quant.const_fake_quant_per_axis opFeng Liu2019-09-092-0/+47
| | | | | | | | | | | | | | Comparing to the existing quant.const_fake_quant op, the min and max attributes of this new op is for each channel of last dimension of the input. PiperOrigin-RevId: 268093722
| * [NFC] Rename ExpressedToUniformQuantizedType to ExpressedToQuantizedTypeFeng Liu2019-09-093-14/+12
| | | | | | | | PiperOrigin-RevId: 268090906
| * Convert per channel fake quant attributes to typeFeng Liu2019-09-092-36/+110
| | | | | | | | | | | | | | | | For per channel fake quant attributes, the returned type should be UniformQuantizedPerAxisType. Currently, this method isn't under test because we haven't added the quant_ConstFakeQuantPerAxis op and the convert method. PiperOrigin-RevId: 268084017
| * Explicitly declare the OpPassManager move constructor to avoid undefined errors.River Riddle2019-09-092-1/+2
| | | | | | | | | | | | Some compilers will try to auto-generate the destructor, instead of using the user provided destructor, when creating a default move constructor. PiperOrigin-RevId: 268067367
| * Overload LLVM::TerminatorOp::build() for empty operands list.MLIR Team2019-09-092-23/+35
| | | | | | | | PiperOrigin-RevId: 268041584
| * Add warpsize and laneid intrinsics to NVVM dialect.MLIR Team2019-09-092-0/+6
| | | | | | | | PiperOrigin-RevId: 268041263
| * Add support for coalescing adjacent nested pass pipelines.River Riddle2019-09-095-98/+202
| | | | | | | | | | | | This allows for parallelizing across pipelines of multiple operation types. AdaptorPasses can now hold pass managers for multiple operation types and will dispatch based upon the operation being operated on. PiperOrigin-RevId: 268017344
| * Addressing some late review comments on kernel inlining.Stephan Herhut2019-09-092-16/+18
| | | | | | | | | | | | Just formatting and better lit tests, no functional change. PiperOrigin-RevId: 267942907
| * Add `parseGenericOperation()` to the OpAsmParserMehdi Amini2019-09-085-0/+89
| | | | | | | | | | | | | | | | | | This method parses an operation in its generic form, from the current parser state. This is the symmetric of OpAsmPrinter::printGenericOp(). An immediate use case is illustrated in the test dialect, where an operation wraps another one in its region and makes use of a single-line pretty-print form. PiperOrigin-RevId: 267930869
| * Refactor PassTiming to support nested pipelines.River Riddle2019-09-089-77/+291
| | | | | | | | | | | | This is done via a new set of instrumentation hooks runBeforePipeline/runAfterPipeline, that signal the lifetime of a pass pipeline on a specific operation type. These hooks also provide the parent thread of the pipeline, allowing for accurate merging of timers running on different threads. PiperOrigin-RevId: 267909193
| * Use "final" instead of marking method virtual in override (NFC)Mehdi Amini2019-09-071-1/+1
| | | | | | | | | | | | | | | | This is the only example for overriding this interface in the repo, let's try to make it right as it may be taken as a reference when implemented in other dialects PiperOrigin-RevId: 267811123
| * Refactor getUsedValuesDefinedAbove to expose a variant taking a callback (NFC)Mehdi Amini2019-09-072-8/+32
| | | | | | | | | | | | | | This will allow clients to implement a different collection strategy on these values, including collecting each uses within the region for example. PiperOrigin-RevId: 267803978
| * Set mlir-cpu-runner JIT codegen opt level correctlyUday Bondhugula2019-09-073-21/+48
| | | | | | | | | | | | | | | | | | | | | | | | - the JIT codegen was being run at the default -O0 level; instead, propagate the opt level from the cmd line. Signed-off-by: Uday Bondhugula <uday@polymagelabs.com> Closes tensorflow/mlir#123 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/123 from bondhugula:jit-runner 3b055e47f94c9a48bf487f6400787478738cda02 PiperOrigin-RevId: 267778586
| * Wrap debug dump in LLVM_DEBUGMehdi Amini2019-09-071-4/+7
| | | | | | | | PiperOrigin-RevId: 267774506
| * Add doc for declarative rewrite rulesLei Zhang2019-09-072-51/+610
| | | | | | | | | | | | | | This doc serves as a manual for table-driven declarative rewrite rules. It lists all the details regarding supported mechanisms. PiperOrigin-RevId: 267761702
| * Fix typo in the documentation for tensor_cast (NFC)Mehdi Amini2019-09-061-1/+1
| | | | | | | | PiperOrigin-RevId: 267650411
| * Restrict affine inlining to just Function operations.River Riddle2019-09-061-4/+6
| | | | | | | | | | | | The current restrictions on dim/symbols require a top-level symbol for the conservative case of a non-affine region. This should be relaxed in the future. PiperOrigin-RevId: 267641838
| * Add custom builder for AffineIfOpNagy Mostafa2019-09-064-2/+51
| | | | | | | | | | | | | | Closes tensorflow/mlir#109 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/109 from nmostafa:nmostafa/AffineIfOp 7dbf2115f0092ffab26381ea8704aa05a0253971 PiperOrigin-RevId: 267633077
| * Simplify Linalg ABI integration with external function calls.Nicolas Vasilache2019-09-063-171/+154
| | | | | | | | | | | | | | View descriptors are converted to *pointer to* LLVM struct to avoid ABI issues related to C struct packing. This creates unnecessary complexity and hampers unification with memrefs. Instead, this CL makes view descriptors convert to LLVM struct (as it was originally) and promotes all structs to pointers right before calling an external function. PiperOrigin-RevId: 267602693
| * Fix typos in Interfaces.mdAlex Zinenko2019-09-061-10/+10
| | | | | | | | PiperOrigin-RevId: 267548530
| * Integer set + operands / affine if op canonicalizationUday Bondhugula2019-09-057-38/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - turn canonicalizeMapAndOperands into a template that works on both sets and maps, and use it to introduce a utility to canonicalize an affine integer set and its operands - add pattern to canonicalize affine if op's. - rename IntegerSet::getNumOperands -> IntegerSet::getNumInputs to be consistent with AffineMap - add missing accessors for IntegerSet Doesn't need extensive testing since canonicalizeSetAndOperands just reuses canonicalizeMapAndOperands' logic, and the latter is tested on affine.apply map + operands; the new method works the same way on an integer set + operands of an affine if op for example. Signed-off-by: Uday Bondhugula <uday@polymagelabs.com> Closes tensorflow/mlir#112 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/112 from bondhugula:set-canonicalize eff72f23250b96fa7d9f5caff3877440f5de2cec PiperOrigin-RevId: 267532876
| * Add support for conservatively inlining Affine operations.River Riddle2019-09-052-0/+108
| | | | | | | | | | | | This commit defines an initial implementation of the DialectInlinerInterface for the AffineOps dialect. This change allows for affine operations to be inlined into any region that is not an affine region. Inlining into affine regions requires special handling for dimension/symbol identifiers that will be added in followups. PiperOrigin-RevId: 267467078
| * [spirv] Add spv.loopLei Zhang2019-09-055-26/+572
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SPIR-V can explicitly declare structured control-flow constructs using merge instructions. These explicitly declare a header block before the control flow diverges and a merge block where control flow subsequently converges. These blocks delimit constructs that must nest, and can only be entered and exited in structured ways. Instead of having a `spv.LoopMerge` op to directly model loop merge instruction for indicating the merge and continue target, we use regions to delimit the boundary of the loop: the merge target is the next op following the `spv.loop` op and the continue target is the block that has a back-edge pointing to the entry block inside the `spv.loop`'s region. This way it's easier to discover all blocks belonging to a construct and it plays nicer with the MLIR system. Updated the SPIR-V.md doc. PiperOrigin-RevId: 267431010
| * Add the initial inlining infrastructure.River Riddle2019-09-0512-2/+859
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This defines a set of initial utilities for inlining a region(or a FuncOp), and defines a simple inliner pass for testing purposes. A new dialect interface is defined, DialectInlinerInterface, that allows for dialects to override hooks controlling inlining legality. The interface currently provides the following hooks, but these are just premilinary and should be changed/added to/modified as necessary: * isLegalToInline - Determine if a region can be inlined into one of this dialect, *or* if an operation of this dialect can be inlined into a given region. * shouldAnalyzeRecursively - Determine if an operation with regions should be analyzed recursively for legality. This allows for child operations to be closed off from the legality checks for operations like lambdas. * handleTerminator - Process a terminator that has been inlined. This cl adds support for inlining StandardOps, but other dialects will be added in followups as necessary. PiperOrigin-RevId: 267426759
| * Make GPU kernel outlining test independent of value names.Stephan Herhut2019-09-051-24/+36
| | | | | | | | PiperOrigin-RevId: 267323604
| * Generalize I32ElementsAttr definition and introduce I64ElementsAttrSmit Hinsu2019-09-043-14/+38
| | | | | | | | | | | | Also, fix constBuilderCall to return attribute of the storage class DenseIntElementsAttr PiperOrigin-RevId: 267305813
| * Use transform function on llvm::Module in the ExecutionEngineNicolas Vasilache2019-09-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The refactoring of ExecutionEngine dropped the usage of the irTransform function used to pass -O3 and other options to LLVM. As a consequence, the proper optimizations do not kick in in LLMV-land. This CL makes use of the transform function and allows producing avx512 instructions, on an internal example, when using: `mlir-cpu-runner -dump-object-file=1 -object-filename=foo.o` combined with `objdump -D foo.o`. Assembly produced resembles: ``` 2b2e: 62 72 7d 48 18 04 0e vbroadcastss (%rsi,%rcx,1),%zmm8 2b35: 62 71 7c 48 28 ce vmovaps %zmm6,%zmm9 2b3b: 62 72 3d 48 a8 c9 vfmadd213ps %zmm1,%zmm8,%zmm9 2b41: 62 f1 7c 48 28 cf vmovaps %zmm7,%zmm1 2b47: 62 f2 3d 48 a8 c8 vfmadd213ps %zmm0,%zmm8,%zmm1 2b4d: 62 f2 7d 48 18 44 0e vbroadcastss 0x4(%rsi,%rcx,1),%zmm0 2b54: 01 2b55: 62 71 7c 48 28 c6 vmovaps %zmm6,%zmm8 2b5b: 62 72 7d 48 a8 c3 vfmadd213ps %zmm3,%zmm0,%zmm8 2b61: 62 f1 7c 48 28 df vmovaps %zmm7,%zmm3 2b67: 62 f2 7d 48 a8 da vfmadd213ps %zmm2,%zmm0,%zmm3 2b6d: 62 f2 7d 48 18 44 0e vbroadcastss 0x8(%rsi,%rcx,1),%zmm0 2b74: 02 2b75: 62 f2 7d 48 a8 f5 vfmadd213ps %zmm5,%zmm0,%zmm6 2b7b: 62 f2 7d 48 a8 fc vfmadd213ps %zmm4,%zmm0,%zmm7 ``` etc. Fixes tensorflow/mlir#120 PiperOrigin-RevId: 267281097
| * Updated StructAttr to use the struct name for StorageType and ReturnType.Rob Suderman2019-09-041-0/+6
| | | | | | | | PiperOrigin-RevId: 267266687
| * Retain address space during MLIR > LLVM conversion.MLIR Team2019-09-042-12/+20
| | | | | | | | PiperOrigin-RevId: 267206460
| * Move LLVMIR dialect tests from test/LLVMIR to test/Dialect and test/ConversionAlex Zinenko2019-09-0410-0/+0
| | | | | | | | | | | | | | | | | | | | | | This follows up on the recent restructuring that moved the dialects under lib/Dialect and inter-dialect conversions to lib/Conversion. Originally, the tests for both the LLVMIR dialect itself and the conversion from Standard to LLVMIR dialect lived under test/LLVMIR. This no longer reflects the code structure. Move the tests to either test/Dialect/LLVMIR or test/Conversion/StandardToLLVM depending on the features they exercise. PiperOrigin-RevId: 267159219
| * Make isIsolatedAbove robuster to invalid IRJacques Pienaar2019-09-041-0/+9
| | | | | | | | | | | | This function is only called from the verifier. PiperOrigin-RevId: 267145495
| * pipeline-data-transfer: remove dead tag alloc's and improve test coverage ↵Uday Bondhugula2019-09-044-35/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for replaceMemRefUsesWith / pipeline-data-transfer - address remaining comments from PR tensorflow/mlir#87 for better test coverage for pipeline-data-transfer/replaceAllMemRefUsesWith - remove dead tag allocs the same way they are removed for the replaced buffers Signed-off-by: Uday Bondhugula <uday@polymagelabs.com> Closes tensorflow/mlir#106 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/106 from bondhugula:followup 9e868666d047e8d43e5f82f43e4093b838c710fa PiperOrigin-RevId: 267144774
| * Move Linalg dialect tests to test/Dialect/LinalgAlex Zinenko2019-09-0410-0/+0
| | | | | | | | | | | | This was missing from the commit that moved the Linalg dialect to lib/Dialect. PiperOrigin-RevId: 267141176
| * Make GPU kernel outlining inline constants.Stephan Herhut2019-09-042-2/+60
| | | | | | | | | | | | | | It is generally beneficial to pass less arguments to a kernel, so cloning constants into the kernel is beneficial. PiperOrigin-RevId: 267139084
| * Add support for array-typed constants.MLIR Team2019-09-042-11/+29
| | | | | | | | PiperOrigin-RevId: 267121729
| * Update the syntax of splat attribute in LLVM.mdAlex Zinenko2019-09-042-3/+5
| | | | | | | | | | | | | | | | | | The syntax for splat attributes changed, but was not updated in the description of the LLVM dialect constant operations in LLVM.md. Update the document to use the correct syntax. Also add a dialect roundtrip test for such attribute, which was previously missing. PiperOrigin-RevId: 267116305
| * Mention clang-format in the developer guideAlex Zinenko2019-09-041-0/+8
| | | | | | | | PiperOrigin-RevId: 267114122
| * Properly clone Linalg ops with regionsNicolas Vasilache2019-09-036-14/+120
| | | | | | | | | | | | This CL adds support for proper cloning of Linalg ops that have regions (i.e. the generic linalg op). This is used to properly implement tiling and fusion for such ops. Adequate tests are added. PiperOrigin-RevId: 267027176
| * Utility to normalize memrefs with non-identity layout mapsUday Bondhugula2019-09-037-11/+250
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - introduce utility to convert memrefs with non-identity layout maps to ones with identity layout maps: convert the type and rewrite/remap all its uses - add this utility to -simplify-affine-structures pass for testing purposes Signed-off-by: Uday Bondhugula <uday@polymagelabs.com> Closes tensorflow/mlir#104 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/104 from bondhugula:memref-normalize f2c914aa1890e8860326c9e33f9aa160b3d65e6d PiperOrigin-RevId: 266985317
| * Add folding rule and dialect materialization hook for spv.constantLei Zhang2019-09-0310-22/+93
| | | | | | | | | | | | | | | | | | This will allow us to use MLIR's folding infrastructure to deduplicate SPIR-V constants. This CL also changed isValidSPIRVType in SPIRVDialect to a static method. PiperOrigin-RevId: 266984403
| * Fix affine data copy generation corner cases/bugsUday Bondhugula2019-09-032-80/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - the [begin, end) range identified for copying could end in between the block, which makes hoisting invalid in some cases. Change the range identification to always end with end of block. - add test case to exercise these (with fast mem capacity set to minimal so that single element memref buffers are generated at the innermost loop) - the location of begin/end of the block range for data copying was being confused with the insert points for copy in and copy out code. In cases, where we choose to hoist transfers, these are separate. - when copy loops are single iteration ones, promote their bodies at the end of the pass. - change default fast mem space to 1 (setting it to zero made it generate DMA op's that won't verify in the default case - since the DMA ops have a check for src/dest memref spaces being different). Signed-off-by: Uday Bondhugula <uday@polymagelabs.com> Co-Authored-By: Mehdi Amini <joker.eph@gmail.com> Closes tensorflow/mlir#88 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/88 from bondhugula:datacopy 88697267c45e850c3ced87671e16e4a930c02a42 PiperOrigin-RevId: 266980911
| * Add information about the SIG + Open Design meetings to the README.MLIR Team2019-09-031-0/+8
| | | | | | | | PiperOrigin-RevId: 266978247
OpenPOWER on IntegriCloud