[all-commits] [llvm/llvm-project] 0441df: [InstCombine, InstSimplify] Optimize select followe...

Juneyoung Lee via All-commits all-commits at lists.llvm.org
Mon Jan 18 16:18:44 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 0441df94ad874c0c59a3785bd54a3d2f9a616fac
      https://github.com/llvm/llvm-project/commit/0441df94ad874c0c59a3785bd54a3d2f9a616fac
  Author: Juneyoung Lee <aqjune at gmail.com>
  Date:   2021-01-19 (Tue, 19 Jan 2021)

  Changed paths:
    M llvm/lib/Analysis/InstructionSimplify.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
    M llvm/test/Transforms/InstCombine/select-safe-transforms.ll

  Log Message:
  -----------
  [InstCombine,InstSimplify] Optimize select followed by and/or/xor

This patch adds `A & (A && B)` -> `A && B`  (similarly for or + logical or)

Also, this patch adds `~(select C, (icmp pred X, Y), const)` -> `select C, (icmp pred' X, Y), ~const`.

Alive2 proof:
merge_and: https://alive2.llvm.org/ce/z/teMR97
merge_or: https://alive2.llvm.org/ce/z/b4yZUp
xor_and: https://alive2.llvm.org/ce/z/_-TXHi
xor_or: https://alive2.llvm.org/ce/z/2uYx_a

Reviewed By: nikic

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




More information about the All-commits mailing list