[all-commits] [llvm/llvm-project] 6e7312: [RISCV] Select and/or/xor with certain constants t...

Piotr Fusik via All-commits all-commits at lists.llvm.org
Thu Dec 19 12:38:43 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6e7312bda60249c25e2ae9078d9f70bc2a65838c
      https://github.com/llvm/llvm-project/commit/6e7312bda60249c25e2ae9078d9f70bc2a65838c
  Author: Piotr Fusik <p.fusik at samsung.com>
  Date:   2024-12-19 (Thu, 19 Dec 2024)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
    M llvm/lib/Target/RISCV/RISCVISelDAGToDAG.h
    M llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
    M llvm/test/CodeGen/RISCV/pr84653_pr85190.ll
    M llvm/test/CodeGen/RISCV/zbb-logic-neg-imm.ll

  Log Message:
  -----------
  [RISCV] Select and/or/xor with certain constants to Zbb ANDN/ORN/XNOR (#120221)

    (and X, (C<<12|0xfff)) -> (ANDN X, ~C<<12)
    (or  X, (C<<12|0xfff)) -> (ORN  X, ~C<<12)
    (xor X, (C<<12|0xfff)) -> (XNOR X, ~C<<12)

Emits better code, typically by avoiding an `ADDI HI, -1` instruction.

Co-authored-by: Craig Topper <craig.topper at sifive.com>



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