[PATCH] D78071: [mlir] [VectorOps] Progressive lowering of vector.broadcast

Nicolas Vasilache via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 16 15:04:57 PDT 2020


nicolasvasilache accepted this revision.
nicolasvasilache added inline comments.
This revision is now accepted and ready to land.


================
Comment at: mlir/lib/Dialect/Vector/VectorTransforms.cpp:1021
+      Value result = rewriter.create<SplatOp>(loc, dstType, zero);
+      for (int64_t d = 0, dim = dstType.getDimSize(0); d < dim; ++d) {
+        result = rewriter.create<vector::InsertOp>(loc, bcst, result, d);
----------------
nit: extra braces 


================
Comment at: mlir/lib/Dialect/Vector/VectorTransforms.cpp:1052
+    //   %x = [%a,%b,%c,%d]
+    if (m >= 0) {
+      // Stretching scalar inside vector (e.g. vector<1xf32>) can use splat.
----------------
```
// All trailing dimensions are the same. Simply pass through.
if (m < 0) {
    rewriter.replaceOp(op, op.source());
    return success();
}
```
and remove nesting for another level?



================
Comment at: mlir/lib/Dialect/Vector/VectorTransforms.cpp:1084
+
+    // All trailing dimensions are the same. Simply pass through.
+    rewriter.replaceOp(op, op.source());
----------------
by the time I get here I forget why I am here in the first place :) 
Move above to an early exit?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78071





More information about the llvm-commits mailing list