[RFC] New StackMap format proposal (StackMap v2)

As an example, if we need to add the SymbolConstants section mentioned down thread, that shouldn't require an version change.

Once we release a LLVM version any change should require a version change.

Since you’ve designed an extensible format, you probably want a major and minor version now to distinguish compatibility breaking changes. You can explicitly leave the size of the header unspecified so that 2.1 can add a “stackmap section".

Header v2 {
  uint8 : Stack Map Version (2)
  uint8 : Reserved [3] (0)
  uint32 : Constants Offset (bytes)
  uint32 : Frame Records Offset (bytes)
  uint32 : Frame Registers Offset (bytes)
  uint32 : StackMap Records Offset (bytes)
  uint32 : Locations Offset (bytes)
  uint32 : LiveOuts Offset (bytes)

            <unspecified for future>



I would be perfectly okay with this proposal. I just want there to be a documented point at which we can remove complexity. Would you mind posting a patch for the StackMaps docs which mentions the existence of the parser and explicitly states this policy? Having it documented will cut down on future confusion. That’s perfectly workable. Can you make sure that gets into the docs? Unless existing systems will continue to work without needing the new optional information, yes. Thinking about it, my particular example doesn’t actually meet this requirement. :slight_smile: But adding a purely informational section without a version change would be fine. So a name like hasFramePointerRegister might be more clear? Given that different registers can be used as frame pointers (i.e. not just RBP), maybe this should be a Dwarf register number instead? Makes sense, but isn’t this still per call site information, not per function? The format seems to imply per-function. Ok.