[all-commits] [llvm/llvm-project] 552c0d: [RISCV] Use XORI/SLLI/ADDI to when materializing s...

Philip Reames via All-commits all-commits at lists.llvm.org
Thu Aug 28 10:50:07 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 552c0d14d13df8d05fc970425b806bc7e2ca9c8c
      https://github.com/llvm/llvm-project/commit/552c0d14d13df8d05fc970425b806bc7e2ca9c8c
  Author: Philip Reames <preames at rivosinc.com>
  Date:   2025-08-28 (Thu, 28 Aug 2025)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    M llvm/test/CodeGen/RISCV/select-const.ll
    M llvm/test/CodeGen/RISCV/select.ll

  Log Message:
  -----------
  [RISCV] Use XORI/SLLI/ADDI to when materializing select of constants (#155845)

This case is the inverse of the one introduced in #155644. The
complexity with the inversion is that we need to also invert the
condition before shifting it. I had originally planned to only do so
when the condition was "cheaply" invertible (i.e. didn't require the
xori), but when looking more closely at the diffs I noticed that while
the XORI prevents this from being an icount improvement, and actually
lengthens slightly the critical path, it does still reduce the number of
registers needed.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list