[SDAG switch lowering] Fix switch case -> or merging for 0 and INT_MIN
authorBenjamin Kramer <benny.kra@googlemail.com>
Thu, 4 Jun 2015 22:05:51 +0000 (22:05 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Thu, 4 Jun 2015 22:05:51 +0000 (22:05 +0000)
commitff0fb6936b43d575ca23cf769bf24d9a963e6f19
tree8e459485d30e34d2f96e62aee9d6d1a4e2073da0
parentd772ef3d9f8f54928043bdf4cb1518e82d254542
[SDAG switch lowering] Fix switch case -> or merging for 0 and INT_MIN

The big/small ordering here is based on signed values so SmallValue will
be INT_MIN and BigValue 0. This shouldn't be a problem but the code
assumed that BigValue always had more bits set than SmallValue.

We used to just miss the transformation, but a recent refactoring of
mine turned this into an assertion failure.

llvm-svn: 239105
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/test/CodeGen/X86/switch-or.ll