[llvm-dev] How to solve circular dependency between passes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] How to solve circular dependency between passes

Chris Lattner via llvm-dev

Hi,

 

I am working on a case for loop interchange, and discovered that to enable loop interchange in my case, I have to run it before LICM and after Induction Variable Simplify. So the  good order for me is: Induction Variable Simplify -> Loop Interchange -> LICM. However, I also found cases where Induction Variable Simplify works better after LICM, and running Induction Variable Simplify after LICM again still results in suboptimal result.

 

Has anyone encountered similar dependency problem when reordering passes? If so, can you kindly share your solution or suggestion?

 

Thanks,

Jimmy


_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] How to solve circular dependency between passes

Chris Lattner via llvm-dev
This sounds like a typical 'phase ordering' problem and unfortunately
there is no solution to it without improving the passes themselves.
For your case IndVarSimplify and LICM are considered canonicalization
passes. Any pass should be designed to work best on canonicalized IR.
In practice, however, this is not true [1]. In particular,
LoopInterchange is sensitive to dependencies created by LICM hoisting
code out of the inner loop. I don't think it is solvable in a
satisfying with the current pass infrastructure.

[1] http://llvm.org/devmtg/2018-10/talk-abstracts.html#talk11

Michael


Am Di., 7. Jan. 2020 um 16:34 Uhr schrieb Jimmy Zhongduo Lin via
llvm-dev <[hidden email]>:

>
> Hi,
>
>
>
> I am working on a case for loop interchange, and discovered that to enable loop interchange in my case, I have to run it before LICM and after Induction Variable Simplify. So the  good order for me is: Induction Variable Simplify -> Loop Interchange -> LICM. However, I also found cases where Induction Variable Simplify works better after LICM, and running Induction Variable Simplify after LICM again still results in suboptimal result.
>
>
>
> Has anyone encountered similar dependency problem when reordering passes? If so, can you kindly share your solution or suggestion?
>
>
>
> Thanks,
>
> Jimmy
>
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev