[llvm] [RISCV][GISEL] Introduce the RISCVPostLegalizerLowering pass (PR #108991)

Amara Emerson via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 18 14:59:20 PDT 2024


aemerson wrote:

My mistake, I thought all the pieces to deprecate this for AArch64 was there. In any case, I want to give some more historical context for why we had this at all. Basically we wanted to do rewrites late once all optimizations were done (including all the post-legalizer combines). We would have done it in the selector if we could at the time. As Tobias said these are simple since they're basically selection split into two parts.

I would recommend the following for RISCV:
 * If you need to do late matching, after post-legalizer combines, either do this or have a custom MIR pass dedicated to one-shot lowering which may be a bit cheaper than using the combiner infrastructure.
 * If your rewrite can be expressed simply as a custom legalization rule then you can do it in the legalizer. One thing to keep in mind is that the earlier you start emitting target-specific-G_X operations the more you may lose in optimization potential by losing generality sooner.

https://github.com/llvm/llvm-project/pull/108991


More information about the llvm-commits mailing list