summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Dialect/Linalg
Commit message (Collapse)AuthorAgeFilesLines
...
* Add a linalg.transpose opNicolas Vasilache2019-08-231-2/+35
| | | | | | | | | | | | | | A linalg.transpose op is a pure metadata operation that takes a view + permutation map and produces another view of the same underlying data, with a different reindexing. This is a pure metadata operation that does not touch the underlying data. Example: ``` %t = linalg.transpose %v (i, j) -> (j, i) : !linalg.view<?x?xf32> ``` PiperOrigin-RevId: 265139429
* Add lowering of linalg.copy to an external C++ library and a test.Nicolas Vasilache2019-08-231-8/+19
| | | | | | This CL extends support for lowering of linalg to external C++ libraries with CopyOp. Currently this can only work when the permutation maps in the copies are identity. Future support for permutations will be added later. PiperOrigin-RevId: 265093025
* Avoid overflow when lowering linalg.sliceNicolas Vasilache2019-08-221-20/+21
| | | | | | | | linalg.subview used to lower to a slice with a bounded range resulting in correct bounded accesses. However linalg.slice could still index out of bounds. This CL moves the bounding to linalg.slice. LLVM select and cmp ops gain a more idiomatic builder. PiperOrigin-RevId: 264897125
* NFC: Fix path of LinalgLibraryOpInterfaces inc files.River Riddle2019-08-221-1/+1
| | | | PiperOrigin-RevId: 264827908
* Add support for generating operation interfaces from the ODS framework.River Riddle2019-08-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Operation interfaces generally require a bit of boilerplate code to connect all of the pieces together. This cl introduces mechanisms in the ODS to allow for generating operation interfaces via the 'OpInterface' class. Providing a definition of the `OpInterface` class will auto-generate the c++ classes for the interface. An `OpInterface` includes a name, for the c++ class, along with a list of interface methods. There are two types of methods that can be used with an interface, `InterfaceMethod` and `StaticInterfaceMethod`. They are both comprised of the same core components, with the distinction that `StaticInterfaceMethod` models a static method on the derived operation. An `InterfaceMethod` is comprised of the following components: * ReturnType - A string corresponding to the c++ return type of the method. * MethodName - A string corresponding to the desired name of the method. * Arguments - A dag of strings that correspond to a c++ type and variable name respectively. * MethodBody (Optional) - An optional explicit implementation of the interface method. def MyInterface : OpInterface<"MyInterface"> { let methods = [ // A simple non-static method with no inputs. InterfaceMethod<"unsigned", "foo">, // A new non-static method accepting an input argument. InterfaceMethod<"Value *", "bar", (ins "unsigned":$i)>, // Query a static property of the derived operation. StaticInterfaceMethod<"unsigned", "fooStatic">, // Provide the definition of a static interface method. // Note: `ConcreteOp` corresponds to the derived operation typename. StaticInterfaceMethod<"Operation *", "create", (ins "OpBuilder &":$builder, "Location":$loc), [{ return builder.create<ConcreteOp>(loc); }]>, // Provide a definition of the non-static method. // Note: `op` corresponds to the derived operation variable. InterfaceMethod<"unsigned", "getNumInputsAndOutputs", (ins), [{ return op.getNumInputs() + op.getNumOutputs(); }]>, ]; PiperOrigin-RevId: 264754898
* Remove dead getLLVMLibraryCallImplDefinition in Linalg's ↵Nicolas Vasilache2019-08-211-27/+4
| | | | | | LowerToLLVMDialect.cpp - NFC PiperOrigin-RevId: 264740014
* NFC: Move AffineOps dialect to the Dialect sub-directory.River Riddle2019-08-201-6/+6
| | | | PiperOrigin-RevId: 264482571
* Move Linalg and VectorOps dialects to the Dialect subdir - NFCNicolas Vasilache2019-08-1910-0/+3760
PiperOrigin-RevId: 264277760
OpenPOWER on IntegriCloud