StgCase - are LiveVars and SRT fields going to be used?

Ömer Sinan Ağacan omeragacan at gmail.com
Mon Feb 1 22:05:54 UTC 2016


Hi all,

This is how case expression in STG currently defined:


  | StgCase
        (GenStgExpr bndr occ)
        (GenStgLiveVars occ)
        (GenStgLiveVars occ)
        bndr
        SRT
        AltType
        [GenStgAlt bndr occ]


The GenStgLiveVars and SRT fields are never used anywhere in the compiler
(except the printer). So the question is, I'm assuming those were used at some
point, but are they going to be used in the future? Or can I just delete those?

As a proof of concept, I just compiled GHC using this:


  | StgCase
        (GenStgExpr bndr occ)
        bndr
        AltType
        [GenStgAlt bndr occ]


Normally this is not a big deal, but I'm doing lots of STG-to-STG
transformations nowadays, and I have to keep those field updated which is
annoying as those are never going to be used (I can't even know if I'm doing it
right), or leave those `undefined` which is not a good practice.


More information about the ghc-devs mailing list