I’m using LLVM’s stack map intrinsic to store value location information. I’ve got a pass that automatically inserts the “llvm.experimental.stackmap” intrinsic into the IR. On x86-64, an “.llvm_stackmaps” section is successfully emitted (I can see the section & its contents in the generated assembly). However I can’t get the AArch64 backend to generate this section. On the website with information about the intrinsic , it says that AArch64 is supported. Is there a flag I need to add, or is there something I need to enable when building LLVM to get this support?
I figured out the issue – the AArch64 backend only emits the stack map section if isOSBinFormateMachO() returns true – see , lines 123 - 134. Moving the call to serializeToStackMapSection() outside of the conditional fixes the problem.
I don't know enough about AArch64 to assess here. Is the proposed change below something we should take in tree? I'm happy to do the mechanics of posting a patch (if Rob doesn't), but I don't know enough to assess. Would such a patch be self contained? Or is there other work needed?
I don’t recall anything MachO specific in the AArch64 stack maps code. Digging through the svn history it looks like the call to SM.serializeToStackMapSection() used to be unconditional but was put under the isOSBinFormateMachO() test in r206610. Tim - was there a reason for that? If not, I think it should be safe to just move it back out.
Mostly likely, nobody got around to writing ELF tests. The change to enable stack maps on ELF would be fine if it includes a test case.
This matches my recollection. Things were conditionalized on what we had use cases for from which we could derive meaningful test cases.
Are you planning on sending a patch for this? If not, I’ll get to it eventually.
I can create the patch. I’ve never done this before, so I’m just going to follow ? Do I also need to create a test for ELF binaries to ensure that the section gets generated correctly?