Optimized Cmm containing useless blocks

Karel Gardas karel.gardas at centrum.cz
Sun Mar 9 21:39:43 UTC 2014


If I may add to this, then I'm curious why there is something like:

  I64[BaseReg + 784] = I64[BaseReg + 784];

presented in Cmm optimized code. Since I don't know Cmm enough I've 
verified if the semantics is really C like by looking into generated asm 
and indeed it looks so. This costs 5 isns of sparc asm btw.

If someone is interested to duplicate this, then use sparc or ppc 32 bit 
registerised target and Haskell code:

module Main where

import Data.Int

main = print ( ( 2 ^ 6 ) :: Int64 )

Karel

On 03/ 8/14 09:21 AM, Johan Tibell 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



More information about the ghc-devs mailing list