[PATCH] D72780: [mlir][Linalg] Fix Linalg EDSC builders

Ahmed S. Taei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 15 11:27:49 PST 2020


asaadaldien accepted this revision.
asaadaldien added a comment.
This revision is now accepted and ready to land.

LGTM! an inline question trying to understand the Builder blocks scoping here.



================
Comment at: mlir/lib/Dialect/Linalg/EDSC/Builders.cpp:97
+  region.push_front(new Block);
   OpBuilder bb(op->getRegions().front());
   ScopedContext scope(bb, op->getLoc());
----------------
```
OpBuilder bb(region);
```


================
Comment at: mlir/lib/Dialect/Linalg/EDSC/Builders.cpp:103
       [&] { regionBuilder(b.getBlock()->getArguments()); });
+  region.getBlocks().erase(region.begin());
+  assert(op->getNumRegions() == 1);
----------------
Does the builder create a new block instead of mutating region.begin that we have to clean up ? 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72780





More information about the llvm-commits mailing list