[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)
commitc9f2b5d535f8227cce0e8792411aa88f77c6a0f7
tree7535e902b93b5a11351b492b1bbe46fa47bdaeaa
parent3a665e02da1516642cdefff949d976a0e79b8708
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239105 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
test/CodeGen/X86/switch-or.ll