[llvm-dev] Question about Traversing Loops in forward or reverse program order on new pass manager

Philip Reames via llvm-dev llvm-dev at lists.llvm.org
Fri Apr 16 13:54:10 PDT 2021


I know of no reason to have a strong preference.  Assuming the change 
wasn't made intentionally - might be good to check with Chandler - I'd 
default to using the same order from the old pass manager.

One argument in favor of the forward order is that if determine a loop 
exit is dead, we might be able to avoid visiting a large portion of the 
function.  Just an observation, not an argument in favor per se.

Philip

On 4/15/21 9:59 AM, Arthur Eubanks via llvm-dev wrote:
> Ping on loop traversal order. Does anybody have any intuition about 
> which way to traverse loops in a function?
>
> On Wed, Apr 7, 2021 at 12:36 PM Jingu Kang via llvm-dev 
> <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote:
>
>     Hi All,
>
>     I have seen performance regressions from new pass manager against
>     legacy pass manager. One of the issues is the order of populating
>     loops on pass manager. The legacy pass manager is traversing loops
>     in reverse program order but the new pass manager is traversing in
>     forward program order. It sometimes causes different output. I
>     have created a review https://reviews.llvm.org/D99774
>     <https://reviews.llvm.org/D99774> for reverse program order on new
>     pass manager and had short discussion with Arthur on it. It is not
>     easy to say the reverse order is better than the forward one or
>     vice versa. I would like to share this issue with more people on
>     llvm-dev. If you have idea or experience about this issue, please
>     share it.
>
>     Thanks
>
>     JinGu Kang
>
>     _______________________________________________
>     LLVM Developers mailing list
>     llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>
>     https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>     <https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev>
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210416/3006eadf/attachment.html>


More information about the llvm-dev mailing list