llvm-project
9c5ad62e - Revert "[RISCV][GISEL] Introduce the RISCVPostLegalizerLowering pass (#108991)"

Commit
1 year ago
Revert "[RISCV][GISEL] Introduce the RISCVPostLegalizerLowering pass (#108991)" This reverts commit 64972834c193632cbc47e54c0f0c721636b077e6. Based on the discussions in #108991 that happened post merge, we have decided to remove this pass in favor of generating `RISCV::G_*` opcodes in the legalizer. We may reconsider moving that code elsewhere in the future so that we can do a better job during generic combines. We don't feel that doing it in instruciton selection is the right decision today. Firstly, it requires us to manually do regbankselect on the newly introduced instructions. Secondly, it is more difficult to test since the test output will contain whatever `RISCV::G_*` instructions select to (instead of `RISCV::G_*`). My personal opinion is that the legalizer pass can be split into an early legalizer and a late legalizer, both before regbankselect. The first legalizer would not introduce target specific generic opcodes and the generic combiner would run after it. The second legalizer would introduce the target specific generic opcodes. I think this approach is better than the lowerer because the legalizer guarantees that whatever we lower to is legal, and apparently because it is more performant at compared to the lowerer (although, I'm not sure how true this is).
Parents
Loading