Re: What does "return" keyword mean in INFO_TABLE_RET declarations?

2018-03-18 Thread Rahul Muttineni
Hi Omer, An INFO_TABLE_RET is a frame that "can be returned to" and the return keyword allows you to provide a name for the value(s) that was(were) returned to this frame and do something with it if you wish. If you didn't have this keyword, you would have to do low-level stack manipulations

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

What does "return" keyword mean in INFO_TABLE_RET declarations?

2018-03-18 Thread Ömer Sinan Ağacan
Hi, I'm trying to understand what a "return" list in INFO_TABLE_RET declaration line specifies. As far as I understand a "return" in the declaration line is something different than a "return" in the body. For example, in this definition: (in HeapStackCheck.cmm) INFO_TABLE_RET ( stg_ret_p,

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.