[llvm] 3794cc0 - [InstCombine] invert canonicalization for cast of signbit test

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Tue May 17 06:01:36 PDT 2022


Thanks!

That reduces even further (I'll add this as a regression test soon):
define i8 @widget(i64 %x) {
  %a1 = and i64 %x, 128
  %t4 = icmp eq i64 %a1, 0
  %t6 = zext i1 %t4 to i8
  ret i8 %t6
}

So we would need to invert more of the related folds to make sure we're not
creating conflicting transforms...

I'll split this patch up. We can solve the motivating bug simply by
removing a transform without adding another. Then, I'll see if I can undo
others that would conflict.


On Tue, May 17, 2022 at 4:20 AM Florian Hahn <florian_hahn at apple.com> wrote:

>
>
> On May 16, 2022, at 22:54, Sanjay Patel via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
> Thanks for letting me know. Reverted:
> https://reviews.llvm.org/rG07d549bce94f
>
> If you can get the IR for that file, that would be great. Otherwise, I'll
> try to set up a system to extract that.
>
>
>
> Sure, the IR below should hang with this patch and `opt
> -passes=instcombine`
>
> define i8 @widget(i64 %arg) {
> bb:
>   %tmp = lshr i64 %arg, 7
>   %tmp1 = and i64 %tmp, 1
>   %tmp2 = trunc i64 %tmp1 to i32
>   %tmp3 = icmp ne i32 %tmp2, 0
>   %tmp4 = xor i1 %tmp3, true
>   %tmp5 = zext i1 %tmp4 to i8
>   ret i8 %tmp5
> }
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220517/b5ae0d95/attachment.html>


More information about the llvm-commits mailing list