[PATCH] D78504: [mlir] Clarify operation/block assert message.

Matthias Kramm via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 20 10:16:34 PDT 2020


matthiaskramm created this revision.
matthiaskramm added a reviewer: rriddle.
Herald added subscribers: llvm-commits, frgossen, grosul1, Joonsoo, liufengdb, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, jpienaar, mehdi_amini.
Herald added 1 blocking reviewer(s): rriddle.
Herald added a project: LLVM.
rriddle accepted this revision.
This revision is now accepted and ready to land.

When you try to add the same operation into a block twice, we used
to print "already in an operation block", which sounded misleading.
(Sound like e.g. our builder insertion point is inside a block.)
Instead, make it clear that the operation is being used twice.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78504

Files:
  mlir/lib/IR/Operation.cpp


Index: mlir/lib/IR/Operation.cpp
===================================================================
--- mlir/lib/IR/Operation.cpp
+++ mlir/lib/IR/Operation.cpp
@@ -410,7 +410,7 @@
 /// This is a trait method invoked when an operation is added to a block.  We
 /// keep the block pointer up to date.
 void llvm::ilist_traits<::mlir::Operation>::addNodeToList(Operation *op) {
-  assert(!op->getBlock() && "already in an operation block!");
+  assert(!op->getBlock() && "operation already exists in some block!");
   op->block = getContainingBlock();
 
   // Invalidate the order on the operation.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78504.258778.patch
Type: text/x-patch
Size: 597 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200420/bd6ce25b/attachment.bin>


More information about the llvm-commits mailing list