[PATCH] D72094: [mlir][linalg] Lower linalg to affine loops

Mahesh Ravishankar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 3 00:00:15 PST 2020


mravishankar added inline comments.


================
Comment at: mlir/lib/Dialect/Linalg/Utils/Utils.cpp:113
+  for (const Value range : ranges) {
+    RangeOp rangeOp = cast<RangeOp>(range.getDefiningOp());
+    lbs.push_back(ValueHandle(rangeOp.min()));
----------------
ftynse wrote:
> Does something guarantee that there is a defining op?
You can probably change `emitLoopRanges` that generates the `ranges` argument at the called of this function to return `Operation *` instead of `Value`.


================
Comment at: mlir/lib/Dialect/Linalg/Utils/Utils.cpp:114
+    RangeOp rangeOp = cast<RangeOp>(range.getDefiningOp());
+    lbs.push_back(ValueHandle(rangeOp.min()));
+    ubs.push_back(ValueHandle(rangeOp.max()));
----------------
Nit: I think you can use `lbs.emplace_back(rangeOp.min())`. Same below


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72094





More information about the llvm-commits mailing list