[llvm] r222168 - [SimplifyCFG] Make the value type of the hole check bitmask a power-of-2.

Hans Wennborg hans at chromium.org
Mon Nov 17 15:02:54 PST 2014


On Mon, Nov 17, 2014 at 3:00 PM, Juergen Ributzka <juergen at apple.com> wrote:
>
> On Nov 17, 2014, at 2:27 PM, Hans Wennborg <hans at chromium.org> wrote:
>
> On Mon, Nov 17, 2014 at 11:39 AM, Juergen Ributzka <juergen at apple.com>
> wrote:
>
> Author: ributzka
> Date: Mon Nov 17 13:39:56 2014
> New Revision: 222168
>
> URL: http://llvm.org/viewvc/llvm-project?rev=222168&view=rev
> Log:
> [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.
>
>
> Can you elaborate on what's in the bug report?
>
>
> It basically tracks the fact that fast-isel couldn’t select ‘trunc’, etc of
> illegal types that didn’t exist in the original LLVM IR and were generated
> later on by SimplifyCFG.
>
>
> I didn't realize illegal types had to avoided. Is the motivation for
> this change that fast-isel would fall back?
>
>
> I don’t know if we have to avoid illegal types, but I think we should (if we
> can). In this particular case it was easy to avoid them and it made
> fast-isel happy.

OK, that makes sense. Thanks!

 - Hans




More information about the llvm-commits mailing list