On Mon, May 20, 2019 at 11:48 AM Feng Xue OS <f...@os.amperecomputing.com> wrote: > > >> Now finiteness assertion is only used in a very late CD-DCE, which is > >> located after all loop optimizations are done. And we can even place it as > >> late as just before RTL-expansion. This might be safe enough to let hidden > >> infinite loops exposed. > > > > Is that so? The early pipeline contains a CD-DCE pass as well. Note we > > also > > have pure/const discovery affected by this. > > I specialized a CD-DCE pass, named CD-DCE2, and only in this pass, loop > removal based on assumed finteness is performed. Please check the patch.
Oh, but why not generally do this? > >> Now we still need to define "non-trivial exit condition" and a way to > actually test for that. > > Still not very clear on "non-trival exit condition". I think if a loop > contains non-EH exit, it is terminable. Possibly, but that's not terminology for user-facing documentation ;) I'd even say if a loop contains an exit it is terminable (remove the non-EH qualification). Richard. > Feng > >