<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1" class="" style="word-wrap:break-word">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi Mehdi,<br>
<br>
Thanks for your reply. <br>
However, when I remove dependency from C to A, the problem is still here. <br>
<br>
Best,<br>
Yuxi<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF566336"><font color="#000000" face="Tahoma" size="2"><b>From:</b> mehdi.amini@apple.com [mehdi.amini@apple.com]<br>
<b>Sent:</b> Sunday, June 19, 2016 4:28 AM<br>
<b>To:</b> Yuxi Chen<br>
<b>Cc:</b> llvmdev@cs.uiuc.edu; llvm-dev@lists.llvm.org; llvmdev-bounces@cs.uiuc.edu<br>
<b>Subject:</b> Re: [llvm-dev] pass invalidation<br>
</font><br>
</div>
<div></div>
<div><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Jun 18, 2016, at 10:44 PM, Yuxi Chen via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="" style="font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; direction:ltr; font-family:Tahoma; font-size:10pt">
Hi All, 
<div class=""><br class="">
</div>
<div class="">When I use llvm, I encounter a problem like "unable to schedule pass A required by C"</div>
<div class="">I investigated deeper. It's like:</div>
<div class="">I have three passes, say A, B, C(all are on function level)</div>
<div class="">A would modify IR code. (change instruction order)</div>
<div class=""><br class="">
</div>
<div class="">For pass B, </div>
<div class="">I would use the result of pass A, I use addRequired<B>(), and &getAnalysis<B>(), it works. </div>
<div class=""><br class="">
</div>
<div class="">void getAnalysisUsage(AU){</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>AU.addRequired<A>();</div>
<div class="">}</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">For pass C, it will use the results of pass A and B. </div>
<div class="">I use the way as used for pass B, but it failed, even for LoopInfo analysis pass(which is the built-in analysis pass).</div>
<div class="">void getAnalysisUsage(AU){</div>
<div class=""><span class="" style="font-size:10pt"><span class="Apple-tab-span" style="white-space:pre"></span>AU.addRequired<A>();</span></div>
<div class=""><span class="" style="font-size:10pt"><span class="Apple-tab-span" style="white-space:pre"></span>AU.addRequired<B>();</span></div>
<div class=""><span class="" style="font-size:10pt">}</span></div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">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. </div>
<div class="">However, when I change the using order, I still got error "unable to schedule pass A required by C".</div>
<div class=""><br class="">
</div>
<div class="">Does anyone encounter the same problem before and have a solution?</div>
</div>
</div>
</blockquote>
<blockquote type="cite" class="">
<div class="">
<div class="" style="font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; direction:ltr; font-family:Tahoma; font-size:10pt">
<div class="">Any help is appreciated. </div>
</div>
</div>
</blockquote>
<div><br class="">
</div>
<div>Depending on other transformations isn’t recommended, and isn’t supported by the soon-new-passmanager I believe.</div>
<div>The expectation is that the passes are added in order to the pass manager by the client.</div>
<div><br class="">
</div>
<div>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.</div>
<div><br class="">
</div>
<div>— </div>
<div>Mehdi</div>
<div><br class="">
</div>
<div><br class="">
</div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div class="" style="font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; direction:ltr; font-family:Tahoma; font-size:10pt">
<div class=""><br class="">
</div>
<div class="">Best,</div>
<div class="">Yuxi</div>
</div>
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; float:none; display:inline!important">_______________________________________________</span><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; float:none; display:inline!important">LLVM
 Developers mailing list</span><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">
<a href="mailto:llvm-dev@lists.llvm.org" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px" target="_blank">llvm-dev@lists.llvm.org</a><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a></div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</body>
</html>