summaryrefslogtreecommitdiffstats
path: root/mlir/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* Move specification of print, parse and verify to Std_Op base.Jacques Pienaar2019-05-201-1/+6
| | | | | | | | Removes some boilerplate in ops, add support to refer to C++ class name from parser function specification in ODS. -- PiperOrigin-RevId: 248140977
* Pipe Linalg to a cblas call via mlir-cpu-runnerNicolas Vasilache2019-05-203-260/+296
| | | | | | | | | This CL extends the execution engine to allow the additional resolution of symbols names that have been registered explicitly. This allows linking static library symbols that have not been explicitly exported with the -rdynamic linking flag (which is deemed too intrusive). -- PiperOrigin-RevId: 247969504
* Remove the explicit "friend Operation" statement from each of the ↵River Riddle2019-05-201-1/+0
| | | | | | | | derived operations now that op casting is no longer inside of Operation. -- PiperOrigin-RevId: 247791672
* Replace Operation::isa with llvm::isa.River Riddle2019-05-201-1/+1
| | | | | | -- PiperOrigin-RevId: 247789235
* Add support for using llvm::dyn_cast/cast/isa for operation casts and ↵River Riddle2019-05-201-2/+2
| | | | | | | | replace usages of Operation::dyn_cast with llvm::dyn_cast. -- PiperOrigin-RevId: 247780086
* Automated rollback of changelist 247778391.MLIR Team2019-05-201-2/+2
| | | | PiperOrigin-RevId: 247778691
* Add support for using llvm::dyn_cast/cast/isa for operation casts and ↵River Riddle2019-05-201-2/+2
| | | | | | | | replace usages of Operation::dyn_cast with llvm::dyn_cast. -- PiperOrigin-RevId: 247778391
* [TableGen] Return base attribute's name for anonymous ↵Lei Zhang2019-05-101-1/+1
| | | | | | | | OptionalAttr/DefaultValuedAttr -- PiperOrigin-RevId: 247693280
* Remove unused `signature()` from `OpMethod` class (private to ↵Mehdi Amini2019-05-101-3/+0
| | | | | | | | mlir-tblgen) (NFC) -- PiperOrigin-RevId: 247672280
* Replace dyn_cast<> with isa<> when the returned value is unused (NFC)Mehdi Amini2019-05-101-2/+2
| | | | | | | | Fix a gcc warning. -- PiperOrigin-RevId: 247669360
* Emit cast instead of dyn_cast_or_null where attribute is required.Jacques Pienaar2019-05-101-2/+6
| | | | | | | | | | If the attribute needs to exist for the validity of the op, then no need to use dyn_cast_or_null as the op would be invalid in the cases where cast fails, so just use cast. -- PiperOrigin-RevId: 247617696
* Move the diagnostic verification functionality out of mlir-opt and into ↵River Riddle2019-05-101-134/+5
| | | | | | | | a new llvm::SourceMgr diagnostic handler 'SourceMgrDiagnosticVerifierHandler'. This will allow for other tools to reuse the 'expected-*' functionality. -- PiperOrigin-RevId: 247514684
* Pipe Linalg to LLVM via mlir-cpu-runnerNicolas Vasilache2019-05-102-4/+58
| | | | | | | | | | | This CL adds support for functions in the Linalg dialect to run with mlir-cpu-runner. For this purpose, this CL adds BufferAllocOp, BufferDeallocOp, LoadOp and StoreOp to the Linalg dialect as well as their lowering to LLVM. To avoid collisions with mlir::LoadOp/StoreOp (which should really become mlir::affine::LoadOp/StoreOp), the mlir::linalg namespace is added. The execution uses a dummy linalg_dot function that just returns for now. In the future a proper library call will be used. -- PiperOrigin-RevId: 247476061
* Add a utility diagnostic handler class, SourceMgrDiagnosticHandler, to ↵River Riddle2019-05-101-73/+3
| | | | | | | | interface with llvm::SourceMgr. This lowers the barrier of entry for tools to get rich diagnostic handling when using llvm::SourceMgr. -- PiperOrigin-RevId: 247358610
* NFC: Make ParseResult public and update the OpAsmParser(and thus all of ↵River Riddle2019-05-101-1/+1
| | | | | | | | the custom operation parsers) to use it instead of bool. -- PiperOrigin-RevId: 246955523
* Remove redundant ;Jacques Pienaar2019-05-061-1/+1
| | | | | | -- PiperOrigin-RevId: 246664861
* Add explicit friendship with Operation to each derived op class to ↵River Riddle2019-05-061-0/+1
| | | | | | | | ensure access to the inherited protected constructor of `Op`. Some compiler versions have different rules for the visibility of inherited constructors. -- PiperOrigin-RevId: 246661686
* Fix up some mixed sign warnings.Jacques Pienaar2019-05-062-40/+40
| | | | | | -- PiperOrigin-RevId: 246614498
* Add support for basic remark diagnostics. This is the minimal ↵River Riddle2019-05-061-1/+7
| | | | | | | | functionality needed to separate notes from remarks. It also provides a starting point to start building out better remark infrastructure. -- PiperOrigin-RevId: 246175216
* Start sketching out a new diagnostics infrastructure. Create a new class ↵River Riddle2019-05-061-28/+28
| | | | | | | | 'DiagnosticEngine' and move the diagnostic handler support and final diagnostic emission from the MLIRContext to it. -- PiperOrigin-RevId: 246163897
* Reserve the required capacity to avoid pointer invalidations for ↵Smit Hinsu2019-05-061-2/+8
| | | | | | | | translation functions -- PiperOrigin-RevId: 245992152
* Add transformation of the NVVM dialect to an LLVM module. Only handlesStephan Herhut2019-05-063-1/+3
| | | | | | | | the generation of intrinsics out of NVVM index ops for now. -- PiperOrigin-RevId: 245933152
* Add extraClassDeclaration field for ops.Jacques Pienaar2019-05-061-4/+9
| | | | | | | | Simple mechanism to allow specifying arbitrary function declarations. The modelling will not cover all cases so allow a means for users to declare a method function that they will define in their C++ files. The goal is to allow full C++ flexibility as the goal is to cover cases not modelled. -- PiperOrigin-RevId: 245889819
* Fix opt build failure.Jacques Pienaar2019-05-061-0/+1
| | | | | | -- PiperOrigin-RevId: 245844236
* Fixup MLIRGPU to mlir-opt in cmake.Jacques Pienaar2019-05-061-0/+1
| | | | | | -- PiperOrigin-RevId: 245820077
* Parsing support for Range, View and Slice operationsNicolas Vasilache2019-05-061-2/+19
| | | | | | | | | | | This CL implements the previously unsupported parsing for Range, View and Slice operations. A pass is introduced to lower to the LLVM. Tests are moved out of C++ land and into mlir/test/Examples. This allows better fitting within standard developer workflows. -- PiperOrigin-RevId: 245796600
* Add a new NVVM dialect that extends the LLVM dialect with some NVVM ↵Stephan Herhut2019-05-061-1/+1
| | | | | | | | | | | specific operations. Currently, this is limited to operations that give access to the special registers of NVIDIA gpus that represent block and thread indices. -- PiperOrigin-RevId: 245378632
* [TableGen] Support multiple variadic operands/resultsLei Zhang2019-05-063-92/+201
| | | | | | | | | | | | | | | | Certain ops can have multiple variadic operands/results, e.g., `tf.DynamicStitch`. Even if an op has only one variadic operand/result, it is not necessarily the very last one, e.g., `tf.RaggedGather`. This CL enhances TableGen subsystem to be able to represent such cases. In order to deduce the operand/result value range for each variadic operand, currently we only support variadic operands/results all of the same size. So two new traits, `SameVariadicOperandSize` and `SameVariadicResultSize` are introduced. -- PiperOrigin-RevId: 245310628
* [TableGen] Clean up comments regarding op and resultLei Zhang2019-04-231-3/+3
| | | | | | | | | | An op can have multiple results. Being explicit that we are binding to the whole op instead of one of the results. A way to bind to a specific result is yet to come. -- PiperOrigin-RevId: 244741137
* [TableGen] Unify cOp and tAttr into NativeCodeCallLei Zhang2019-04-231-52/+25
| | | | | | | | | Both cOp and tAttr were used to perform some native C++ code expression. Unifying them simplifies the concepts and reduces cognitive burden. -- PiperOrigin-RevId: 244731946
* [TableGen] Capture bound source ops in PatternStateLei Zhang2019-04-231-32/+24
| | | | | | | | | | | | This allows accessing those bound source ops in result patterns, which can be useful for invoking native C++ op creation. We bind the op entirely here because ops can have multiple results. Design a approach to bind to a specific result is not the concern of this commit. -- PiperOrigin-RevId: 244724750
* Start a Linalg dialectNicolas Vasilache2019-04-181-0/+1
| | | | | | | | | | | | | This CL starts implementing a Linalg dialect with the objective of supporting optimizing compilation of loops and library calls for a subset of common linear algebra operations. This CL starts by simply adding a linalg.range type and an operation with the proper roundtripping test. -- PiperOrigin-RevId: 244189468
* [TableGen] Simplify NOperands trait generationLei Zhang2019-04-181-11/+1
| | | | | | -- PiperOrigin-RevId: 244162515
* [TableGen] Fix builder for ops with one variadic input and SameValueTypeLei Zhang2019-04-181-2/+6
| | | | | | | | | | For ops with the SameValueType trait, we generate a builder without requiring result type; we get the result type from the operand. However, if the operand is variadic, we need to index into the first value in the pack. -- PiperOrigin-RevId: 243866647
* [TableGen] Fix support for ops whose names have a leading underscoreLei Zhang2019-04-181-10/+10
| | | | | | | | | TensorFlow ops have the convention to use leading underscore to denote internal ops. -- PiperOrigin-RevId: 243627723
* NFC: Simplify named attribute in TableGen generatorsSmit Hinsu2019-04-183-16/+8
| | | | | | | | | | | Now, op attribute names don't have '.' in their names so the special handling for it can be removed. Attributes for functions still have dialect prefix with '.' as separator but TableGen does not deal with functions. TESTED with existing unit tests -- PiperOrigin-RevId: 243287462
* [TableGen] Use `tgfmt` to format various predicates and rewrite rulesLei Zhang2019-04-182-66/+75
| | | | | | | | | | This CL changes various predicates and rewrite rules to use $-placeholders and `tgfmt` as the driver for substitution. This will make the predicates and rewrite rules more consistent regarding their arguments and more readable. -- PiperOrigin-RevId: 243250739
* [TableGen] Support naming rewrite rulesLei Zhang2019-04-111-8/+21
| | | | | | -- PiperOrigin-RevId: 242909061
* Remove checks guaranteed to be true by the typeLei Zhang2019-04-111-8/+10
| | | | | | | | | This addresses the compiler wraning of "comparison of unsigned expression >= 0 is always true [-Wtype-limits]". -- PiperOrigin-RevId: 242868703
* [TableGen] Enforce constraints on attributesLei Zhang2019-04-051-9/+29
| | | | | | | | | | | | | | Previously, attribute constraints are basically unused: we set true for almost anything. This CL refactors common attribute kinds and sets constraints on them properly. And fixed verification failures found by this change. A noticeable one is that certain TF ops' attributes are required to be 64-bit integer, but the corresponding TFLite ops expect 32-bit integer attributes. Added bitwidth converters to handle this difference. -- PiperOrigin-RevId: 241944008
* [TableGen] Add PatternSymbolResolver for resolving symbols bound in patternsLei Zhang2019-04-051-62/+159
| | | | | | | | | | | | | | | We can bind symbols to op arguments/results in source pattern and op results in result pattern. Previously resolving these symbols is scattered across RewriterGen.cpp. This CL aggregated them into a `PatternSymbolResolver` class. While we are here, this CL also cleans up tests for patterns to make them more focused. Specifically, one-op-one-result.td is superseded by pattern.td; pattern-tAttr.td is simplified; pattern-bound-symbol.td is added for the change in this CL. -- PiperOrigin-RevId: 241913973
* [TableGen] Rework verifier generation and error messagesLei Zhang2019-04-051-21/+18
| | | | | | | | | | | | | | | | | | | Previously we bundle the existence check and the MLIR attribute kind check in one call. Further constraints (like element bitwidth) have to be split into following checks. That is not a nice separation given that we have more checks for constraints. Instead, this CL changes to generate a local variable for every attribute, check its existence first, then check the constraints. Creating a local variable for each attribute also avoids querying it multiple times using the raw getAttr() API. This is a win for both performance the readability of the generated code. This CL also changed the error message to be more greppable by delimiting the error message from constraints with boilerplate part with colon. -- PiperOrigin-RevId: 241906132
* Add CMakeLists.txt for Quantization and FxpMathOps dialects (and misc ↵Stella Laurenzo2019-04-031-0/+2
| | | | | | | | | | | | fixes to build with OSS setup). Tested: cmake -G Ninja ../llvm/ -DLLVM_BUILD_EXAMPLES=ON ninja check-mlir -- PiperOrigin-RevId: 241841296
* [TableGen] Allow additional result patterns not directly used for ↵Lei Zhang2019-04-031-6/+15
| | | | | | | | | | | | | | | replacement This CL looses the requirement that all result patterns in a rewrite rule must replace a result of the root op in the source pattern. Now only the last N result pattern-generated ops are used to replace a N-result source op. This allows to generate additional ops to aid building up final ops used to replace the source op. -- PiperOrigin-RevId: 241783192
* [TableGen] Remove asserts for attributes in aggregate buildersLei Zhang2019-04-031-22/+13
| | | | | | | | | | | | | | | | Attributes can have default values or be optional. Checking the validity of attributes in aggregate builder should consider that. And to be accurate, we should check all required attributes are indeed provided in the list. This is actually duplicating the work done by verifier. Checking the validity of attributes should be the responsiblity of verifiers. This CL removes the assertion for attributes in aggregate builders for the above reason. (Assertions for operands/results are still kept since they are trivial.) Also added more tests for aggregate builders. -- PiperOrigin-RevId: 241746059
* Rewrite the verify hooks on operations to use LogicalResult instead of ↵River Riddle2019-04-021-2/+2
| | | | | | | | bool. This also changes the return of Operation::emitError/emitOpError to LogicalResult as well. -- PiperOrigin-RevId: 241588075
* Update the Function and Module verifiers to return LogicalResult instead ↵River Riddle2019-04-021-1/+1
| | | | | | | | of bool. -- PiperOrigin-RevId: 241553930
* Fix MacOS buildMehdi Amini2019-04-013-3/+3
| | | | | | | | | This is making up for some differences in standard library and linker flags. It also get rid of the requirement to build with RTTI. -- PiperOrigin-RevId: 241348845
* [TableGen] Add EnumAttrCase and EnumAttrLei Zhang2019-04-011-8/+14
| | | | | | | | | | This CL adds EnumAttr as a general mechanism for modelling enum attributes. Right now it is using StringAttr under the hood since MLIR does not have native support for enum attributes. -- PiperOrigin-RevId: 241334043
* Add build files and update README.Jacques Pienaar2019-03-305-0/+73
| | | | | | | | | * Add initial version of build files; * Update README with instructions to download and build MLIR from github; -- PiperOrigin-RevId: 241102092
OpenPOWER on IntegriCloud