summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * Refactor the way that pass options are specified.River Riddle2019-12-2310-177/+369
| | | | | | | | | | | | | | | | | | This change refactors pass options to be more similar to how statistics are modeled. More specifically, the options are specified directly on the pass instead of in a separate options class. (Note that the behavior and specification for pass pipelines remains the same.) This brings about several benefits: * The specification of options is much simpler * The round-trip format of a pass can be generated automatically * This gives a somewhat deeper integration with "configuring" a pass, which we could potentially expose to users in the future. PiperOrigin-RevId: 286953824
| * NFC: Replace ValuePtr with Value and remove it now that Value is value-typed.River Riddle2019-12-23192-2271/+2160
| | | | | | | | | | | | ValuePtr was a temporary typedef during the transition to a value-typed Value. PiperOrigin-RevId: 286945714
| * Change the `notifyRootUpdated` API to be transaction based.River Riddle2019-12-2310-87/+199
| | | | | | | | | | | | This means that in-place, or root, updates need to use explicit calls to `startRootUpdate`, `finalizeRootUpdate`, and `cancelRootUpdate`. The major benefit of this change is that it enables in-place updates in DialectConversion, which simplifies the FuncOp pattern for example. The major downside to this is that the cases that *may* modify an operation in-place will need an explicit cancel on the failure branches(assuming that they started an update before attempting the transformation). PiperOrigin-RevId: 286933674
| * Update SPIR-V.mdLei Zhang2019-12-232-65/+612
| | | | | | | | | | | | | | | | | | This CL updates SPIR-V.md to reflect recent developments in the SPIR-V dialect and its conversions. Along the way, also updates the doc for define_inst.sh. PiperOrigin-RevId: 286933546
| * Resubmit: ReImplement the Value classes as value-typed objects wrapping an ↵River Riddle2019-12-2330-160/+370
| | | | | | | | | | | | | | | | internal pointer storage. This will enable future commits to reimplement the internal implementation of OpResult without needing to change all of the existing users. This is part of a chain of commits optimizing the size of operation results. PiperOrigin-RevId: 286930047
| * Automated rollback of commit f603a50109107b447b835dac11f0eb541288393eMLIR Team2019-12-2330-370/+160
| | | | | | | | PiperOrigin-RevId: 286924059
| * ReImplement the Value classes as value-typed objects wrapping an internal ↵River Riddle2019-12-2330-160/+370
| | | | | | | | | | | | | | | | pointer storage. This will enable future commits to reimplement the internal implementation of OpResult without needing to change all of the existing users. This is part of a chain of commits optimizing the size of operation results. PiperOrigin-RevId: 286919966
| * Adjust License.txt file to use the LLVM licenseMehdi Amini2019-12-23593-7723/+2464
| | | | | | | | PiperOrigin-RevId: 286906740
| * NFC: Introduce new ValuePtr/ValueRef typedefs to simplify the transition to ↵River Riddle2019-12-22201-2413/+2493
| | | | | | | | | | | | | | | | | | | | Value being value-typed. This is an initial step to refactoring the representation of OpResult as proposed in: https://groups.google.com/a/tensorflow.org/g/mlir/c/XXzzKhqqF_0/m/v6bKb08WCgAJ This change will make it much simpler to incrementally transition all of the existing code to use value-typed semantics. PiperOrigin-RevId: 286844725
| * Add integer bit-shift operations to the standard dialect.Manuel Freiberger2019-12-2223-174/+294
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename the 'shlis' operation in the standard dialect to 'shift_left'. Add tests for this operation (these have been missing so far) and add a lowering to the 'shl' operation in the LLVM dialect. Add also 'shift_right_signed' (lowered to LLVM's 'ashr') and 'shift_right_unsigned' (lowered to 'lshr'). The original plan was to name these operations 'shift.left', 'shift.right.signed' and 'shift.right.unsigned'. This works if the operations are prefixed with 'std.' in MLIR assembly. Unfortunately during import the short form is ambigous with operations from a hypothetical 'shift' dialect. The best solution seems to omit dots in standard operations for now. Closes tensorflow/mlir#226 PiperOrigin-RevId: 286803388
| * Make Type and Attribute classes trivially copyableAlex Zinenko2019-12-212-10/+4
| | | | | | | | | | | | | | | | | | | | This requires using explicitly default copy constructor and copy assignment operator instead of hand-rolled ones. These classes are indeed cheap to copy since they are wrappers around a pointer to the implementation. This change makes sure templated code can use standard type traits to understand that copying such objects is cheap and appeases analysis tools such as clang-tidy. PiperOrigin-RevId: 286725565
| * NFC: Move the classes related to Pass options into a new header file ↵River Riddle2019-12-202-67/+98
| | | | | | | | | | | | | | | | PassOptions.h This will make refactoring and adding additional features to the pass options infrastructure simpler in followup commits. PiperOrigin-RevId: 286687564
| * [VectorOps] unify vector dialect "subscripts"Aart Bik2019-12-208-95/+95
| | | | | | | | PiperOrigin-RevId: 286650682
| * [VectorOps] remove redundant returns from invalid ops testAart Bik2019-12-201-27/+0
| | | | | | | | PiperOrigin-RevId: 286640660
| * fix isValidDim for block arg caseUday Bondhugula2019-12-203-11/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | - a block argument associated with an arbitrary op can't be a valid dimensional identifier; it has to be the block argument of either a function op or an affine.for. Signed-off-by: Uday Bondhugula <uday@polymagelabs.com> Closes tensorflow/mlir#331 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/331 from bondhugula:valid_dim 3273b4fcbaa31fb7b6671d93c9e42a6b2a6a4e4c PiperOrigin-RevId: 286593693
| * Add gpu.shuffle op.Christian Sigg2019-12-208-2/+213
| | | | | | | | | | | | | | | | This will allow us to lower most of gpu.all_reduce (when all_reduce doesn't exist in the target dialect) within the GPU dialect, and only do target-specific lowering for the shuffle op. PiperOrigin-RevId: 286548256
| * Allow dialect to create friendly names for region argumentsFrank Laub2019-12-194-0/+46
| | | | | | | | | | | | | | | | | | This is the block argument equivalent of the existing `getAsmResultNames` hook. Closes tensorflow/mlir#329 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/329 from plaidml:flaub-region-arg-names fc7876f2d1335024e441083cd25263fd6247eb7d PiperOrigin-RevId: 286523299
| * Unique trait list during ODS Operator trait constructionJacques Pienaar2019-12-193-7/+17
| | | | | | | | | | | | Concatting lists in TableGen is easy, creating unique lists less so. There is no reason for duplicated op traits so we could throw an error instead but duplicates could occur due to concatting different list of traits in ODS (e.g., for convenience reasons), so just dedup them during Operator trait construction instead. PiperOrigin-RevId: 286488423
| * [VectorOps] Update vector transfer_read/write ops to operatate on memrefs ↵Andy Davis2019-12-194-47/+161
| | | | | | | | | | | | | | | | | | with vector element type. Update vector transfer_read/write ops to operatate on memrefs with vector element type. This handle cases where the memref vector element type represents the minimal memory transfer unit (or multiple of the minimal memory transfer unit). PiperOrigin-RevId: 286482115
| * Restructure and update Linalg ODS and documentation - NFCNicolas Vasilache2019-12-1920-38/+703
| | | | | | | | | | | | | | | | This CL allows specifying an additional name for specifying the .td file that is used to generate the doc for a dialect. This is necessary for a dialect like Linalg which has different "types" of ops that are used in different contexts. This CL also restructures the Linalg documentation and renames LinalgLibraryOps -> LinalgStructuredOps but is otherwise NFC. PiperOrigin-RevId: 286450414
| * [VectorOps] Add vector ReshapeOp to the VectorOps dialect.Andy Davis2019-12-194-0/+311
| | | | | | | | | | | | Adds vector ReshapeOp to the VectorOps dialect. An aggregate vector reshape operation, which aggregates multiple hardware vectors, can enable optimizations during decomposition (e.g. loading one input hardware vector and performing multiple rotate and scatter store operations to the vector output). PiperOrigin-RevId: 286440658
| * LLVMFuncOp: implement addEntryBlockAlex Zinenko2019-12-191-1/+15
| | | | | | | | | | | | | | | | | | This function has been declared as a part of the LLVMFuncOp interface but never implemented. Closes tensorflow/mlir#325. PiperOrigin-RevId: 286439619
| * [VectorOps] minor cleanup: vector dialect "subscripts" are i32Aart Bik2019-12-196-25/+41
| | | | | | | | | | | | | | | | Introduces some centralized methods to move towards consistent use of i32 as vector subscripts. Note: sizes/strides/offsets attributes are still i64 PiperOrigin-RevId: 286434133
| * Detemplatize ModuleTranslation::lookupValuesAlex Zinenko2019-12-192-10/+12
| | | | | | | | | | | | | | | | | | This function template has been introduced in the early days of MLIR to work around the absence of common type for ranges of values (operands, block argumeents, vectors, etc). Core IR now provides ValueRange for exactly this purpose. Use it instead of the template parameter. PiperOrigin-RevId: 286431338
| * Add runtime utils support for print_memref_i8Nicolas Vasilache2019-12-183-15/+50
| | | | | | | | | | | | This CL adds print_memref_i8 along with a unit test. PiperOrigin-RevId: 286299237
| * [VectorOps] Replace iostream with stdio in support lib for vector.printAart Bik2019-12-181-6/+8
| | | | | | | | PiperOrigin-RevId: 286252829
| * Add a couple useful LLVM_DEBUG's to the inliner.Sean Silva2019-12-182-1/+14
| | | | | | | | | | | | This makes it easier to narrow down on ops that are preventing inlining. PiperOrigin-RevId: 286243868
| * Move the specializations of VectorTransferRewriter::matchAndRewrite back ↵River Riddle2019-12-181-80/+80
| | | | | | | | | | | | | | | | into the anonymous namespace. This appeases the GCC bug related to specializations in a different namespace. PiperOrigin-RevId: 286234667
| * Added LLVM ops and lowering phases from standard dialect for FAbs, FCeil, ↵Marcel Koester2019-12-183-28/+102
| | | | | | | | | | | | | | | | | | | | | | Cos, FNeg, CopySign. Added test cases for the newly added LLVM operations and lowering features. Closes tensorflow/mlir#300 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/300 from dfki-jugr:std_to_llvm da6168bbc1a369ae2e99ad3881fdddd82f075dd4 PiperOrigin-RevId: 286231169
| * [VectorOps] Add vector.print definition, with lowering supportAart Bik2019-12-188-2/+245
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Examples: vector.print %f : f32 vector.print %x : vector<4xf32> vector.print %y : vector<3x4xf32> vector.print %z : vector<2x3x4xf32> LLVM lowering replaces these with fully unrolled calls into a small runtime support library that provides some basic printing operations (single value, opening closing bracket, comma, newline). PiperOrigin-RevId: 286230325
| * NFC: Remove forbidden include of <iostream>River Riddle2019-12-181-2/+0
| | | | | | | | | | See: https://llvm.org/docs/CodingStandards.html#include-iostream-is-forbidden PiperOrigin-RevId: 286226467
| * Add support for providing a default implementation for an interface method.River Riddle2019-12-187-10/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This enables providing a default implementation of an interface method. This method is defined on the Trait that is attached to the operation, and thus has all of the same constraints and properties as any other interface method. This allows for interface authors to provide a conservative default implementation for certain methods, without requiring that all users explicitly define it. The default implementation can be specified via the argument directly after the interface method body: StaticInterfaceMethod< /*desc=*/"Returns whether two array of types are compatible result types for an op.", /*retTy=*/"bool", /*methodName=*/"isCompatibleReturnTypes", /*args=*/(ins "ArrayRef<Type>":$lhs, "ArrayRef<Type>":$rhs), /*methodBody=*/[{ return ConcreteOp::isCompatibleReturnTypes(lhs, rhs); }], /*defaultImplementation=*/[{ /// Returns whether two arrays are equal as strongest check for /// compatibility by default. return lhs == rhs; }] PiperOrigin-RevId: 286226054
| * Update code block designationsJacques Pienaar2019-12-1814-49/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | '```mlir' is used to indicate the code block is MLIR code/should use MLIR syntax highlighting, while '{.mlir}' was a markdown extension that used a style file to color the background differently of the code block. The background color extension was a custom one that we can retire given we have syntax highlighting. Also change '```td' to '```tablegen' to match chroma syntax highlighting designation. PiperOrigin-RevId: 286222976
| * NFC: Cleanup non-conforming usages of namespaces.River Riddle2019-12-1813-111/+88
| | | | | | | | | | | | | | * Fixes use of anonymous namespace for static methods. * Uses explicit qualifiers(mlir::) instead of wrapping the definition with the namespace. PiperOrigin-RevId: 286222654
| * Introduce prefetch op: affine -> std -> llvm intrinsicUday Bondhugula2019-12-1821-30/+560
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce affine.prefetch: op to prefetch using a multi-dimensional subscript on a memref; similar to affine.load but has no effect on semantics, but only on performance. Provide lowering through std.prefetch, llvm.prefetch and map to llvm's prefetch instrinsic. All attributes reflected through the lowering - locality hint, rw, and instr/data cache. affine.prefetch %0[%i, %j + 5], false, 3, true : memref<400x400xi32> Signed-off-by: Uday Bondhugula <uday@polymagelabs.com> Closes tensorflow/mlir#225 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/225 from bondhugula:prefetch 4c3b4e93bc64d9a5719504e6d6e1657818a2ead0 PiperOrigin-RevId: 286212997
| * NFC: Remove unnecessary 'llvm::' prefix from uses of llvm symbols declared ↵River Riddle2019-12-18145-700/+650
| | | | | | | | | | | | | | | | in `mlir` namespace. Aside from being cleaner, this also makes the codebase more consistent. PiperOrigin-RevId: 286206974
| * Move function template definition to the header file. NFCAlex Zinenko2019-12-182-12/+9
| | | | | | | | | | | | | | | | | | The definition of the function template LLVM::ModuleTranslation::lookupValues has been located in a source file. As long as it has been the only file that actually called into the function, this did not cause any problem. However, it creates linking issues if the function is used from other translation units. PiperOrigin-RevId: 286203078
| * Fix line break in LangRefJacques Pienaar2019-12-181-6/+8
| | | | | | | | | | | | This was munging up the example with the text. PiperOrigin-RevId: 286201762
| * Harden the requirements to memory attribution types in gpu.funcAlex Zinenko2019-12-185-8/+90
| | | | | | | | | | | | | | | | | | | | When memory attributions are present in `gpu.func`, require that they are of memref type and live in memoryspaces 3 and 5 for workgroup and private memory attributions, respectively. Adapt the conversion from the GPU dialect to the NVVM dialect to drop the private memory space from attributions as NVVM is able to model them as local `llvm.alloca`s in the default memory space. PiperOrigin-RevId: 286161763
| * Add support for float and string attributes to the C API and python bindingsMLIR Team2019-12-174-2/+49
| | | | | | | | PiperOrigin-RevId: 286115042
| * NFC: Use this-> to appease GCC bug related to template lambda.River Riddle2019-12-178-8/+9
| | | | | | | | | | | | | | GCC is unable to properly implicitly capture 'this' in generic lambdas. This bug is not fixed until 7.1.0: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67274 PiperOrigin-RevId: 286083427
| * NFC: Use TypeSwitch to simplify existing code.River Riddle2019-12-1711-176/+117
| | | | | | | | PiperOrigin-RevId: 286066371
| * Add pattern rewrite which splits a vector TransferWriteOp into slices ↵Andy Davis2019-12-174-42/+121
| | | | | | | | | | | | according to the unrolling/slicing scheme of its InsertSlicesOp operand. PiperOrigin-RevId: 286042578
| * Add missing virtual inliner interface method in SPIR-V dialect.Mahesh Ravishankar2019-12-172-0/+56
| | | | | | | | | | | | | | | | | | | | | | The inline interface uses two methods to check legality of inling: 1) Can a region be inlined into another. 2) Can an operation be inlined into another. Setting the former to true, allows the inliner to use the second for legality checks. Add this method to the SPIR-V dialect inlining interface. PiperOrigin-RevId: 286041734
| * Make it possible to override the lowering of MemRef to the LLVM dialect. NFC.Alex Zinenko2019-12-173-16/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | The lowering of MemRef types to the LLVM dialect is connected to the underlying runtime representation of structured memory buffers. It has changed several times in the past and reached the current state of a LLVM structured-typed descriptor containing two pointers and all sizes. In several reported use cases, a different, often simpler, lowering scheme is required. For example, lowering statically-shaped memrefs to bare LLVM pointers to simplify aliasing annotation. Split the pattern population functions into those include memref-related operations and the remaining ones. Users are expected to extend TypeConverter::convertType to handle the memref types differently. PiperOrigin-RevId: 286030610
| * ConversionToLLVMDialect doc: update the syntax for LLVM typesAlex Zinenko2019-12-171-38/+38
| | | | | | | | | | | | | | | | | | | | | | | | The syntax for LLVM dialect types changed twice since this document was introduced. First, the quoted types are only prefixed with the dialect name `!llvm` rather than with `!llvm.type`. Second, for types that are simple enough (e.g., MLIR identifiers), the pretty form can be used instead of the quoted form. The relevant commits updated the dialect documentation, but not the conversion documentation. Use the valid type names in the conversion documentation. PiperOrigin-RevId: 286026153
| * StdToLLVM conversion: drop getMemRefElementType utility functionAlex Zinenko2019-12-171-12/+1
| | | | | | | | | | | | | | | | This function has become redundant with MemRefDescriptor::getElementType and is no longer necessary. Use the MemRefDescriptor pervasively to concentrate descriptor-related logic in one place and drop the utility function. PiperOrigin-RevId: 286024168
| * Homogenize the description of the MemRef conversion to the LLVM dialectAlex Zinenko2019-12-171-46/+53
| | | | | | | | | | | | | | | | | | The conversion procedure has been updated to reflect the most recent MemRef descriptor proposal, but the documentation was only updated for the type conversion, omitting the address computation section. Make sure the two sections agree. PiperOrigin-RevId: 286022684
| * Add pattern rewrite to forward vector tuple elements to their users.Andy Davis2019-12-172-14/+38
| | | | | | | | | | | | User(TupleGetOp(ExtractSlicesOp(InsertSlicesOp(TupleOp(Producer))) -> User(Producer) PiperOrigin-RevId: 286020249
| * fix a typo in OpDefinitions docJin Mingjian2019-12-171-1/+1
| | | | | | | | | | | | | | | | | | [{ matched with }], rather than ]} Closes tensorflow/mlir#320 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/320 from jinmingjian:patch-1 6b0870d02284f023bda2b28380960eb31d34f3b6 PiperOrigin-RevId: 286007638
OpenPOWER on IntegriCloud