summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Conversion
Commit message (Collapse)AuthorAgeFilesLines
...
* Use llvm::StringSwitch in lowering of GPU ops to NVVM ops.Stephan Herhut2019-06-192-9/+9
| | | | PiperOrigin-RevId: 253767688
* Add a pass that translates a CUDA kernel function (tagged with nvvm.kernel) toStephan Herhut2019-06-193-0/+252
| | | | | | | | | a CUBIN blob for execution on CUDA GPUs. This is a first in a series of patches to build a simple CUDA runner to allow experimenting with MLIR code on GPUs. PiperOrigin-RevId: 253758915
* Introduce std.index_cast and its lowering+translation to LLVMAlex Zinenko2019-06-191-5/+36
| | | | | | | | | | | | | | | | | | Index types integers of platform-specific bit width. They are used to index memrefs and as loop induction variables, however they could not be obtained from an integer until now, making it virtually impossible to express indirect accesses (given that memrefs of indices are not allowed) or data-dependent loops. Introduce `std.index_cast` to transform indices into integers and vice versa. The semantics of this cast is to sign-extend when casting to a wider integer, and to truncate when casting to a narrower integer. It belongs to StandardOps because both types it operates on are standard types, and because its results are likely to be used in std.load and std.store. Introduce llvm.sext, llvm.zext and llvm.trunc operations to the LLVM dialect. Provide the conversion of `std.index_cast` to llvm.sext or llvm.trunc, depending on the actual bitwidth of `index` known during the conversion. PiperOrigin-RevId: 253624100
* Factor Region::getUsedValuesDefinedAbove into Transforms/RegionUtilsAlex Zinenko2019-06-191-2/+5
| | | | | | | | Arguably, this function is only useful for transformations and should not pollute the main IR. Also make sure it accepts a the resulting container by-reference instead of returning it. PiperOrigin-RevId: 253622981
* Add lowering pass from GPU dialect operations to LLVM/NVVM intrinsics.Stephan Herhut2019-06-193-0/+129
| | | | PiperOrigin-RevId: 253551452
* Start moving conversions to {lib,include/mlir}/ConversionAlex Zinenko2019-06-193-0/+1019
| | | | | | | | | | | Conversions from dialect A to dialect B depend on both A and B. Therefore, it is reasonable for them to live in a separate library that depends on both DialectA and DialectB library, and does not forces dependees of DialectA or DialectB to also link in the conversion. Create the directory layout for the conversions and move the Standard to LLVM dialect conversion as the first example. PiperOrigin-RevId: 253312252
* Convert a nest affine loops to a GPU kernelAlex Zinenko2019-06-194-0/+297
This converts entire loops into threads/blocks. No check on the size of the block or grid, or on the validity of parallelization is performed, it is under the responsibility of the caller to strip-mine the loops and to perform the dependence analysis before calling the conversion. PiperOrigin-RevId: 253189268
OpenPOWER on IntegriCloud