[PATCH] D20847: BitCast infinite loop fix

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 3 13:12:39 PDT 2016


majnemer added a comment.

In http://reviews.llvm.org/D20847#448754, @evstupac wrote:

> >   it has to have a fixpoint where it says "yeah, this is the right
>
> > 
>
> > form" or else you are always prone to infinite loops with phi cycles.
>
>
> We can cycle only if InstCombine here adds instructions it is looking for. Otherwise patterns from Worklist will end at some point.


This can, of course, happen.

> Unless some other InstCombine optimization adds the same pattern. However, this is generally unpredictable. To avoid such cases we can end InstCombine at some point, say if for some time Worklist only grows or stay unchanged. But that is for another patch.


InstCombine is supposed to run to fix-point, it is considered a feature because it's goal is to canonicalize the IR.

I'm starting to wonder if the original transform is phrased incorrectly.


Repository:
  rL LLVM

http://reviews.llvm.org/D20847





More information about the llvm-commits mailing list