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.
Alexander
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:c1Cq:Hp = Hp + 152;if (Hp > I64[BaseReg + 856]) goto c1Cs; else goto c1Cr;c1Cs:I64[BaseReg + 904] = 152;goto c1Cp;c1Cp:R1 = PicBaseReg + a_r1za_closure;call (I64[BaseReg - 8])(R1) args: 8, res: 0, upd: 8;c1Cr:On Sat, Mar 8, 2014 at 9:21 AM, Johan Tibell <johan.tibell@gmail.com> wrote:
While looking at some generated Cmm I saw things like thisc1Cm:goto c1Cq;c1Cq:i.e. useless basic blocks that haven't been optimized away. Is this to be expected?-- Johan
_______________________________________________
ghc-devs mailing list
ghc-devs@haskell.org
http://www.haskell.org/mailman/listinfo/ghc-devs