[llvm] [RISCV] Don't transfer (select c, t, f) to Zicond when optimizing for size (PR #163501)

Christian Herber via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 20 05:48:24 PDT 2025


christian-herber-nxp wrote:

> In general, there is no code size issue when the branch version
> (branch+mv+mv) is replaced with the Zicond version
> (czero.nez+czero.eqz+or), as both contain 3 instructions.

the number of instructions is not really important for code size, but rather the number of bytes. Potentially, the entire branch+mv+mv sequence can be compressed instruction, thus you get the full thing with just 48 B of instructions. Worst case is 64B when C extension is there, as mv can always be compressed.

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


More information about the llvm-commits mailing list