[PATCH] D77060: [MLIR] Make OpBuilder(Block) default to inserting at Block::begin().

Theodore Popp via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 30 08:03:49 PDT 2020


tpopp created this revision.
tpopp added a reviewer: rriddle.
Herald added subscribers: llvm-commits, Joonsoo, liufengdb, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, burmako, jpienaar, mehdi_amini.
Herald added 1 blocking reviewer(s): rriddle.
Herald added a project: LLVM.

This is to make behavior consistent with the behavior of
OpBuilder(Region). This behavior is being set to the default rather than
the other option of Block::end because tests fail with that change
but not this change, so this is a rough argument that this behavior is
more desirable.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77060

Files:
  mlir/include/mlir/IR/Builders.h


Index: mlir/include/mlir/IR/Builders.h
===================================================================
--- mlir/include/mlir/IR/Builders.h
+++ mlir/include/mlir/IR/Builders.h
@@ -188,7 +188,8 @@
     setInsertionPoint(op);
   }
 
-  explicit OpBuilder(Block *block) : OpBuilder(block, block->end()) {}
+  /// Create a builder and set the insertion point to the start of the Block.
+  explicit OpBuilder(Block *block) : OpBuilder(block, block->begin()) {}
 
   OpBuilder(Block *block, Block::iterator insertPoint)
       : OpBuilder(block->getParent()) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77060.253597.patch
Type: text/x-patch
Size: 558 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200330/745bd620/attachment-0001.bin>


More information about the llvm-commits mailing list