[all-commits] [llvm/llvm-project] f6dc75: [RISCV] Add DAG combine to pull xor with 1 through...

Craig Topper via All-commits all-commits at lists.llvm.org
Tue Jul 25 09:14:12 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f6dc75cdd8756a8faa36b6f2e0d517eb8464c396
      https://github.com/llvm/llvm-project/commit/f6dc75cdd8756a8faa36b6f2e0d517eb8464c396
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2023-07-25 (Tue, 25 Jul 2023)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    M llvm/test/CodeGen/RISCV/condops.ll

  Log Message:
  -----------
  [RISCV] Add DAG combine to pull xor with 1 through select idiom that uses czero_eqz/nez.

If we are selecting between two setccs that need to be legalized
with xor, the select will be legalized first. Detect this pattern
so we can pull the xor through to expose it to additional
optimizations.

We could generalize this to other operations, but those normally
get handled in DAG combine before select legalization.

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D156159




More information about the All-commits mailing list