The idea to use the canonicalizer pass that seems too aggressively removes unused instructions, but in general any DCE like pass may eliminate side-effect free instructions once they are not used.
Another problem with the canonicalizer pass that it extensively use such MLIR feature as basic blocks with arguments, which is awesome! But at the same time it leads to errors like branch has 0 operands for successor #0 but target block has 1. I believe the bug is on the llvm dialect / MLIR side, so one need to check CIR with some large code base before adding this pass into pipeline.
The idea to use the
canonicalizer
pass that seems too aggressively removes unused instructions, but in general any DCE like pass may eliminate side-effect free instructions once they are not used.Another problem with the
canonicalizer
pass that it extensively use suchMLIR
feature as basic blocks with arguments, which is awesome! But at the same time it leads to errors likebranch has 0 operands for successor #0 but target block has 1
. I believe the bug is on thellvm dialect
/MLIR
side, so one need to check CIR with some large code base before adding this pass into pipeline.