[PATCH] D20847: BitCast infinite loop fix

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Tue May 31 20:36:45 PDT 2016


So why does it loop more than once?
Does it not fixpoint at the second form?
If not that seems like the issue.


On Tue, May 31, 2016 at 8:34 PM, Evgeny Stupachenko via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> evstupac added a comment.
>
> > Also, I find removing things from the worklist incredibly, deeply
> suspicious. Otherwise the rest of InstCombine must be careful not to add
> the item to the list, no?
>
>
> Here InstCombine creates exactly the thing it is searching for: new
> BitCast (lines 1876, 1898) and new PHI (line 1861).
>
> > Could you please explain how this ends up looping? Are we recreating the
> same input over again?
>
>
> I'll try to narrow my case and add a test case.
> Basically what can occur is:
>
>   xB = load (type B);
>   xA = load (type A);
>   yB = (B)xA;           // A -> B
>   zB = PHI[xB, yB];     // PHI
>   zA = (A)zB;           // B -> A
>   store zA;
>   store zB;
>
> The transformation will create (new instruction marked with +):
>
>   xB = load (type B);
>   xA = load (type A);
>   +yA = (A)xB;             // B -> A
>   +zAn = PHI[yA, xA];      // PHI
>   +zBn = (B)zAn;           // A -> B
>   store zAn;
>   store zBn;
>
>
> Repository:
>   rL LLVM
>
> http://reviews.llvm.org/D20847
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160531/0ebafdf2/attachment.html>


More information about the llvm-commits mailing list