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

Juergen Ributzka juergen at apple.com
Mon Nov 17 15:00:10 PST 2014


> 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 <mailto: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.

—Juergen

> 
> Thanks,
> Hans

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141117/492abbe7/attachment.html>


More information about the llvm-commits mailing list