Fix optimisations of SELECT_CC which assumed result is boolean
authorOliver Stannard <oliver.stannard@arm.com>
Mon, 17 Nov 2014 10:49:31 +0000 (10:49 +0000)
committerOliver Stannard <oliver.stannard@arm.com>
Mon, 17 Nov 2014 10:49:31 +0000 (10:49 +0000)
commitd9d2703b712b121eaee4c0ada57ee989812fe8f1
tree6c9039c2f7e8addee4f13a4574d424b28733d625
parentc2eafa1ce3e01812d9ad2b61ac41290bf2ae532c
Fix optimisations of SELECT_CC which assumed result is boolean

Some optimisations in DAGCombiner cause miscompilations for targets that use
TargetLowering::UndefinedBooleanContent, because they assume that the results
of a SELECT_CC node are boolean values, and can be safely ANDed, ORed and
XORed. These optimisations are only valid for targets that use
ZeroOrOneBooleanContent or ZeroOrNegativeOneBooleanContent.

This is a follow-up to D6210/r221693.

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