[PATCH] Fix a bug in IfConverter with nested predicates

Quentin Colombet qcolombet at apple.com
Wed Jul 24 13:22:41 PDT 2013


Thanks, committed in r187071.

-Quentin

On Jul 24, 2013, at 11:31 AM, Jakob Stoklund Olesen <stoklund at 2pi.dk> wrote:

> 
> On Jul 11, 2013, at 4:39 PM, Quentin Colombet <qcolombet at apple.com> wrote:
> 
>> Hi,
>> 
>> Here is a patch that fixes a bug in IfConverter with nested predicates.
>> 
>> The problem seems so obvious that I am wondering if I am missing something.
>> So although the patch is straightforward (one line change), please review carefully.
>> Note: I have tested it with -O3 -arch armv7 (apple iOS) against both SingleSource and Multisource tests.
>> 
>> ** Context **
>> Prior to this patch, IfConverter may widen the cases where a sequence of instructions were executed because of the way it uses nested predicates. This result in incorrect execution.
>> 
>> For instance, Let A be a basic block that flows conditionally into B and B be a predicated block.
>> B can be predicated with A.BrToBPredicate into A iff B.Predicate is less "permissive" than A.BrToBPredicate, i.e., iff A.BrToBPredicate subsumes B.Predicate.
>> 
>> The IfConverter was checking the opposite: B.Predicate subsumes A.BrToBPredicate.
>> 
>> <rdar://problem/14379453>
>> 
>> ** Solution **
>> Check the ‘subsumes’ property correctly.
>> 
>> Thanks for your review.
> 
> LGTM
> 
> Thanks,
> /jakob

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130724/87abc216/attachment.html>


More information about the llvm-commits mailing list