[llvm] [InstCombine] Fold `select (a == V1 | a == V2), a, V2` to `select (a == V1), V1, V2` (PR #76203)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 22 03:41:24 PST 2023


https://github.com/nikic requested changes to this pull request.

This transform looks unnecessarily specific to me. I think what you actually want to do is this: https://alive2.llvm.org/ce/z/sN48Rm

We only need the one icmp in the condition, the other one is irrelevant. If the other icmp allows an operand replacement in the select, we already have a separate fold that will do that (select value equivalence fold).

https://github.com/llvm/llvm-project/pull/76203


More information about the llvm-commits mailing list