[PATCH] D48338: [SCEV] Improve zext(A /u B) and zext(A % B)

Tim Shen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 20 09:47:19 PDT 2018


timshen added a comment.

In https://reviews.llvm.org/D48338#1137326, @alexandre.isoard wrote:

> Ah, you are right, I misinterpreted the purpose.
>
> On that note, why do we want to sink the `zext`? Wouldn't it be detrimental as it will generate operators of bigger complexity once we code-generate the SCEV.
>  Shouldn't we lift them instead?
>
> That is:
>
>   %x = zext i32 %a to i64
>   %y = zext i32 %b to i64
>   %div = udiv i64 %x, %y
>   
>
> Expressed as: `zext i32 (%a /u %b) to i64`


What about `zext(%a + %b) + %c`? I think `zext(%a) + zext(%b) + %c` is in a much better state than, idk, `zext(%a + %b + trunc(%c))`.


https://reviews.llvm.org/D48338





More information about the llvm-commits mailing list