[PATCH] D72022: [mlir][Linalg] Extend generic ops to allow tensors

Nicolas Vasilache via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 2 07:44:58 PST 2020


nicolasvasilache marked an inline comment as done.
nicolasvasilache added inline comments.


================
Comment at: mlir/tools/mlir-tblgen/RewriterGen.cpp:577
+      if (resultTree.isNativeCodeCall()) {
+        os << symbolInfoMap.getAllRangeUse(
+            val, "SmallVector<Value, 4> values{0};", "\n");
----------------
nicolasvasilache wrote:
> rriddle wrote:
> > nicolasvasilache wrote:
> > > rriddle wrote:
> > > > It isn't immediately clear to me why this is necessary. What return value is convertible to small vector, but not ArrayRef for example?
> > > Reworked and added a comment.
> > Could you use ValueRange instead?
> Not immediately:
> 
> ```
> /usr/local/google/home/ntv/work/github/llvm-project/mlir/include/mlir/IR/OperationSupport.h:623:3: note: candidate constructor
>   ValueRange(iterator_range<OperandRange::iterator> values)
>   ^
> /usr/local/google/home/ntv/work/github/llvm-project/mlir/include/mlir/IR/OperationSupport.h:625:3: note: candidate constructor
>   ValueRange(iterator_range<ResultRange::iterator> values)
>   ^
> /usr/local/google/home/ntv/work/github/llvm-project/mlir/include/mlir/IR/OperationSupport.h:627:3: note: candidate constructor
>   ValueRange(ArrayRef<Value> values = llvm::None);
>   ^
> /usr/local/google/home/ntv/work/github/llvm-project/mlir/include/mlir/IR/OperationSupport.h:628:3: note: candidate constructor
>   ValueRange(OperandRange values);
>   ^
> /usr/local/google/home/ntv/work/github/llvm-project/mlir/include/mlir/IR/OperationSupport.h:629:3: note: candidate constructor
>   ValueRange(ResultRange values);
>   ^
> /usr/local/google/home/ntv/work/github/llvm-project/mlir/include/mlir/Support/STLExtras.h:223:3: note: candidate inherited constructor
>   indexed_accessor_range_base(const iterator_range<iterator> &range)
>   ^
> /usr/local/google/home/ntv/work/github/llvm-project/mlir/include/mlir/IR/OperationSupport.h:613:21: note: constructor from base class 'indexed_accessor_range_base<mlir::ValueRange, llvm::PointerUnion<const mlir::Value *, mlir::OpOperand *, mlir::OpResult *>, mlir::Value, mlir::Value, mlir::Value>' inherited here
>   using RangeBaseT::RangeBaseT;
> 
> ```
Forgot the first line, here:
```
tools/mlir/test/lib/Transforms/../DeclarativeTransforms/TestLinalgTransformPatterns.h.inc:579:19: error: call to constructor of 'mlir::ValueRange' is ambiguous
    for (auto v : ValueRange{ {permuteGenericLinalgOp(rewriter, op, {1, 2, 0}, "PERMUTE")} }) { tblgen_repl_values.push_back(v); }
                  ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72022/new/

https://reviews.llvm.org/D72022





More information about the llvm-commits mailing list