<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 28, 2017, at 10:15 AM, Vasileios Kalintiris via swift-dev &lt;<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">&gt; Have you seen `utils/pass-pipeline/scripts/p<wbr class="">ipelines_build_script.py`, it looks like it might give some hints?<br class=""><div class=""><br class=""></div><div class="">I've tried generating a pass pipeline with utils/pass-pipeline/scripts/pi<wbr class="">pelines_generator.py and use it with the -external-pass-pipeline-<wbr class="">filename. However, AFAICT the generated pipeline is not in the correct format that the compiler expects:</div><div class=""><br class=""></div><div class=""><div class="">[</div><div class="">&nbsp; &nbsp; [</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; "HighLevel",</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; "run_n_times",</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; 2,</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; "SimplifyCFG",</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; ...</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; "GlobalARCOpts"</div><div class="">&nbsp; &nbsp; ],</div><div class="">&nbsp; &nbsp; [</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; "EarlyLoopOpt",</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; "run_n_times",</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; 1,</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; "LowerAggregateInstrs",</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; ...</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; "SwiftArrayOpts"<br class=""></div><div class="">&nbsp; &nbsp; ],</div></div><div class="">&nbsp; &nbsp; ...</div><div class="">]</div><div class=""><br class=""></div><div class="">Each generated pass pipeline contains the "run_n_times"|"run_to_fixed_<wbr class="">point" field, followed by the number of iterations, which is not what the compiler expects.</div><div class=""><br class=""></div><div class="">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::<wbr class="">getPassPipelineFromFile():</div><div class=""><br class=""></div><div class="">[</div><div class="">&nbsp; &nbsp; [</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; "HihLevel",</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; "SimplifyCFG",</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; ...</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; "GlobalARCOpts"</div><div class="">&nbsp; &nbsp; ],</div><div class="">&nbsp; &nbsp; ...</div><div class="">]</div><div class=""><br class=""></div><div class="">or even:</div><div class=""><br class=""></div><div class="">[</div><div class="">&nbsp; &nbsp; [</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp;"HighLevel",</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp;[ "SimplifyCFG" ],</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp;...</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp;[ "GlobalARCOpts" ]</div><div class="">&nbsp; &nbsp; ],</div><div class="">&nbsp; &nbsp; ...</div><div class="">]</div><div class=""><br class=""></div><div class="">I suspect that we don't use the pass pipeline python scripts in our buildbots anymore and the relevant bits, ie. the code in SILPassPipelinePlan::<wbr class="">getPassPipelineFromFile and/or the python scripts, have not been kept up-to-date.&nbsp;</div></div></div></blockquote><div><br class=""></div><div>Yes. I think that is true. Here is what I would suggest:</div><div><br class=""></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><div><br class=""></div><div>MIchael</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Jun 28, 2017 at 6:18 PM, Daniel Dunbar <span dir="ltr" class="">&lt;<a href="mailto:daniel_dunbar@apple.com" target="_blank" class="">daniel_dunbar@apple.com</a>&gt;</span> wrote:<br class=""><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/<wbr class="">pipelines_build_script.py`, it looks like it might give some hints?<br class="">
--<br class="">
$ sgit grep external-pass-pipeline-<wbr class="">filename<br class="">
include/swift/Option/<wbr class="">FrontendOptions.td:def external_pass_pipeline_<wbr class="">filename : Separate&lt;["-"], "external-pass-pipeline-<wbr class="">filename"&gt;,<br class="">
utils/pass-pipeline/scripts/<wbr class="">pipelines_build_script.py:&nbsp; &nbsp; &nbsp; &nbsp; '-external-pass-pipeline-<wbr class="">filename\;-Xfrontend\;%s' % data_file]<br class="">
--<br class="">
<br class="">
&nbsp;- Daniel<br class="">
<div class=""><div class="h5"><br class="">
&gt; On Jun 28, 2017, at 5:27 AM, Vasileios Kalintiris via swift-dev &lt;<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>&gt; wrote:<br class="">
&gt;<br class="">
&gt; Hi all,<br class="">
&gt;<br class="">
&gt; Please, let me know if I should post this to another list.<br class="">
&gt;<br class="">
&gt; I'm trying to figure out what is the expected YAML format of the -external-pass-pipeline-<wbr class="">filename option.<br class="">
&gt;<br class="">
&gt; Dumping the pass pipeline under -O and feeding it back to the compiler with this option doesn't work (from swift-3.1-branch).<br class="">
&gt;<br class="">
&gt; I thought to ask here because I'm not entirely sure that the relevant YAML parsing code from SILPassPipelinePlan::<wbr class="">getPassPipelineFromFile() accepts valid YAML input.<br class="">
&gt;<br class="">
&gt; Thanks,<br class="">
&gt; Vasileios<br class="">
</div></div>&gt; ______________________________<wbr class="">_________________<br class="">
&gt; swift-dev mailing list<br class="">
&gt; <a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a><br class="">
&gt; <a href="https://lists.swift.org/mailman/listinfo/swift-dev" rel="noreferrer" target="_blank" class="">https://lists.swift.org/<wbr class="">mailman/listinfo/swift-dev</a><br class="">
<br class="">
</blockquote></div><br class=""></div>
_______________________________________________<br class="">swift-dev mailing list<br class=""><a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-dev<br class=""></div></blockquote></div><br class=""></body></html>