summaryrefslogtreecommitdiffstats
path: root/mlir/lib/EDSC
Commit message (Collapse)AuthorAgeFilesLines
* [mlir] NFC: Rename index_t to index_typeRainer Orth2020-03-062-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | mlir currently fails to build on Solaris: /vol/llvm/src/llvm-project/dist/mlir/lib/Conversion/VectorToLoops/ConvertVectorToLoops.cpp:78:20: error: reference to 'index_t' is ambiguous IndexHandle zero(index_t(0)), one(index_t(1)); ^ /usr/include/sys/types.h:103:16: note: candidate found by name lookup is 'index_t' typedef short index_t; ^ /vol/llvm/src/llvm-project/dist/mlir/include/mlir/EDSC/Builders.h:27:8: note: candidate found by name lookup is 'mlir::edsc::index_t' struct index_t { ^ and many more. Given that POSIX reserves all identifiers ending in `_t` 2.2.2 The Name Space <https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html>, it seems quite unwise to use such identifiers in user code, even more so without a distinguished prefix. The following patch fixes this by renaming `index_t` to `index_type`. cases. Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`. Differential Revision: https://reviews.llvm.org/D72619 (cherry picked from commit 002ec79f979b9da9dedafe7ea036e00c90a9fbb7)
* [mlir] NFC: Remove Value::operator* and Value::operator-> now that Value is ↵River Riddle2020-01-112-9/+9
| | | | | | | | | | properly value-typed. Summary: These were temporary methods used to simplify the transition. Reviewed By: antiagainst Differential Revision: https://reviews.llvm.org/D72548
* NFC: Replace ValuePtr with Value and remove it now that Value is value-typed.River Riddle2019-12-233-20/+21
| | | | | | ValuePtr was a temporary typedef during the transition to a value-typed Value. PiperOrigin-RevId: 286945714
* Adjust License.txt file to use the LLVM licenseMehdi Amini2019-12-234-52/+16
| | | | PiperOrigin-RevId: 286906740
* NFC: Introduce new ValuePtr/ValueRef typedefs to simplify the transition to ↵River Riddle2019-12-223-21/+20
| | | | | | | | | | 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-221-2/+2
| | | | | | | | | | | | | | | | | | | 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
* NFC: Remove unnecessary 'llvm::' prefix from uses of llvm symbols declared ↵River Riddle2019-12-182-14/+14
| | | | | | | | in `mlir` namespace. Aside from being cleaner, this also makes the codebase more consistent. PiperOrigin-RevId: 286206974
* Add support for float and string attributes to the C API and python bindingsMLIR Team2019-12-171-0/+12
| | | | PiperOrigin-RevId: 286115042
* Add a layer of EDSC for linalg.GenericOpNicolas Vasilache2019-12-131-2/+0
| | | | | | | | This will be evolved into a simple programming model for custom ops and custom layers in followup CLs. This CL also deletes the obsolete tablegen's reference-impl.td that was using EDSCs. PiperOrigin-RevId: 285459545
* Refactor dependencies to expose Vector transformations as patterns - NFCNicolas Vasilache2019-12-031-1/+0
| | | | | | | | | This CL refactors some of the MLIR vector dependencies to allow decoupling VectorOps, vector analysis, vector transformations and vector conversions from each other. This makes the system more modular and allows extracting VectorToVector into VectorTransforms that do not depend on vector conversions. This refactoring exhibited a bunch of cyclic library dependencies that have been cleaned up. PiperOrigin-RevId: 283660308
* NFC: Convert CmpIPredicate in StandardOps to use EnumAttrLei Zhang2019-11-151-6/+6
| | | | | | This turns several hand-written functions to auto-generated ones. PiperOrigin-RevId: 280684326
* Add missing dependency on MLIRIR on MLIREDSCInterfaceMehdi Amini2019-10-241-0/+1
| | | | | | | | MLIRIR includes generated header for interfaces, including these headers require an extra dependency to ensure these headers are generated before we attempt to build MLIREDSCInterface. PiperOrigin-RevId: 276518255
* Lower vector transfer ops to loop.for operations.Nicolas Vasilache2019-10-182-5/+1
| | | | | | This allows mixing linalg operations with vector transfer operations (with additional modifications to affine ops) and is a step towards solving tensorflow/mlir#189. PiperOrigin-RevId: 275543361
* Automated rollback of commit 575405f4d6762830c1c4520569de4e4ed3c8eed5Nicolas Vasilache2019-10-182-17/+57
| | | | PiperOrigin-RevId: 275461067
* Automated rollback of commit b65c8bb5d6ab418bb3fcd0302aee19d3615d90f1River Riddle2019-10-172-57/+17
| | | | PiperOrigin-RevId: 275370861
* Add EDSC support for loop.for operationsNicolas Vasilache2019-10-172-17/+57
| | | | | | | This CL adds support for loop.for operations in EDSC and adds a test. This will be used in a followup commit to implement lowering of vector_transfer ops so that it works more generally and is not subject to affine constraints. PiperOrigin-RevId: 275349796
* Rename LoopNestBuilder to AffineLoopNestBuilder - NFCNicolas Vasilache2019-10-171-6/+5
| | | | PiperOrigin-RevId: 275310747
* Expose mlir::parseType to bindingsAlex Zinenko2019-10-152-26/+33
| | | | | | | | | | | | | | Python bindings currently currently provide a makeScalarType function that constructs one of the predefined types. It was implemented in the bindings directly to circumvent the absence of standalone type parsing function. Now that mlir::parseType has been made available, rely on the core parsing procedure to construct types from strings in the bindings. This changes includes a library reshuffling that splits out "CoreAPIs" implementing the binding helper APIs into a separate library and makes that dependent on the Parser library. PiperOrigin-RevId: 274794516
* Move Linalg and VectorOps dialects to the Dialect subdir - NFCNicolas Vasilache2019-08-191-1/+1
| | | | PiperOrigin-RevId: 264277760
* NFC: Move LLVMIR, SDBM, and StandardOps to the Dialect/ directory.River Riddle2019-08-192-2/+2
| | | | PiperOrigin-RevId: 264193915
* Add support for floating-point comparison 'fcmp' to the LLVM dialect.Nagy Mostafa2019-08-081-9/+43
| | | | | | | | This adds support for fcmp to the LLVM dialect and adds any necessary lowerings, as well as support for EDSCs. Closes tensorflow/mlir#69 PiperOrigin-RevId: 262475255
* Remove the 'region' field from OpBuilder.River Riddle2019-07-121-1/+1
| | | | | | This field wasn't updated as the insertion point changed, making it potentially dangerous given the multi-level of MLIR(e.g. 'createBlock' would always insert the new block in 'region'). This also allows for building an OpBuilder with just a context. PiperOrigin-RevId: 257829135
* NFC: Rename Function to FuncOp.River Riddle2019-07-101-1/+1
| | | | PiperOrigin-RevId: 257293379
* NFC: Remove the various "::getFunction" methods.River Riddle2019-07-081-2/+2
| | | | | | These methods assume that a function is a valid builtin top-level operation, and removing these methods allows for decoupling FuncOp and IR/. Utility "getParentOfType" methods have been added to Operation/OpState to allow for querying the first parent operation of a given type. PiperOrigin-RevId: 257018913
* Add a folder-based EDSC intrinsics constructor (NFC)Nicolas Vasilache2019-07-011-0/+1
| | | | PiperOrigin-RevId: 255908660
* NFC: Remove the 'context' parameter from OperationState.River Riddle2019-06-221-2/+1
| | | | | | Now that Locations are Attributes they contain a direct reference to the MLIRContext, i.e. the context can be directly accessed from the given location instead of being explicitly passed in. PiperOrigin-RevId: 254568329
* Uniformize usage of OpBuilder& (NFC)Nicolas Vasilache2019-06-221-16/+14
| | | | | | | Historically the pointer-based version of builders was used. This CL uniformizes to OpBuilder & PiperOrigin-RevId: 254280885
* NFC: Rename FuncBuilder to OpBuilder and refactor to take a top level region ↵River Riddle2019-06-091-5/+4
| | | | | | instead of a function. PiperOrigin-RevId: 251563898
* Don't use ShapedType to indicate vector or tensor typeGeoffrey Martin-Noble2019-06-011-1/+2
| | | | | | | | MemRefType may soon subclass ShapedType. ShapedType only guarantees that something has a shape (possibly dynamic), rank (or explicitly unranked), and fixed element type. -- PiperOrigin-RevId: 250940537
* Remove "size" property of affine maps.MLIR Team2019-06-011-1/+1
| | | | | | -- PiperOrigin-RevId: 250572818
* EDSC: use llvm::function_ref instead of std::functionAlex Zinenko2019-06-011-3/+4
| | | | | | | | | | Region body constructors in EDSC now take a callback to the function that fills in the body. This callback is called immediately and not stored, so it is sufficient to pass a reference to it and avoid a potentially expensive copy. -- PiperOrigin-RevId: 250473793
* Use lambdas for nesting edsc constructs.Nicolas Vasilache2019-05-202-8/+13
| | | | | | | | | | | Using ArrayRef introduces issues with the order of evaluation between a constructor and the arguments of the subsequent calls to the `operator()`. As a consequence the order of captures is not well-defined can go wrong with certain compilers (e.g. gcc-6.4). This CL fixes the issue by using lambdas in lieu of ArrayRef. -- PiperOrigin-RevId: 249114775
* Add support for saving and restoring the insertion point of a ↵River Riddle2019-05-201-4/+14
| | | | | | | | FuncBuilder. This also updates the edsc::ScopedContext to use a single builder that saves/restores insertion points. This is necessary for using edscs within RewritePatterns. -- PiperOrigin-RevId: 248812645
* Rename VectorOrTensorType to ShapedTypeGeoffrey Martin-Noble2019-05-201-1/+1
| | | | | | | | | | | | This is in preparation for making it also support/be a parent class of MemRefType. MemRefs have similar shape/rank/element semantics and it would be useful to be able to use these same utilities for them. This CL should not change any semantics and only change variables, types, string literals, and comments. In follow-up CLs I will prepare all callers to handle MemRef types or remove their dependence on ShapedType. Discussion/Rationale in https://groups.google.com/a/tensorflow.org/forum/#!topic/mlir/cHLoyfGu8y8 -- PiperOrigin-RevId: 248476449
* Remove unnecessary C++ specifier in CPP files. NFC.Jacques Pienaar2019-05-203-3/+3
| | | | | | | | These are only required in .h files to disambiguate between C and C++ header files. -- PiperOrigin-RevId: 248219135
* Add support for using llvm::dyn_cast/cast/isa for operation casts and ↵River Riddle2019-05-201-3/+3
| | | | | | | | replace usages of Operation::dyn_cast with llvm::dyn_cast. -- PiperOrigin-RevId: 247780086
* Automated rollback of changelist 247778391.MLIR Team2019-05-201-3/+3
| | | | PiperOrigin-RevId: 247778691
* Add support for using llvm::dyn_cast/cast/isa for operation casts and ↵River Riddle2019-05-201-3/+3
| | | | | | | | replace usages of Operation::dyn_cast with llvm::dyn_cast. -- PiperOrigin-RevId: 247778391
* Add missing dependencies for EDSC and linalg librariesLei Zhang2019-04-111-0/+6
| | | | | | | | | This solves the missing "mlir/StandardOps/Ops.h.inc" issue when building a fresh checkout on macOS. -- PiperOrigin-RevId: 243120388
* Add new utilities for RTTI Operation casting: dyn_cast_or_null and ↵River Riddle2019-04-071-3/+1
| | | | | | | | | | | | | | | | | | | | | isa_nonnull * dyn_cast_or_null - This will first check if the operation is null before trying to 'dyn_cast': Value *v = ...; if (auto forOp = dyn_cast_or_null<AffineForOp>(v->getDefiningOp())) ... * isa_nonnull - This will first check if the pointer is null before trying to 'isa': Value *v = ...; if (isa_nonnull<AffineForOp>(v->getDefiningOp()); ... -- PiperOrigin-RevId: 242171343
* Add missing source file in CMakeLists.txtMehdi Amini2019-04-031-0/+1
| | | | | | -- PiperOrigin-RevId: 241746122
* Fix CMake buildMehdi Amini2019-04-032-603/+0
| | | | | | | | | Some files were not built anymore internally but still referenced from CMake. Delete them and unreference them in the CMake files. -- PiperOrigin-RevId: 241744718
* Drop MLIREmitter-based version of the EDSCAlex Zinenko2019-04-032-1382/+103
| | | | | | | | | | | | | | | This version has been deprecated and can now be removed completely since the last remaining user (Python bindings) migrated to declarative builders. Several functions in lib/EDSC/Types.cpp construct core IR objects for the C bindings. Move these functions into lib/EDSC/CoreAPIs.cpp until we decide where they should live. This completes the migration from the delayed-construction EDSC to Declarative Builders. -- PiperOrigin-RevId: 241716729
* Add build files and update README.Jacques Pienaar2019-03-301-0/+11
| | | | | | | | | * Add initial version of build files; * Update README with instructions to download and build MLIR from github; -- PiperOrigin-RevId: 241102092
* Cleanup SuperVectorization dialect printing and parsing.Nicolas Vasilache2019-03-293-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | On the read side, ``` %3 = vector_transfer_read %arg0, %i2, %i1, %i0 {permutation_map: (d0, d1, d2)->(d2, d0)} : (memref<?x?x?xf32>, index, index, index) -> vector<32x256xf32> ``` becomes: ``` %3 = vector_transfer_read %arg0[%i2, %i1, %i0] {permutation_map: (d0, d1, d2)->(d2, d0)} : memref<?x?x?xf32>, vector<32x256xf32> ``` On the write side, ``` vector_transfer_write %0, %arg0, %c3, %c3 {permutation_map: (d0, d1)->(d0)} : vector<128xf32>, memref<?x?xf32>, index, index ``` becomes ``` vector_transfer_write %0, %arg0[%c3, %c3] {permutation_map: (d0, d1)->(d0)} : vector<128xf32>, memref<?x?xf32> ``` Documentation will be cleaned up in a followup commit that also extracts a proper .md from the top of the file comments. PiperOrigin-RevId: 241021879
* Remove the LowerEDSCTestPass.River Riddle2019-03-291-61/+0
| | | | | | Most of the tests have been ported to be unit-tests and this pass is problematic in the way it depends on TableGen-generated files. This pass is also non-deterministic during multi-threading and a blocker to turning it on by default. PiperOrigin-RevId: 240889154
* Replace remaining usages of the Instruction class with Operation.River Riddle2019-03-295-36/+36
| | | | PiperOrigin-RevId: 240777521
* Introduce affine terminatorAlex Zinenko2019-03-292-5/+1
| | | | | | | | | | | | | | | | | | | | | | Due to legacy reasons (ML/CFG function separation), regions in affine control flow operations require contained blocks not to have terminators. This is inconsistent with the notion of the block and may complicate code motion between regions of affine control operations and other regions. Introduce `affine.terminator`, a special terminator operation that must be used to terminate blocks inside affine operations and transfers the control back to he region enclosing the affine operation. For brevity and readability reasons, allow `affine.for` and `affine.if` to omit the `affine.terminator` in their regions when using custom printing and parsing format. The custom parser injects the `affine.terminator` if it is missing so as to always have it present in constructed operations. Update transformations to account for the presence of terminator. In particular, most code motion transformation between loops should leave the terminator in place, and code motion between loops and non-affine blocks should drop the terminator. PiperOrigin-RevId: 240536998
* Replace usages of Instruction with Operation in the /IR directory.River Riddle2019-03-292-11/+10
| | | | | | This is step 2/N to renaming Instruction to Operation. PiperOrigin-RevId: 240459216
* Rename the Instruction class to Operation. This just renames the class, ↵River Riddle2019-03-291-1/+1
| | | | | | | | usages of Instruction will still refer to a typedef in the interim. This is step 1/N to renaming Instruction to Operation. PiperOrigin-RevId: 240431520
OpenPOWER on IntegriCloud