[LLVMdev] Code for late safepoint placement available

David Chisnall David.Chisnall at cl.cam.ac.uk
Sat Jun 14 04:44:24 PDT 2014


On 13 Jun 2014, at 11:23, Philip Reames <listmail at philipreames.com> wrote:

>> Does it need to be a list, or could it be a range? It the set of GC address spaces was contiguous over some range of integers, then you'd only need to store a min / max value, which might make the implementation simpler. 
> A range is also fine. David, does that meet your use case as well?

The way that we've implemented the is-a-fat-pointer check is in DataLayout, querying an address space and I was expecting the is-a-GC'd-AS check to be done in the same way.  I don't see what you'd gain by forcing them to be a contiguous range.  If a particular target wants to make them a range, then that's fine.  You can also perhaps make a public field on the DataLayout to allow a cheap does-this-target-have-support-for-any-GC'd-address-spaces query to be a single field access, avoiding the virtual call for the no-GC case.

If you want to speed up the check, then a better idea would be to reserve a few bits of the AS ID for properties.  We support, I think, 24-bit address space IDs, so losing one bit to identify GC'd address spaces, maybe losing another to identify fat pointers, and another to identify ROM (or other immutable storage) would still give a few orders of magnitude more than anyone is currently using.  

David





More information about the llvm-dev mailing list