[PATCH] D48066: Add one more No-alias case to alias analysis.

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 12 07:12:17 PDT 2018


hfinkel added a comment.

In https://reviews.llvm.org/D48066#1129585, @jaykang10 wrote:

>   knownZeros(n) == (knownZeros(idx) << 1) | 1 and
>   knownOnes(n) == knownOnes(idx) << 1
>
>
> I meant if nothing is known about idx, we fail to get No-alias opportunity. If there is nothing for KnownBits, let's just check odd number and the idx is used by both offsets as below.
>
>   if (success of computeKnownBits with `n` and `idx`) {
>     knownZeros(n) == (knownZeros(idx) << 1) | 1 and
>     knownOnes(n) == knownOnes(idx) << 1
>   } else {
>     check just LHS is odd number and RHS is shared by offsets.
>   }
>
>
> How do you think about it? @hfinkel


I don't understand what you're saying. Once you shift, you know that the lowest-order bit is zero. You can naturally combine that with whatever other information also happens to be known about idx.


https://reviews.llvm.org/D48066





More information about the llvm-commits mailing list