[all-commits] [llvm/llvm-project] beefca: [InstCombine][NFC] Add tests for simplifying selec...

Congcong Cai via All-commits all-commits at lists.llvm.org
Mon Apr 17 13:07:29 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: beefca7239fc72967e5844540f6c820a54df9833
      https://github.com/llvm/llvm-project/commit/beefca7239fc72967e5844540f6c820a54df9833
  Author: Congcong Cai <congcongcai0907 at 163.com>
  Date:   2023-04-17 (Mon, 17 Apr 2023)

  Changed paths:
    A llvm/test/Transforms/InstSimplify/select_or_and.ll

  Log Message:
  -----------
  [InstCombine][NFC] Add tests for simplifying select(X|Y,X|Y,X) to X|Y

Reviewed By: nikic

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


  Commit: ee3a260e78474b4499fc98737923ebb7df6eada8
      https://github.com/llvm/llvm-project/commit/ee3a260e78474b4499fc98737923ebb7df6eada8
  Author: Congcong Cai <congcongcai0907 at 163.com>
  Date:   2023-04-17 (Mon, 17 Apr 2023)

  Changed paths:
    M llvm/lib/Analysis/InstructionSimplify.cpp
    M llvm/test/Transforms/InstSimplify/select_or_and.ll

  Log Message:
  -----------
  [InstCombine] support fold select(X|Y,X|Y,X) to X|Y

Fixed: https://github.com/llvm/llvm-project/issues/62113
Add addtional check in `visitSelectInst` to:
1. match `select(X|Y==0, X, X|Y)` and replaced with `X|Y`
2. match `select(X&Y==-1, X, X&Y)` and replaced with `X&Y`

alive proof:
https://alive2.llvm.org/ce/z/4qHmv-
https://alive2.llvm.org/ce/z/c2MBGy

Reviewed By: nikic

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


Compare: https://github.com/llvm/llvm-project/compare/3abae1c88416...ee3a260e7847


More information about the All-commits mailing list