summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * [spirv] Add array length check.Denis Khalikov2019-09-303-0/+14
| | | | | | | | | | | | | | | | | | | | According to the SPIR-V spec: "Length is the number of elements in the array. It must be at least 1." Closes tensorflow/mlir#160 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/160 from denis0x0D:sandbox/array_len 0840dc0986ad0088a3aa7d5d8d3e97d489377ed9 PiperOrigin-RevId: 272094669
| * Adding signed integer ops for abs, sign, min, and max in the GLSL extension.Ben Vanik2019-09-301-15/+133
| | | | | | | | PiperOrigin-RevId: 272067942
| * Add missing file from cmakelistJacques Pienaar2019-09-301-0/+1
| | | | | | | | PiperOrigin-RevId: 272054623
| * Enable autogenerating OpInterface method declarationsJacques Pienaar2019-09-309-122/+315
| | | | | | | | | | | | | | | | | | | | Add DeclareOpInterfaceFunctions to enable specifying whether OpInterfaceMethods for an OpInterface should be generated automatically. This avoids needing to declare the extra methods, while also allowing adding function declaration by way of trait/inheritance. Most of this change is mechanical/extracting classes to be reusable. PiperOrigin-RevId: 272042739
| * NFC: Change `classof` on registered operations to use pointer comparison.River Riddle2019-09-301-3/+2
| | | | | | | | | | | | The current implementation always uses string comparison, but if the operation is registered the AbstractOperation instance can be used to provide faster pointer comparison. PiperOrigin-RevId: 272041333
| * Adding some missing SPIR-V core and GLSL extended ops.Ben Vanik2019-09-302-2/+283
| | | | | | | | PiperOrigin-RevId: 272039887
| * Normalize MemRefType lowering to LLVM as strided MemRef descriptorNicolas Vasilache2019-09-3013-254/+389
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL finishes the implementation of the lowering part of the [strided memref RFC](https://groups.google.com/a/tensorflow.org/forum/#!topic/mlir/MaL8m2nXuio). Strided memrefs correspond conceptually to the following templated C++ struct: ``` template <typename Elem, size_t Rank> struct { Elem *ptr; int64_t offset; int64_t sizes[Rank]; int64_t strides[Rank]; }; ``` The linearization procedure for address calculation for strided memrefs is the same as for linalg views: `base_offset + SUM_i index_i * stride_i`. The following CL will unify Linalg and Standard by removing !linalg.view in favor of strided memrefs. PiperOrigin-RevId: 272033399
| * [DRR] Explain result type deduction in docLei Zhang2019-09-301-0/+23
| | | | | | | | PiperOrigin-RevId: 272031467
| * Add support for Logical Ops in SPIR-V dialectMahesh Ravishankar2019-09-306-64/+393
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add operations corresponding to OpLogicalAnd, OpLogicalNot, OpLogicalEqual, OpLogicalNotEqual and OpLogicalOr instructions in SPIR-V dialect. This needs changes to class hierarchy in SPIR-V TableGen files to split SPIRVLogicalOp into SPIRVLogicalUnaryOp and SPIRVLogicalBinaryOp. All derived classes of SPIRVLogicalOp are updated accordingly. Update the spirv dialect generation script to 1) Allow specifying base class to use for instruction spec generation and file name to generate the specification in separately. 2) Use the existing descriptions for operations. 3) Update define_inst.sh to also invoke define_opcode.sh to also define the corresponding SPIR-V instruction opcode enum. PiperOrigin-RevId: 272014876
| * Use MaybeAlign when setting alignmentJacques Pienaar2019-09-301-1/+1
| | | | | | | | PiperOrigin-RevId: 272000548
| * Fix MemRefType::getStrides corner caseNicolas Vasilache2019-09-304-11/+57
| | | | | | | | | | | | | | | | MemRefType::getStrides uses AffineExpr::walk which operates in post-order from the leaves. In order to compute strides properly, it needs to escape on terminal nodes and analyze binary ops only. This did not work for AffineExpr that consist of a single term (i.e. without a binary op). This CL fixes the corner case and adds relevant tests. PiperOrigin-RevId: 271975746
| * Switch comments from GPU dialect terms to CUDA terms (NFC).Christian Sigg2019-09-301-8/+7
| | | | | | | | | | | | local workgroup -> block, subgroup -> warp, invocation -> thread. PiperOrigin-RevId: 271946342
| * Add InferTypeOpTrait & enable generating its member function definitionJacques Pienaar2019-09-2910-2/+209
| | | | | | | | | | | | | | | | | | | | Use OpInterfaces to add an interface for ops defining a return type function. This change does not use this trait in any meaningful way, I'll use it in a follow up to generalize and unify some of the op type traits/constraints. Also, currently the infer type function can only be manually specified in C++, that should rather be the fallback in future. PiperOrigin-RevId: 271883746
| * update Rationale.md - remove outdated infoUday Bondhugula2019-09-291-69/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - removing outdated/confusing info - the affine dialect is missing documentation on affine.load/affine.store; the references herein have to be updated once that's updated. Signed-off-by: Uday Bondhugula <uday@polymagelabs.com> Closes tensorflow/mlir#159 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/159 from bondhugula:doc 86dd794f2d0d7fd097dde5764c62eb406ed4f910 PiperOrigin-RevId: 271876525
| * Fix a typo in Toy Chapter 2 tutorial documentationRoberto Rosmaninho2019-09-291-2/+2
| | | | | | | | | | | | | | Closes tensorflow/mlir#155 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/155 from Robertorosmaninho:patch-1 232ac4e1253948c7f3150515e93abe50fcec2f96 PiperOrigin-RevId: 271876515
| * Fix syntax of 'call' and 'splat' opsUday Bondhugula2019-09-291-6/+5
| | | | | | | | | | | | | | | | | | | | - fix missing return value syntax on call / splat ops - reflow cond_br / store op syntax Closes tensorflow/mlir#161 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/161 from bondhugula:patch-1 2beb5bdcb387a5e7c52438985f79e2987d3b3ebe PiperOrigin-RevId: 271876453
| * Switch explicit create methods to match generated build's orderJacques Pienaar2019-09-285-12/+12
| | | | | | | | | | | | The generated build methods have result type before the arguments (operands and attributes, which are also now adjacent in the explicit create method). This also results in changing the create method's ordering to match most build method's ordering. PiperOrigin-RevId: 271755054
| * Tablegen helpers for accessing properties of shaped typesGeoffrey Martin-Noble2019-09-272-15/+39
| | | | | | | | | | | | Tablegen's lack of functions continues to be annoying PiperOrigin-RevId: 271680947
| * Append a newline when dumping a Value.Yanan Cao2019-09-271-1/+4
| | | | | | | | | | | | This is more consistent with other dump methods. Otherwise successive Value dumps are concatenated in same line, hurting readability. PiperOrigin-RevId: 271669846
| * Remove spurious debug spew in testsNicolas Vasilache2019-09-274-4/+0
| | | | | | | | PiperOrigin-RevId: 271624731
| * Add TODO to revisit coupling of CallOp to MemRefType loweringNicolas Vasilache2019-09-271-0/+3
| | | | | | | | PiperOrigin-RevId: 271619132
| * NFC - clean up op accessor usage, std.load/store op verify, other stale infoUday Bondhugula2019-09-2713-103/+79
| | | | | | | | | | | | | | | | | | | | | | - also remove stale terminology/references in docs Signed-off-by: Uday Bondhugula <uday@polymagelabs.com> Closes tensorflow/mlir#148 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/148 from bondhugula:cleanup e846b641a3c2936e874138aff480a23cdbf66591 PiperOrigin-RevId: 271618279
| * Promote MemRefDescriptor to a pointer to struct when passing function ↵Nicolas Vasilache2019-09-2714-221/+495
| | | | | | | | | | | | | | | | | | | | | | | | | | boundaries in LLVMLowering. The strided MemRef RFC discusses a normalized descriptor and interaction with library calls (https://groups.google.com/a/tensorflow.org/forum/#!topic/mlir/MaL8m2nXuio). Lowering of nested LLVM structs as value types does not play nicely with externally compiled C/C++ functions due to ABI issues. Solving the ABI problem generally is a very complex problem and most likely involves taking a dependence on clang that we do not want atm. A simple workaround is to pass pointers to memref descriptors at function boundaries, which this CL implement. PiperOrigin-RevId: 271591708
| * Fix JitRunner.cpp Error creation pattern and reactivate tests.Nicolas Vasilache2019-09-273-25/+29
| | | | | | | | | | | | | | | | | | | | linalg_integration_test.mlir and simple.mlir were temporarily disabled due to an OSS-only failure. The issue is that, once created, an llvm::Error must be explicitly checked before it can be discarded or overwritten. This CL fixes the issue and reenable the test. PiperOrigin-RevId: 271589651
| * Fix Documentation OpDefinitions.mdDenis Khalikov2019-09-271-1/+1
| | | | | | | | | | | | | | | | | | Add missing semicolon for the builders example. Closes tensorflow/mlir#150 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/150 from denis0x0D:sandbox/doc_fix 07e3680e678bf141a70af7747136e9fde7b4cc0a PiperOrigin-RevId: 271568527
| * Fix missing links in the documentationKazuaki Ishizaki2019-09-276-9/+9
| | | | | | | | | | | | | | Closes tensorflow/mlir#149 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/149 from kiszk:missing_links_g3doc 5f98bc279649d54ea3dcf9fe0e17be6ad6d6cb8f PiperOrigin-RevId: 271568274
| * [ROCm] Adding ROCDL Dialect.Deven Desai2019-09-2712-0/+499
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces the ROCDL Dialect (i.e. the ROCDL ops + the code to lower those ROCDL ops to LLWM intrinsics/functions). Think of ROCDL Dialect as analogous to the NVVM Dialect, but for AMD GPUs. This patch contains just the essentials needed to get a simple example up and running. We expect to make further additions to the ROCDL Dialect. This is the first of 3 commits, the follow-up will be: * add a pass that lowers GPU Dialect to ROCDL Dialect * add a "mlir-rocm-runner" utility Closes tensorflow/mlir#146 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/146 from deven-amd:deven-rocdl-dialect e78e8005c75a78912631116c78dc844fcc4b0de9 PiperOrigin-RevId: 271511259
| * Disable failing testsJacques Pienaar2019-09-262-16/+18
| | | | | | | | PiperOrigin-RevId: 271460509
| * Make result ops generated output deterministicJacques Pienaar2019-09-261-1/+7
| | | | | | | | | | | | Sort the result ops reported in lexographical order. PiperOrigin-RevId: 271426258
| * Decouple tiling from fusion in Linalg.Nicolas Vasilache2019-09-266-411/+507
| | | | | | | | | | | | | | | | | | | | | | | | This CL modifies the linalg-fusion pass such that it does not tile anymore as part of the pass. Tiling is a separate concern that enables linalg fusion but should happen before. This makes fusion more composable with other decisions. In particular the fusion pass now becomes greedy and only applies the transformation on a best-effort basis. This should also let fusion work in a multi-hop fashion with chains of producer/consumers. Since the fusion pass does not perform tiling anymore, tests are rewritten to be in pretiled form and make the intent of the test clearer (albeit more verbose). PiperOrigin-RevId: 271357741
| * Drop support for memrefs from JitRunnerAlex Zinenko2019-09-263-143/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | The support for functions taking and returning memrefs of floats was introduced in the first version of the runner, created before MLIR had reliable lowering of allocation/deallocation to library calls. It forcibly runs MLIR transformation convering affine, loop and standard dialects into the LLVM dialect, unlike the other runner flows that accept the LLVM dialect directly. Memref support leads to more complex layering and is generally fragile. Drop it in favor of functions returning a scalar, or library-based function calls to print memrefs and other data structures. PiperOrigin-RevId: 271330839
| * Add AllReduceOp to GPU dialect with lowering to NVVM.Christian Sigg2019-09-265-2/+223
| | | | | | | | | | | | | | | | The reduction operation is currently fixed to "add", and the scope is fixed to "workgroup". The implementation is currently limited to sizes that are multiple 32 (warp size) and no larger than 1024. PiperOrigin-RevId: 271290265
| * Remove unused variables and methods to address compiler warningsLei Zhang2019-09-254-12/+3
| | | | | | | | PiperOrigin-RevId: 271256784
| * Add spv.Bitcast operation to SPIR-V dialectMahesh Ravishankar2019-09-255-6/+227
| | | | | | | | | | | | | | | | | | Support the OpBitcast instruction of SPIR-V using the spv.Bitcast operation. The semantics implemented in the dialect differ from the SPIR-V spec in that the dialect does not allow conversion to/from pointer types from/to non-pointer types. PiperOrigin-RevId: 271255957
| * Change the return type of createPrintCFGGraphPass to match other passes.Jing Pu2019-09-252-5/+5
| | | | | | | | PiperOrigin-RevId: 271252404
| * [spirv] Add SPV_UnaryOp and spv.FNegateLei Zhang2019-09-257-82/+155
| | | | | | | | | | | | | | This CL also moves common parsers and printers to the same section in SPIRVOps.cpp. PiperOrigin-RevId: 271233546
| * Minor spelling tweaksKazuaki Ishizaki2019-09-2520-66/+68
| | | | | | | | | | | | | | Closes tensorflow/mlir#145 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/145 from kiszk:spelling_tweaks_g3doc ae9140aab5b797441e880d43e557903585815e40 PiperOrigin-RevId: 271173907
| * Emit function name being tested in TestMemRefStrideCalculationJacques Pienaar2019-09-252-1/+3
| | | | | | | | | | | | Bring back CHECK-LABEL post PiperOrigin-RevId: 271166428
| * Add tablegen verification traits for comparing different propertiesGeoffrey Martin-Noble2019-09-253-25/+68
| | | | | | | | | | | | This allows things like comparing the rank of one operand to the size of another that specifies indices into it. PiperOrigin-RevId: 271150439
| * Fix memref-stride-calculation on WindowsLei Zhang2019-09-252-1/+1
| | | | | | | | | | | | | | | | Call llvm::outs().flush() to make sure we don't mix streams. Remove CHECK-LABEL to avoid assuming the relative order between the additional info and the output IR. PiperOrigin-RevId: 271131100
| * Forward declare LogicalResult as a struct to be consistentLei Zhang2019-09-251-1/+1
| | | | | | | | | | | | | | This addresses a MSVC linker error saying splitAndProcessBuffer was unresolved. PiperOrigin-RevId: 271126570
| * Miscellaneous fixes to SPIR-V Deserializer (details below).Mahesh Ravishankar2019-09-243-18/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Process and ignore the following debug instructions: OpSource, OpSourceContinued, OpSourceExtension, OpString, OpModuleProcessed. 2) While processing OpTypeInt instruction, ignore the signedness specification. Currently MLIR doesnt make a distinction between signed and unsigned integer types. 3) Process and ignore BufferBlock decoration (similar to Buffer decoration). StructType needs to be enhanced to track this attribute since its needed for proper validation checks. 4) Report better error for unhandled instruction during deserialization. PiperOrigin-RevId: 271057060
| * NFC: Add 'const' dereference method to OperandTypeIterator.River Riddle2019-09-241-0/+3
| | | | | | | | | | | | The deference provided by mapped_iterator is non-const. PiperOrigin-RevId: 271051375
| * Add support for GLSL Binary ops, and use it to implement GLSL FMax.Mahesh Ravishankar2019-09-243-8/+92
| | | | | | | | | | | | | | | | A base class is added to implement all GLSL Binary operations and is used to implement the FMax operation. The existing framework already generates all the necessary (de)serialization code. PiperOrigin-RevId: 271037166
| * [spirv] Replace bitwiseCast with llvm::bit_castLei Zhang2019-09-241-11/+3
| | | | | | | | PiperOrigin-RevId: 271035618
| * NFC: Add a description to the ODS interface example.River Riddle2019-09-241-1/+8
| | | | | | | | PiperOrigin-RevId: 270978748
| * Allow attaching descriptions to OpInterfaces and InterfaceMethods.River Riddle2019-09-247-64/+301
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds support for documenting interfaces and their methods. A tablegen generator for the interface documentation is also added(gen-op-interface-doc). Documentation is added to an OpInterface via the `description` field: def MyOpInterface : OpInterface<"MyOpInterface"> { let description = [{ My interface is very interesting. }]; } Documentation is added to an InterfaceMethod via a new `description` field that comes right before the optional body: InterfaceMethod<"void", "foo", (ins), [{ This is the foo method. }]>, PiperOrigin-RevId: 270965485
| * Introduce splat op + provide its LLVM loweringUday Bondhugula2019-09-2410-27/+212
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - introduce splat op in standard dialect (currently for int/float/index input type, output type can be vector or statically shaped tensor) - implement LLVM lowering (when result type is 1-d vector) - add constant folding hook for it - while on Ops.cpp, fix some stale names Signed-off-by: Uday Bondhugula <uday@polymagelabs.com> Closes tensorflow/mlir#141 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/141 from bondhugula:splat 48976a6aa0a75be6d91187db6418de989e03eb51 PiperOrigin-RevId: 270965304
| * Normalize lowering of MemRef typesNicolas Vasilache2019-09-249-258/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RFC for unifying Linalg and Affine compilation passes into an end-to-end flow with a predictable ABI and linkage to external function calls raised the question of why we have variable sized descriptors for memrefs depending on whether they have static or dynamic dimensions (https://groups.google.com/a/tensorflow.org/forum/#!topic/mlir/MaL8m2nXuio). This CL standardizes the ABI on the rank of the memrefs. The LLVM struct for a memref becomes equivalent to: ``` template <typename Elem, size_t Rank> struct { Elem *ptr; int64_t sizes[Rank]; }; ``` PiperOrigin-RevId: 270947276
| * Clone called functions into nested GPU module.Christian Sigg2019-09-242-9/+43
| | | | | | | | PiperOrigin-RevId: 270891190
OpenPOWER on IntegriCloud