[mlir] Slightly optimize getRegions checks by inlining size check
authorRiver Riddle <riddleriver@gmail.com>
Mon, 5 Dec 2022 18:40:28 +0000 (10:40 -0800)
committerRiver Riddle <riddleriver@gmail.com>
Mon, 5 Dec 2022 19:31:50 +0000 (11:31 -0800)
commit737391bdf3d09fdb6789b24891b07a2668d3e44f
tree8b8413251193aab9f4348181be851afda36457a2
parentbe51fa4580b3274d35cc77bedb238a9ad5fb04bc
[mlir] Slightly optimize getRegions checks by inlining size check

Calculating the position of the region trailing objects isn't free,
given that it's the last trailing object, and inlining the size check
removes the need for users to explicitly add size checks for
micro-optimization.
mlir/include/mlir/IR/Operation.h
mlir/lib/IR/AsmPrinter.cpp