[all-commits] [llvm/llvm-project] 76b6bf: [RISCV] Add bltu/bgeu zero => bnez/beqz canonicali...

Alex Bradbury via All-commits all-commits at lists.llvm.org
Wed May 28 22:47:07 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 76b6bf478965c20f937cb5e89b5680de278e59a1
      https://github.com/llvm/llvm-project/commit/76b6bf478965c20f937cb5e89b5680de278e59a1
  Author: Alex Bradbury <asb at igalia.com>
  Date:   2025-05-29 (Thu, 29 May 2025)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
    M llvm/test/CodeGen/RISCV/machine-copyprop-simplifyinstruction.mir

  Log Message:
  -----------
  [RISCV] Add bltu/bgeu zero => bnez/beqz canonicalisation to RISCVInstrInfo::simplifyInstruction (#141775)

We can end up with bltu/bgeu with the zero register as the 0th operand
after tail duplication and then machine copy propagation. Canonicalising
in simplifyInstruction (called from MachineCopyPropagation) both
produces easier to read assembly output, and means it's possible that
the compressed c.beqz/c.bnez forms are produced.



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