Skip to content
Commit ee3a260e authored by Congcong Cai's avatar Congcong Cai
Browse files

[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
parent beefca72
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment