summaryrefslogtreecommitdiffstats
path: root/mlir
Commit message (Collapse)AuthorAgeFilesLines
...
* Add support for 1->N type mappings in the dialect conversion infrastructure. ↵River Riddle2019-06-225-24/+143
| | | | | | To support these mappings a hook must be overridden on the type converter: 'materializeConversion' :to generate a cast operation from the new types to the old type. This operation is automatically erased if all uses are removed, otherwise it remains in the IR for the user to handle. PiperOrigin-RevId: 254411383
* Cache instances of several common attributes(e.g. BoolAttr, UnitAttr) and ↵River Riddle2019-06-225-29/+122
| | | | | | types(I1/I16/I32/etc.) when creating the MLIRContext. This allows for these symbols to be accessed without the need to perform any lookups/locking. PiperOrigin-RevId: 254410080
* Support for 0-D case in Linalg opsNicolas Vasilache2019-06-226-48/+109
| | | | | | | | | | | This CL adds support for O-D ops in Linalg ops by: 1. making the CopyOp maps optional instead of default valued 2. allowing certain map operations to accept and return empty maps 3. making linalg::LowerToLoops aware of these changes 4. providing a proper 0-D impl for CopyOp and FillOp 5. adding the relevant tests PiperOrigin-RevId: 254381908
* Add an overload to 'PatternRewriter::inlineRegionBefore' that accepts a ↵River Riddle2019-06-225-14/+19
| | | | | | parent region for the insertion position. This allows for inlining the given region into the end of another region. PiperOrigin-RevId: 254367375
* Add missing override on overridden virtual method (NFC)Mehdi Amini2019-06-221-1/+2
| | | | PiperOrigin-RevId: 254349019
* Uniformize usage of OpBuilder& (NFC)Nicolas Vasilache2019-06-2223-121/+118
| | | | | | | Historically the pointer-based version of builders was used. This CL uniformizes to OpBuilder & PiperOrigin-RevId: 254280885
* Fix a warning in enum value ecoding for SPIRV image types. Instead ofMahesh Ravishankar2019-06-221-18/+18
| | | | | | | using the enum class in the packed struct, use unsigned value for encoding and convert it lazily PiperOrigin-RevId: 254258341
* TensorFlow operands can be broadcasted with each other and with the result, ↵Mehdi Amini2019-06-221-2/+3
| | | | | | relax the verifier. PiperOrigin-RevId: 254206814
* Add definition for OperandElementTypeIterator and ResultElementTypeIteratorLei Zhang2019-06-222-0/+55
| | | | | | | | | These are useful utility iterators helping use to get the element types of operands/results of shaped types. Also defined ranges for these iterators. PiperOrigin-RevId: 254180888
* Rename ConversionTarget::isLegal to isDynamicallyLegal to better represent ↵River Riddle2019-06-222-5/+5
| | | | | | what the function is actually checking. PiperOrigin-RevId: 254141073
* Add SPIRV Image Type according to the spec described here :Mahesh Ravishankar2019-06-1911-9/+684
| | | | | | | | | | | | | https://www.khronos.org/registry/spir-v/specs/1.0/SPIRV.html#OpTypeImage. Add new enums to describe Image dimensionality, Image Depth, Arrayed information, Sampling, Sampler User information, and Image format. Doesn's support the Optional Access qualifier at this stage Fix Enum generator for tblgen to add "_" at the beginning if the enum starts with a number. PiperOrigin-RevId: 254091423
* Print proper message saying variadic ops are not supported in RewriterGenLei Zhang2019-06-193-10/+24
| | | | | | | | Support for ops with variadic operands/results will come later; but right now a proper message helps to avoid deciphering confusing error messages later in the compilation stage. PiperOrigin-RevId: 254071820
* Add missing MLIRStandardOps dependency for MLIRGPULei Zhang2019-06-191-1/+1
| | | | PiperOrigin-RevId: 254070969
* Refactor the TypeConverter to support more robust type conversions:River Riddle2019-06-199-182/+573
| | | | | | | | | | | | * Support for 1->0 type mappings, i.e. when the argument is being removed. * Reordering types when converting a type signature. * Adding new inputs when converting a type signature. This cl also lays down the initial foundation for supporting 1->N type mappings, but full support will come in a followup. Moving forward, function signature changes will be driven by populating a SignatureConversion instance. This class contains all of the necessary information for adding/removing/remapping function signatures; e.g. addInputs, addResults, remapInputs, etc. PiperOrigin-RevId: 254064665
* Extract the function symbol table functionality, i.e. mapping and name ↵River Riddle2019-06-196-82/+148
| | | | | | uniquing, out of Module and into a new class SymbolTable. As modules become operations it is necessary to extract out this functionality that cannot be represented with a generic operation. PiperOrigin-RevId: 254041734
* Remove unnecessary -verify-diagnosticsGeoffrey Martin-Noble2019-06-196-8/+8
| | | | | | These were likely added in error because of confusion about the flag when it was just called "-verify". The extra flag doesn't cause much harm, but it does make mlir-opt do more work and clutter the RUN line PiperOrigin-RevId: 254037016
* Rename -verify mlir-opt flag to -verify-expected-diagnosticsGeoffrey Martin-Noble2019-06-1936-40/+40
| | | | | | This name has caused some confusion because it suggests that it's running op verification (and that this verification isn't getting run by default). PiperOrigin-RevId: 254035268
* Export symbols in cpu runner cblas libraryLei Zhang2019-06-192-9/+24
| | | | | | | | By default MSVC does not export any symbol and does not create a companion .lib for a .dll. This will cause problems when trying to link against the library. PiperOrigin-RevId: 254033454
* Add a pass that translates GPU.launch_func into a series of runtime calls.Stephan Herhut2019-06-193-0/+402
| | | | | | | | This does not map the calls to the CUDA libary directly but uses a slim wrapper ABI on top that has more convenient types for code generation and is stable. Such ABI is expected to be provided by the actual runner. PiperOrigin-RevId: 253983833
* Simplify usages of SplatElementsAttr now that it inherits from ↵River Riddle2019-06-1912-101/+11
| | | | | | DenseElementsAttr. PiperOrigin-RevId: 253910543
* NFC: Reorder the attribute classes alphabetically to improve readability.River Riddle2019-06-193-446/+433
| | | | PiperOrigin-RevId: 253894445
* NFC: Append 'Location' to the end of each the location kinds. This is in ↵River Riddle2019-06-194-20/+21
| | | | | | preparation for making the location classes attributes instead of separate IR types. PiperOrigin-RevId: 253860058
* Replace usages of 'UniquedFilename' with 'Identifier' and remove it. ↵River Riddle2019-06-1912-63/+32
| | | | | | Identifier already contains all of the necessary functionality/verification, so having a separate class for filenames is unnecessary. PiperOrigin-RevId: 253855505
* [spirv] Add spv.VariableLei Zhang2019-06-198-19/+267
| | | | | | | | | | | | | This is a direct modelling of SPIR-V's OpVariable. The custom assembly format parsers/prints descriptor in a nicer way if presents. There are other common decorations that can appear on variables like builtin, which can be supported later. This CL additionally deduplicates the parser/printer/verifier declaration in op definitions by adding defaults to SPV_Op base. by adding PiperOrigin-RevId: 253828254
* Add a setAttrList() method on mlir::OperationMehdi Amini2019-06-191-0/+5
| | | | | | | This is an efficient method to copy attributes from one operation to another. PiperOrigin-RevId: 253806004
* Fix GPUToNVVM naming: NNVM should have been NVVMAlex Zinenko2019-06-192-2/+2
| | | | | | Rename `createLowerGpuOpsToNNVMOpsPass` to `createLowerGpuOpsToNVVMOpsPass`. PiperOrigin-RevId: 253801577
* Factor fusion compute cost calculation out of LoopFusion and into ↵Andy Davis2019-06-193-221/+285
| | | | | | LoopFusionUtils (NFC). PiperOrigin-RevId: 253797886
* Add missing cmake dependency from Linalg to MLIRStandardToLLVM.Jacques Pienaar2019-06-192-1/+2
| | | | PiperOrigin-RevId: 253788170
* Put createGpuKernelOutliningPass in MLIR namespaceAlex Zinenko2019-06-191-1/+2
| | | | | | | This function was declared in the `mlir` namespace but defined in the global namespace, leading to linking errors when used. PiperOrigin-RevId: 253784410
* Make examples/Linalg3 depend on the new standard to LLVM conversion library.Alex Zinenko2019-06-192-2/+17
| | | | PiperOrigin-RevId: 253767820
* 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-194-0/+289
| | | | | | | | | 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
* Add mlir::Function::eraseBody helper to remove the body of a function.Stephan Herhut2019-06-191-0/+1
| | | | | | | This does not add any new functionality but gives clearing the blocks of the body region a more obvious name. PiperOrigin-RevId: 253751382
* Fix the detection of boolean splat values in DenseElementsAttr for arrays ↵River Riddle2019-06-192-3/+16
| | | | | | with <=15 values. PiperOrigin-RevId: 253711372
* Add a TableGen Type predicate to check that an operand type can be ↵Mehdi Amini2019-06-191-0/+12
| | | | | | broadcasted to a particular output type PiperOrigin-RevId: 253694397
* Refactor generic op printing: extract a public printFunctionalType() on ↵Mehdi Amini2019-06-194-15/+22
| | | | | | OpAsmPrinter (NFC) PiperOrigin-RevId: 253674584
* [spirv] Add spv.constantLei Zhang2019-06-194-25/+202
| | | | | | | This CL defines a single `spv.constant` op to represent various flavors of SPIR-V constant instructions. PiperOrigin-RevId: 253665716
* [spirv] Define common types using op definition specLei Zhang2019-06-195-9/+51
| | | | | | This CL also tightens spv.FMul to only accept 16/32/64-bit floats. PiperOrigin-RevId: 253649352
* Verification for gpu.launch_func should rely on function type and not on theStephan Herhut2019-06-192-2/+10
| | | | | | | actual body of a kernel function. This enables using gpu.launch_func with external kernel declarations. PiperOrigin-RevId: 253639770
* Also consider attributes when getting context for OperationLei Zhang2019-06-191-5/+6
| | | | | | | This CL also updates to use containing region as a fallback way to find context since functions will eventually become ops with regions. PiperOrigin-RevId: 253627322
* [spirv] Add doc regarding the SPIR-V dialectLei Zhang2019-06-192-0/+108
| | | | | | | * Add basic design philosophy * Add type syntax to both the doc and type parser comments PiperOrigin-RevId: 253625782
* Introduce std.index_cast and its lowering+translation to LLVMAlex Zinenko2019-06-198-23/+138
| | | | | | | | | | | | | | | | | | 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-195-29/+45
| | | | | | | | 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
* LoopFusion: adds support for computing forward computation slices, which ↵Andy Davis2019-06-198-164/+515
| | | | | | will enable fusion of consumer loop nests into their producers in subsequent CLs. PiperOrigin-RevId: 253601994
* Add lowering pass from GPU dialect operations to LLVM/NVVM intrinsics.Stephan Herhut2019-06-196-0/+193
| | | | PiperOrigin-RevId: 253551452
* Move the Region type out to its own .h/.cpp file instead of putting it intoChris Lattner2019-06-196-317/+374
| | | | | | | | Block.h/cpp. This doesn't change much but makes it easier to find. PiperOrigin-RevId: 253423041
* Use braces when building an 'llvm_return' via EDSC intrinsics. This fixes a ↵River Riddle2019-06-191-1/+1
| | | | | | build error on MSVC where it is unable to properly handled template type aliases. PiperOrigin-RevId: 253339204
* Remove dead code.Jing Pu2019-06-191-11/+0
| | | | PiperOrigin-RevId: 253314416
* Start moving conversions to {lib,include/mlir}/ConversionAlex Zinenko2019-06-1913-20/+31
| | | | | | | | | | | 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
* Disallow using NOperands/NResults when N < 2. We have special traits for the ↵River Riddle2019-06-193-15/+17
| | | | | | case of 0/1 that we explicitly check for throughout the codebase. This also fixes weird build failures in MSVC where it doesn't properly handle template type aliases. PiperOrigin-RevId: 253269936
OpenPOWER on IntegriCloud