<p dir="ltr">Out of curiosity, why does Webassembly require structured control flow? To make it easier to lower to js? Is that something you want to change in the future? </p>
<div class="gmail_quote">On Jul 6, 2015 5:44 PM, "JF Bastien" <<a href="mailto:jfb@google.com">jfb@google.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: jfb<br>
Date: Mon Jul 6 16:41:59 2015<br>
New Revision: 241513<br>
<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D241513-26view-3Drev&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=ezp-qSGA13mIMR6FaEhkS5oDXwUJ3Uq-_Q-n124MzuE&s=f6jfzhwsn-oasBM__aqopg1E5RRh-qt2m2j_lALsFgk&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=241513&view=rev</a><br>
Log:<br>
WebAssembly: add some TODO<br>
<br>
Reviewers: sunfish<br>
<br>
Subscribers: llvm-commits, jfb<br>
<br>
Differential Revision: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D10971&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=ezp-qSGA13mIMR6FaEhkS5oDXwUJ3Uq-_Q-n124MzuE&s=mXH_a_xhzZWMmukKzb7jKb09H1C1cx5jqARnC0ciHyI&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/D10971</a><br>
<br>
Modified:<br>
llvm/trunk/lib/Target/WebAssembly/README.txt<br>
<br>
Modified: llvm/trunk/lib/Target/WebAssembly/README.txt<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_lib_Target_WebAssembly_README.txt-3Frev-3D241513-26r1-3D241512-26r2-3D241513-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=ezp-qSGA13mIMR6FaEhkS5oDXwUJ3Uq-_Q-n124MzuE&s=0NdmqQfAoaD_a4YNs8nwsFKNZgQYHfmuzPaJAxp2cTU&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/README.txt?rev=241513&r1=241512&r2=241513&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/WebAssembly/README.txt (original)<br>
+++ llvm/trunk/lib/Target/WebAssembly/README.txt Mon Jul 6 16:41:59 2015<br>
@@ -12,4 +12,15 @@ binary encoding of WebAssembly itself:<br>
* <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_WebAssembly_design_blob_master_AstSemantics.md&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=ezp-qSGA13mIMR6FaEhkS5oDXwUJ3Uq-_Q-n124MzuE&s=YKiEWDIh0RIcJoeE7r1796QBVnxHiRbn18T0akioYtk&e=" rel="noreferrer" target="_blank">https://github.com/WebAssembly/design/blob/master/AstSemantics.md</a><br>
* <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_WebAssembly_design_blob_master_BinaryEncoding.md&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=ezp-qSGA13mIMR6FaEhkS5oDXwUJ3Uq-_Q-n124MzuE&s=gnur_2vXXpuI0bPHm-LoLiGhCphQuw2fkSIO5oL9coM&e=" rel="noreferrer" target="_blank">https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md</a><br>
<br>
+Interesting work that remains to be done:<br>
+* Write a pass to restructurize irreducible control flow. This needs to be done<br>
+ before register allocation to be efficient, because it may duplicate basic<br>
+ blocks and WebAssembly performs register allocation at a whole-function<br>
+ level. Note that LLVM's GPU code has such a pass, but it linearizes control<br>
+ flow (e.g. both sides of branches execute and are masked) which is undesirable<br>
+ for WebAssembly.<br>
+* Basic relooper to expose control flow as an AST.<br>
+* Figure out how to properly use MC for virtual ISAs. This may require some<br>
+ refactoring of MC.<br>
+<br>
//===---------------------------------------------------------------------===//<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>