[all-commits] [llvm/llvm-project] baeec9: [RISCV] Canonicalize beq/bne with x0 as first arg ...

Alex Bradbury via All-commits all-commits at lists.llvm.org
Thu May 29 03:29:07 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: baeec97ebd1ce7043f86f3cd294b9d967afb5f81
      https://github.com/llvm/llvm-project/commit/baeec97ebd1ce7043f86f3cd294b9d967afb5f81
  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] Canonicalize beq/bne with x0 as first arg to beqz/bnez (#141781)

This covers similar ground as #139086. Although I think it makes sense
to land both, the practical motivation for #139086 is significantly
reduced here.

This canonicalisation makes no difference to compressibility (we have
compress patterns for the operands in either order), but it does mean
that easier to read assembly is printed, as we don't have aliases
defined for beq/bne with x0 in either position.



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