LLVM incorrectly folds xor into select
authorOliver Stannard <oliver.stannard@arm.com>
Tue, 11 Nov 2014 17:36:01 +0000 (17:36 +0000)
committerOliver Stannard <oliver.stannard@arm.com>
Tue, 11 Nov 2014 17:36:01 +0000 (17:36 +0000)
commit659b1491b81709e9ca4a35997865a61f5c0afd9d
tree28bf79c2cc351fbcd89e51c26056873bce0010bc
parent328bc2f89e5bb60052dbbd2e1c388ea2d24ba77e
LLVM incorrectly folds xor into select

LLVM replaces the SelectionDAG pattern (xor (set_cc cc x y) 1) with
(set_cc !cc x y), which is only correct when the xor has type i1.
Instead, we should check that the constant operand to the xor is all
ones.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221693 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/ARM/select_xform.ll