RE: Is "cml_cont" of CmmCall used in practice?

2018-03-19 Thread Simon Peyton Jones via ghc-devs
Adding Kavon. It would be good to record the outcome of this discussion in a 'Note' with the cml_cont declaration, explaining what it is for. Simon | -Original Message- | From: ghc-devs On Behalf Of Ömer Sinan | Agacan | Sent: 18 March 2018 07:32 |

Re: Is "cml_cont" of CmmCall used in practice?

2018-03-18 Thread Kavon Farvardin
> Is the "cml_cont" field of the CmmCall variant is really used in practice? Seconding what Michal has already said, yes, the `cml_cont` field is used quite a bit in Cmm. Any non-tail call in the program will have this field populated with information about where control-flow continues after

Re: Is "cml_cont" of CmmCall used in practice?

2018-03-18 Thread Michal Terepeta
On Sun, Mar 18, 2018 at 6:38 AM Shao, Cheng wrote: > Hi all, > > Is the "cml_cont" field of the CmmCall variant is really used in practice? > I traversed the output of raw Cmm produced by ghc compiling the whole base > package, but the value of cml_cont is always Nothing. >

Re: Is "cml_cont" of CmmCall used in practice?

2018-03-18 Thread Cheng Shao
Hi Ömer, See e.g. `lowerSafeForeignCall` and `blockCode` > which set the field with `Just`. The former seems to be related with > foreign > calls so perhaps try compiling a FFI package. I tried compiling a module with a `foreign import ccall safe` declaration, yet the output raw Cmm still

Re: Is "cml_cont" of CmmCall used in practice?

2018-03-18 Thread Ömer Sinan Ağacan
Hi Shao, Perhaps not in the Cmm output generated for your programs, but it's definitely used in the code generator. See e.g. `lowerSafeForeignCall` and `blockCode` which set the field with `Just`. The former seems to be related with foreign calls so perhaps try compiling a FFI package.