[SimplifyCFG] Make the value type of the hole check bitmask a power-of-2.
authorJuergen Ributzka <juergen@apple.com>
Mon, 17 Nov 2014 19:39:56 +0000 (19:39 +0000)
committerJuergen Ributzka <juergen@apple.com>
Mon, 17 Nov 2014 19:39:56 +0000 (19:39 +0000)
commit18db81a0ecef1faad96d474413359121a2f53347
tree7daf41e92ab31e4cdcf229c562a44fea8f20f729
parentd5b5eb6c975f52bb547cb4b0fbe8a12fdb506d0e
[SimplifyCFG] Make the value type of the hole check bitmask a power-of-2.

When converting a switch to a lookup table we might have to generate a bitmaks
to encode and check for holes in the original switch statement.

The type of this mask depends on the number of switch statements, which can
result in illegal types for pretty much all architectures.

To avoid unnecessary type legalization and help FastISel this commit increases
the size of the bitmask to next power-of-2 value when necessary.

This fixes rdar://problem/18984639.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222168 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/SimplifyCFG.cpp
test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll