<p dir="ltr">Seems like something that should be delegated to a peep hole optimizer. What you describe make it possible to reorder the basic blocks at a later stage.</p>
<p dir="ltr">Alexander</p>
<div class="gmail_quote">On Mar 8, 2014 9:24 AM, "Johan Tibell" <<a href="mailto:johan.tibell@gmail.com">johan.tibell@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">On a related note, doesn't Cmm support fall-through branches? Heap checks use two branches instead of one branch and one fall-through case:<div><br></div><div><div>      c1Cq:</div><div>          Hp = Hp + 152;</div>


<div>          if (Hp > I64[BaseReg + 856]) goto c1Cs; else goto c1Cr;</div><div>      c1Cs:</div><div>          I64[BaseReg + 904] = 152;</div><div>          goto c1Cp;</div><div>      c1Cp:</div><div>          R1 = PicBaseReg + a_r1za_closure;</div>


<div>          call (I64[BaseReg - 8])(R1) args: 8, res: 0, upd: 8;</div><div>      c1Cr:</div></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Mar 8, 2014 at 9:21 AM, Johan Tibell <span dir="ltr"><<a href="mailto:johan.tibell@gmail.com" target="_blank">johan.tibell@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">While looking at some generated Cmm I saw things like this<div><br></div><div><div>c1Cm:</div><div>    goto c1Cq;</div>


<div>c1Cq:</div></div><div><br></div><div>i.e. useless basic blocks that haven't been optimized away. Is this to be expected?</div><span><font color="#888888">
<div><br></div><div>-- Johan</div><div><br></div></font></span></div>
</blockquote></div><br></div>
<br>_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/ghc-devs" target="_blank">http://www.haskell.org/mailman/listinfo/ghc-devs</a><br>
<br></blockquote></div>