[PATCH] D49954: [InstCombine] Fold Select with Xor condition

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 28 07:47:12 PDT 2018


spatel added a comment.

This was noted as an inline comment on the test file: this transform is not xor-specific. Example:
https://rise4fun.com/Alive/R4P

I think it works for any binop with an "identity constant", so I'd prefer to see this patch generalized to use ConstantExpr::getBinOpIdentity().
That said, these cmp+select transforms are getting into the gray area of equivalence substitutions that are better handled by GVN.
At the least, I'd like to know if we can get any stats on how often this happens (collect transform stats using test-suite or some other well-known benchmarks).


https://reviews.llvm.org/D49954





More information about the llvm-commits mailing list