[llvm-commits] [PATCH] [llvm] Transform (x&C)>V into (x&C)!=0 wherepossible.
Nuno Lopes
nunoplopes at sapo.pt
Fri Dec 14 08:03:57 PST 2012
> Nuno Lopes [mailto:nunoplopes at sapo.pt] wrote:
>> As far as I understand, you're saying that (X & 127) sgt 31 is equivalent
>> to:
>> (X & 127) ne 0
>>
>> Which is *not* correct. The first expression is, however, equivalent to:
>> (X & 96) ne 0
>
> No; using that motivating example from README.txt, the transformation of
> (x & 127) > 31 into (x & 96) > 31 is already done, by
> visitICmpInst() calling SimplifyDemandedBits(). This change just adds the
> remaining step of transforming (x & 96) > 31 into (x &
> 96) != 0.
Ok, so please add a CHECK to your test to ensure that the 'and' is changed
correctly.
Nuno
More information about the llvm-commits
mailing list