[PATCH] D77787: [MLIR] Introduce a trait that defines a new scope for auto allocation
Uday Bondhugula via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 9 11:22:23 PDT 2020
bondhugula added inline comments.
================
Comment at: mlir/include/mlir/IR/OpDefinition.h:1039
+ static LogicalResult verifyTrait(Operation *op) {
+ if (op->getNumRegions() == 0)
+ return op->emitOpError("is expected to have regions");
----------------
rriddle wrote:
> bondhugula wrote:
> > rriddle wrote:
> > > What happens if the operation has a variadic number of regions?
> > That should be fine. The allocations of each are still to be freed when control transfers from that respective region to the op.
> Can we remove this check then? Otherwise, specific forms of operations would be legal and others not.
Ops that always have zero regions can't meaningfully have scoped allocations. We could just allow it for VariadicRegions instead by basing this check on the ZeroRegion trait?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77787/new/
https://reviews.llvm.org/D77787
More information about the llvm-commits
mailing list