Fixed: https://github.com/llvm/llvm-project/issues/62113
Add addtional check in visitSelectInst to:
- match select(X|Y==0, X, X|Y) and replaced with X|Y
- 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
Should we also have select(X|Y != 0, X | Y, X or Y)?