[llvm] Add late optimization pass for riscv (PR #117060)

Mikhail R. Gadelha via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 6 05:52:17 PST 2024


mikhailramalho wrote:

Yesterday I noticed `RISCVInstrInfo::optimizeCondBranch`, which has code to detect `ADDI x0, imm`. Maybe we can use it in the future to handle this case of `bez/bnez zero` simplification. 

Currently, it works only for virtual regs, and it's designed to simplify some cases of blt/bge, but it should be straightforward to change it

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


More information about the llvm-commits mailing list