[PATCH] D78864: [MLIR] Add getBody() method to SingleImplicitBlockTerminator op trait.
River Riddle via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 25 12:12:07 PDT 2020
rriddle requested changes to this revision.
rriddle added inline comments.
This revision now requires changes to proceed.
================
Comment at: mlir/include/mlir/IR/Builders.h:212
+ static OpBuilder atBlockTerminator(Block *block) {
+ auto terminatorIt = std::prev(block->end());
+ assert(terminatorIt->isKnownTerminator() &&
----------------
This seems weird. I would expect you to just do `block->getTerminator()`
================
Comment at: mlir/include/mlir/IR/OpDefinition.h:1098
+ Block *getBody() {
+ Region ®ion = this->getOperation()->getRegion(0);
+ assert(!region.empty() && "Unexpected empty region.");
----------------
This is not applicable to all users of this trait, e.g. IfOp. SingleBlockImplicitTerminator does not imply a single region.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78864/new/
https://reviews.llvm.org/D78864
More information about the llvm-commits
mailing list