[llvm-dev] pass invalidation

Mehdi Amini via llvm-dev llvm-dev at lists.llvm.org
Sun Jun 19 02:28:51 PDT 2016


> On Jun 18, 2016, at 10:44 PM, Yuxi Chen via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> Hi All, 
> 
> When I use llvm, I encounter a problem like "unable to schedule pass A required by C"
> I investigated deeper. It's like:
> I have three passes, say A, B, C(all are on function level)
> A would modify IR code. (change instruction order)
> 
> For pass B, 
> I would use the result of pass A, I use addRequired<B>(), and &getAnalysis<B>(), it works. 
> 
> void getAnalysisUsage(AU){
> AU.addRequired<A>();
> }
> 
> 
> For pass C, it will use the results of pass A and B. 
> I use the way as used for pass B, but it failed, even for LoopInfo analysis pass(which is the built-in analysis pass).
> void getAnalysisUsage(AU){
> AU.addRequired<A>();
> AU.addRequired<B>();
> }
> 
> 
> It seems because A would modify IR code, so for pass C, I need first load pass A then pass B, otherwise it will be invalidated. 
> However, when I change the using order, I still got error "unable to schedule pass A required by C".
> 
> Does anyone encounter the same problem before and have a solution?
> Any help is appreciated. 

Depending on other transformations isn’t recommended, and isn’t supported by the soon-new-passmanager I believe.
The expectation is that the passes are added in order to the pass manager by the client.

In you case, I expect that it would “work” by removing the dependency from C to A. If C requires B and B requires A, by scheduling C you’ll get A, B, C in sequence.

— 
Mehdi



> 
> Best,
> Yuxi
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev <http://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/20160619/ca392317/attachment-0001.html>


More information about the llvm-dev mailing list