[llvm-dev] LLVM libunwind stack usage

David Chisnall via llvm-dev llvm-dev at lists.llvm.org
Wed Jan 20 01:16:32 PST 2016


On 19 Jan 2016, at 22:09, Ed Maste via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> Is it reasonable to change LLVM libunwind to use an approach similar
> to GCC's unwinder, and have a target-specific maximum DWARF register
> number? X86 does have DWARF register numbers above the 18 that GCC
> accommodates, but they're not going to be useful in the unwinder
> anyhow.

I am not 100% sure, but I was under the impression that the unwinder would restore any registers that had DWARF instructions related to them and does not necessarily assume that the default calling convention applies.  If I implement a language that uses its own calling convention where all registers are callee save (including vector / FPU ones), for example, then the unwinder should be able to restore my stack frame correctly, similarly if I use a calling convention like this for side exits from JIT’d code, to avoid bloating the JIT’d code with register saves.  This kind of use would be blocked by the GCC approach, which sounds as if it is baking C ABI details into a language-agnostic unwinder.

David



More information about the llvm-dev mailing list