From 0af88dd531bee6b1727dec88135aeab7d6c1f6ee Mon Sep 17 00:00:00 2001 From: Victor Perez Date: Mon, 18 Sep 2023 14:32:14 +0100 Subject: [PATCH] [IR] `SingleBlock::push_back` operations to the back of the block Instead of checking whether the last operation might be a terminator, always insert operations to the end of the block. Signed-off-by: Victor Perez --- mlir/include/mlir/IR/OpDefinition.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mlir/include/mlir/IR/OpDefinition.h b/mlir/include/mlir/IR/OpDefinition.h index 306b3789a044f..82d0e93a8ee2f 100644 --- a/mlir/include/mlir/IR/OpDefinition.h +++ b/mlir/include/mlir/IR/OpDefinition.h @@ -932,10 +932,6 @@ struct SingleBlock : public TraitBase { } template enable_if_single_region insert(Block::iterator insertPt, Operation *op) { - Block *body = getBody(); - // Insert op before the block's terminator if it has one - if (insertPt == body->end() && body->hasTerminator()) - insertPt = Block::iterator(body->getTerminator()); getBody()->getOperations().insert(insertPt, op); } };