[all-commits] [llvm/llvm-project] bbdf24: [DAGCombine] Fold redundant select

Sam Parker via All-commits all-commits at lists.llvm.org
Thu Feb 2 01:43:44 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bbdf24357932b064f2aa18ea1356b474e0220dde
      https://github.com/llvm/llvm-project/commit/bbdf24357932b064f2aa18ea1356b474e0220dde
  Author: Samuel Parker <sam.parker at arm.com>
  Date:   2023-02-02 (Thu, 02 Feb 2023)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/test/CodeGen/ARM/fpclamptosat.ll
    M llvm/test/CodeGen/ARM/fpclamptosat_vec.ll
    M llvm/test/CodeGen/RISCV/fpclamptosat.ll
    M llvm/test/CodeGen/RISCV/fpclamptosat_vec.ll
    M llvm/test/CodeGen/Thumb2/mve-fpclamptosat_vec.ll
    M llvm/test/CodeGen/WebAssembly/fpclamptosat.ll
    M llvm/test/CodeGen/WebAssembly/fpclamptosat_vec.ll
    M llvm/test/CodeGen/X86/fpclamptosat.ll
    M llvm/test/CodeGen/X86/fpclamptosat_vec.ll
    M llvm/test/CodeGen/X86/sdiv_fix_sat.ll

  Log Message:
  -----------
  [DAGCombine] Fold redundant select

If a chain of two selects share a true/false value and are controlled
by two setcc nodes, that are never both true, we can fold away one of
the selects. So, the following:
(select (setcc X, const0, eq), Y,
  (select (setcc X, const1, eq), Z, Y))

Can be combined to:
  select (setcc X, const1, eq) Z, Y

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




More information about the All-commits mailing list