[PATCH] D80138: [mlir] ensureRegionTerminator: take OpBuilder

Alex Zinenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 18 10:48:13 PDT 2020


ftynse added a comment.

In D80138#2042064 <https://reviews.llvm.org/D80138#2042064>, @nicolasvasilache wrote:

> After seeing the stack of CL I am wondering whether RewritePatterns should only operate on Wrapper classes around Region, Block and Operation that would inherit privately.
>
> Thoughts?


I thought about this, but it looks infeasible without reimplementing all of the core classes. E.g., if we pass in an OperationWrapper, but we still want specific ops, we then add a possibility to `dyn_cast<SomeOp>`, from which an `Operaiton *` can be trivially extracted. Same for the remaining classes. What we seem to be needing is some const-semantics for IR classes, but we decided against that for good reasons. These reasons would still apply to wrappers that essentially achieves `const` methods.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80138





More information about the llvm-commits mailing list