diff --git a/mlir/include/mlir/EDSC/Intrinsics.h b/mlir/include/mlir/EDSC/Intrinsics.h --- a/mlir/include/mlir/EDSC/Intrinsics.h +++ b/mlir/include/mlir/EDSC/Intrinsics.h @@ -107,7 +107,10 @@ SmallVector values; }; -template inline T unpack(T value) { return value; } +template +inline T unpack(T value) { + return value; +} inline detail::ValueHandleArray unpack(ArrayRef values) { return detail::ValueHandleArray(values); @@ -122,7 +125,8 @@ /// Implementing it as a subclass allows it to compose all the way to Value. /// Without subclassing, implicit conversion to Value would fail when composing /// in patterns such as: `select(a, b, select(c, d, e))`. -template struct ValueBuilder : public ValueHandle { +template +struct ValueBuilder : public ValueHandle { // Builder-based template ValueBuilder(Args... args) @@ -169,7 +173,8 @@ ValueBuilder() : ValueHandle(ValueHandle::create()) {} }; -template struct OperationBuilder : public OperationHandle { +template +struct OperationBuilder : public OperationHandle { template OperationBuilder(Args... args) : OperationHandle(OperationHandle::create(detail::unpack(args)...)) {} @@ -200,11 +205,14 @@ using affine_store = OperationBuilder; using alloc = ValueBuilder; using call = OperationBuilder; +using constant = ValueBuilder; using constant_float = ValueBuilder; using constant_index = ValueBuilder; using constant_int = ValueBuilder; using dealloc = OperationBuilder; using dim = ValueBuilder; +using extract_element = ValueBuilder; +using index_cast = ValueBuilder; using muli = ValueBuilder; using mulf = ValueBuilder; using memref_cast = ValueBuilder; @@ -213,7 +221,10 @@ using std_load = ValueBuilder; using std_store = OperationBuilder; using subi = ValueBuilder; +using sub_view = ValueBuilder; using tanh = ValueBuilder; +using tensor_load = ValueBuilder; +using tensor_store = OperationBuilder; using view = ValueBuilder; using zero_extendi = ValueBuilder; using sign_extendi = ValueBuilder; diff --git a/mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp b/mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp --- a/mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp +++ b/mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp @@ -51,7 +51,7 @@ using addi = ValueBuilder; using bitcast = ValueBuilder; using cmpi = ValueBuilder; -using constant = ValueBuilder; +using llvm_constant = ValueBuilder; using extractvalue = ValueBuilder; using gep = ValueBuilder; using insertvalue = ValueBuilder; @@ -264,8 +264,8 @@ if (sliceOp.getShapedType().getRank() == 0) return rewriter.replaceOp(op, {desc}), matchSuccess(); - Value zero = - constant(int64Ty, rewriter.getIntegerAttr(rewriter.getIndexType(), 0)); + Value zero = llvm_constant( + int64Ty, rewriter.getIntegerAttr(rewriter.getIndexType(), 0)); // Compute and insert view sizes (max - min along the range) and strides. // Skip the non-range operands as they will be projected away from the view. int numNewDims = 0;