llvm-project
llvm-project copied to clipboard
Failure to optimize xor pattern to xor
| Bugzilla Link | 46475 |
| Version | trunk |
| OS | Linux |
| CC | @LebedevRI,@RKSimon,@nikic,@rotateright |
Extended Description
bool f(bool a, bool b)
{
return ((a & b) ^ b) | ((a & b) ^ a);
}
This can be optimized to return a ^ b;. This transformation is done by GCC, but not by LLVM.
Alive2: https://alive2.llvm.org/ce/z/i44xmq I'd like to work on this
Differential revision: https://reviews.llvm.org/D159380
The patch has landed, so I guess we can close this now.
The patch has landed, so I guess we can close this now.
For future reference, you should put something like Fixes https://github.com/llvm/llvm-project/issues/<issue num> in your commit message so that github does this for you :slightly_smiling_face: