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

Sam Parker via All-commits all-commits at lists.llvm.org
Wed Feb 15 02:34:24 PST 2023


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

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    A llvm/test/CodeGen/AArch64/redundant-select.ll
    M llvm/test/CodeGen/RISCV/fpclamptosat_vec.ll
    M llvm/test/CodeGen/WebAssembly/fpclamptosat.ll
    M llvm/test/CodeGen/WebAssembly/fpclamptosat_vec.ll
    M llvm/test/CodeGen/X86/fpclamptosat_vec.ll

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

Recommit bbdf24357932b064f2aa18ea1356b474e0220dde.

Original commit message:

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