[PATCH] Fix a bug in IfConverter with nested predicates

Jakob Stoklund Olesen stoklund at 2pi.dk
Wed Jul 24 11:31:58 PDT 2013


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





More information about the llvm-commits mailing list