[InstCombine] add folds for xor-of-icmp signbit tests (PR36682)
authorSanjay Patel <spatel@rotateright.com>
Thu, 22 Mar 2018 14:08:16 +0000 (14:08 +0000)
committerSanjay Patel <spatel@rotateright.com>
Thu, 22 Mar 2018 14:08:16 +0000 (14:08 +0000)
commit94c91b78e7f6a7fca6f569eb8264bc94a6e21511
treea3c6e10041142d56c6287121f880fca5fea7c269
parentf070268701e2a0c30b76b034b6f0e69f562c6145
[InstCombine] add folds for xor-of-icmp signbit tests (PR36682)

This is a retry of r328119 which was reverted at r328145 because
it could crash by trying to combine icmps with different operand
types. This version has a check for that and additional tests.

Original commit message:

This is part of solving:
https://bugs.llvm.org/show_bug.cgi?id=36682

There's also a leftover improvement from the long-ago-closed:
https://bugs.llvm.org/show_bug.cgi?id=5438

https://rise4fun.com/Alive/dC1

llvm-svn: 328197
llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
llvm/test/Transforms/InstCombine/compare-signs.ll
llvm/test/Transforms/InstCombine/xor-icmps.ll