clangir icon indicating copy to clipboard operation
clangir copied to clipboard

Mark more operations as side-effectful to enable canonicalizer pass in CIR

Open gitoleg opened this issue 10 months ago • 0 comments

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.

gitoleg avatar Apr 12 '24 09:04 gitoleg