Skip to content

Commit 6d1c6ec

Browse files
authored
[IR] SingleBlock::push_back operations to the back of the block (#66655)
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 <[email protected]>
1 parent c41b4b6 commit 6d1c6ec

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

mlir/include/mlir/IR/OpDefinition.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -932,10 +932,6 @@ struct SingleBlock : public TraitBase<ConcreteType, SingleBlock> {
932932
}
933933
template <typename OpT = ConcreteType>
934934
enable_if_single_region<OpT> insert(Block::iterator insertPt, Operation *op) {
935-
Block *body = getBody();
936-
// Insert op before the block's terminator if it has one
937-
if (insertPt == body->end() && body->hasTerminator())
938-
insertPt = Block::iterator(body->getTerminator());
939935
getBody()->getOperations().insert(insertPt, op);
940936
}
941937
};

0 commit comments

Comments
 (0)