[InstCombine] Fold (xor (min/max X, Y), -1) -> (max/min ~X, ~Y) when X and Y are...
authorCraig Topper <craig.topper@intel.com>
Thu, 13 Sep 2018 18:52:58 +0000 (18:52 +0000)
committerCraig Topper <craig.topper@intel.com>
Thu, 13 Sep 2018 18:52:58 +0000 (18:52 +0000)
commit8fc05ce34016bcdf2529ed6bcfcb05e450b4e034
tree63864ae899b059f5421a48fc4264adf3cae26779
parent3fc5e72d84178c55faef8784c2d0e6c33a5639cd
[InstCombine] Fold (xor (min/max X, Y), -1) -> (max/min ~X, ~Y) when X and Y are freely invertible.

This allows the xor to be removed completely.

This might help with recomitting r341674, but seems good regardless.

Coincidentally fixes PR38915.

Differential Revision: https://reviews.llvm.org/D51964

llvm-svn: 342163
llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
llvm/test/Transforms/InstCombine/pr38915.ll [new file with mode: 0644]
llvm/test/Transforms/InstCombine/xor.ll