LclId -> GblId question

Gabor Greif ggreif at gmail.com
Wed May 30 08:08:10 UTC 2018


Never mind, I figured it out. It is the CoreTidy pass of the
compilation pipeline:
https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/HscMain

Cheers,

    Gabor

On 5/29/18, Gabor Greif <ggreif at gmail.com> wrote:
> Hi devs,
>
> I have a simple question, but could not find an answer yet. The same
> variable (I checked!) appears in two dumps with different names and
> different external visibilities.
> Which pass transforms this variable to a global id, and why? Shouldn't
> a LclId remain local along the entire optimisation chain?
>
> Any hint appreciated!
>
> Cheers and thanks,
>
>      Gabor
>
> Snippets from dumps below
>
> ##############################################################
>
> -rw-r--r-- 1 ggreif sw12  3281225 May 29 14:14 TcSMonad.dump-stranal
>
>
> -- RHS size: {terms: 2, types: 1, coercions: 0, joins: 0/0}
> lvl_sOra :: TcTyVarDetails
> [LclId,
>  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
>          WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
> lvl_sOra
>   = ghc-prim-0.5.3:GHC.Magic.noinline
>       @ TcTyVarDetails vanillaSkolemTv
>
> ##############################################################
>
> -rw-r--r-- 1 ggreif sw12  1438015 May 29 14:14 TcSMonad.dump-simpl
>
>
> -- RHS size: {terms: 2, types: 1, coercions: 0, joins: 0/0}
> TcSMonad.isFilledMetaTyVar_maybe2 :: TcTyVarDetails
> [GblId,
>  Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False,
>          WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
> TcSMonad.isFilledMetaTyVar_maybe2
>   = ghc-prim-0.5.3:GHC.Magic.noinline
>       @ TcTyVarDetails vanillaSkolemTv
>
> ##############################################################
>


More information about the ghc-devs mailing list