<div dir="ltr">I plan on writing a patch for this. Based on which branch should I create the pull request? Is the swift-3.1-branch frozen?</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 29, 2017 at 7:27 PM, Michael Gottesman <span dir="ltr">&lt;<a href="mailto:mgottesman@apple.com" target="_blank">mgottesman@apple.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><div><div class="h5"><blockquote type="cite"><div>On Jun 28, 2017, at 10:15 AM, Vasileios Kalintiris via swift-dev &lt;<a href="mailto:swift-dev@swift.org" target="_blank">swift-dev@swift.org</a>&gt; wrote:</div><br class="m_4227734653345823433Apple-interchange-newline"><div><div dir="ltr">&gt; Have you seen `utils/pass-pipeline/scripts/p<wbr>ipelines_build_script.py`, it looks like it might give some hints?<br><div><br></div><div>I&#39;ve tried generating a pass pipeline with utils/pass-pipeline/scripts/pi<wbr>pelines_generator.py and use it with the -external-pass-pipeline-filena<wbr>me. However, AFAICT the generated pipeline is not in the correct format that the compiler expects:</div><div><br></div><div><div>[</div><div>    [</div><div>        &quot;HighLevel&quot;,</div><div>        &quot;run_n_times&quot;,</div><div>        2,</div><div>        &quot;SimplifyCFG&quot;,</div><div>        ...</div><div>        &quot;GlobalARCOpts&quot;</div><div>    ],</div><div>    [</div><div>        &quot;EarlyLoopOpt&quot;,</div><div>        &quot;run_n_times&quot;,</div><div>        1,</div><div>        &quot;LowerAggregateInstrs&quot;,</div><div>        ...</div><div>        &quot;SwiftArrayOpts&quot;<br></div><div>    ],</div></div><div>    ...</div><div>]</div><div><br></div><div>Each generated pass pipeline contains the &quot;run_n_times&quot;|&quot;run_to_fixed_po<wbr>int&quot; field, followed by the number of iterations, which is not what the compiler expects.</div><div><br></div><div>I had no luck even when I tried to re-format the file containing the pipelines to something that I believe the compiler would expect based on the source code of SILPassPipelinePlan::getPassPi<wbr>pelineFromFile():</div><div><br></div><div>[</div><div>    [</div><div>        &quot;HihLevel&quot;,</div><div>        &quot;SimplifyCFG&quot;,</div><div>        ...</div><div>        &quot;GlobalARCOpts&quot;</div><div>    ],</div><div>    ...</div><div>]</div><div><br></div><div>or even:</div><div><br></div><div>[</div><div>    [</div><div>       &quot;HighLevel&quot;,</div><div>       [ &quot;SimplifyCFG&quot; ],</div><div>       ...</div><div>       [ &quot;GlobalARCOpts&quot; ]</div><div>    ],</div><div>    ...</div><div>]</div><div><br></div><div>I suspect that we don&#39;t use the pass pipeline python scripts in our buildbots anymore and the relevant bits, ie. the code in SILPassPipelinePlan::getPassPi<wbr>pelineFromFile and/or the python scripts, have not been kept up-to-date. </div></div></div></blockquote><div><br></div></div></div><div>Yes. I think that is true. Here is what I would suggest:</div><div><br></div><div>1. It would be really trivial to change this to use yamltraits.</div><div>2. If you make this change, make sure that a test is added (maybe to sil-opt) that makes sure that we can roundtrip from the dumper.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>MIchael</div></font></span><span class=""><br><blockquote type="cite"><div><div dir="ltr"><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 28, 2017 at 6:18 PM, Daniel Dunbar <span dir="ltr">&lt;<a href="mailto:daniel_dunbar@apple.com" target="_blank">daniel_dunbar@apple.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Have you seen `utils/pass-pipeline/scripts/p<wbr>ipelines_build_script.py`, it looks like it might give some hints?<br>
--<br>
$ sgit grep external-pass-pipeline-filenam<wbr>e<br>
include/swift/Option/FrontendO<wbr>ptions.td:def external_pass_pipeline_filenam<wbr>e : Separate&lt;[&quot;-&quot;], &quot;external-pass-pipeline-filena<wbr>me&quot;&gt;,<br>
utils/pass-pipeline/scripts/pi<wbr>pelines_build_script.py:        &#39;-external-pass-pipeline-filen<wbr>ame\;-Xfrontend\;%s&#39; % data_file]<br>
--<br>
<br>
 - Daniel<br>
<div><div class="m_4227734653345823433h5"><br>
&gt; On Jun 28, 2017, at 5:27 AM, Vasileios Kalintiris via swift-dev &lt;<a href="mailto:swift-dev@swift.org" target="_blank">swift-dev@swift.org</a>&gt; wrote:<br>
&gt;<br>
&gt; Hi all,<br>
&gt;<br>
&gt; Please, let me know if I should post this to another list.<br>
&gt;<br>
&gt; I&#39;m trying to figure out what is the expected YAML format of the -external-pass-pipeline-filena<wbr>me option.<br>
&gt;<br>
&gt; Dumping the pass pipeline under -O and feeding it back to the compiler with this option doesn&#39;t work (from swift-3.1-branch).<br>
&gt;<br>
&gt; I thought to ask here because I&#39;m not entirely sure that the relevant YAML parsing code from SILPassPipelinePlan::getPassPi<wbr>pelineFromFile() accepts valid YAML input.<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Vasileios<br>
</div></div>&gt; ______________________________<wbr>_________________<br>
&gt; swift-dev mailing list<br>
&gt; <a href="mailto:swift-dev@swift.org" target="_blank">swift-dev@swift.org</a><br>
&gt; <a href="https://lists.swift.org/mailman/listinfo/swift-dev" rel="noreferrer" target="_blank">https://lists.swift.org/mailma<wbr>n/listinfo/swift-dev</a><br>
<br>
</blockquote></div><br></div>
______________________________<wbr>_________________<br>swift-dev mailing list<br><a href="mailto:swift-dev@swift.org" target="_blank">swift-dev@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-dev" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-dev</a><br></div></blockquote></span></div><br></div></blockquote></div><br></div>