Loop optimisation with identical counters

Max Bolingbroke batterseapower at hotmail.com
Mon Nov 8 10:44:47 EST 2010


On 6 November 2010 04:47, David Peixotto <dmp at rice.edu> wrote:
>> Are you sure about R1 aliasing Sp? AFAIK, R1 points to a closure on the heap, not to a stack location. That is, it can alias pointers on the stack or Hp but it can't alias the Sp itself. I don't think Sp can be aliased by anything outside of the garbage collector.
>>
>> Perhaps we shouldn't mark Hp as noalias, though.
>
> Well, I'm not sure about R1 aliasing with Sp. I thought that there could be some cases where closures are allocated on the stack, but I could be wrong. I think the stack should still be reachable by the garbage collector though. Can someone more familiar with GHC internals say whether R1 could point to the stack as well as the heap?

GHC marks some closures as "let-no-escapes" which means that they get
stack allocated. So AFAIK R1 may alias pointers based on SP.

Cheers,
Max


More information about the Glasgow-haskell-users mailing list