Optimized Cmm containing useless blocks

Alexander Kjeldaas alexander.kjeldaas at gmail.com
Sat Mar 8 18:26:04 UTC 2014


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 Mar 8, 2014 9:24 AM, "Johan Tibell" <johan.tibell at gmail.com> wrote:

> 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 at gmail.com>wrote:
>
>> While looking at some generated Cmm I saw things like this
>>
>> c1Cm:
>>     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 at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-devs
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20140308/307f8f5c/attachment.html>


More information about the ghc-devs mailing list