[all-commits] [llvm/llvm-project] 074f23: [InstCombine] Fold two select patterns into or-and

Yingwei Zheng via All-commits all-commits at lists.llvm.org
Tue Aug 29 09:58:33 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 074f23e3e199a8067f0295302e07e9837c6f16d1
      https://github.com/llvm/llvm-project/commit/074f23e3e199a8067f0295302e07e9837c6f16d1
  Author: Yingwei Zheng <dtcxzyw2333 at gmail.com>
  Date:   2023-08-30 (Wed, 30 Aug 2023)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
    M llvm/test/Transforms/InstCombine/select-and-or.ll

  Log Message:
  -----------
  [InstCombine] Fold two select patterns into or-and

This patch is the follow-up improvement of D122152.
Fixes https://github.com/llvm/llvm-project/issues/64558.

`select (a | c), a, b -> select a, true, (select ~c, b, false)` where `c` is free to invert
`select (c & ~b), a, b -> select b, true, (select c, a, false)`
Alive2: https://alive2.llvm.org/ce/z/KwxtMA

Reviewed By: nikic

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




More information about the All-commits mailing list