[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)
commitc9591e9bdb68b00faa2dc678eeaec59d7c9f687e
treef46bc04e595f4854a7f333201a079f01d700253d
parent8012cadbf32335457b8a4ea85783850249ccb805
[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.

llvm-svn: 222168
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll