[PATCH] D144541: [X86] Save/restore base pointer register when it is clobbered

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 27 19:31:57 PST 2023


efriedma added a comment.

In D144541#4157339 <https://reviews.llvm.org/D144541#4157339>, @LuoYuanke wrote:

> In D144541#4155710 <https://reviews.llvm.org/D144541#4155710>, @efriedma wrote:
>
>>> That register (other register) may also be clobbered in another inline asm
>>
>> We don't have to use the same register for each inline asm.
>
> The base pointer register is reserved by compiler, we can't reserve too much register?

You wouldn't reserve a register, just add some instructions around the inline asm to save/restore the base pointer.  It's sort of messy, but probably workable.

>>> Don't know what ech cif_escape means
>>
>> llvm-readobj --unwind can decode the DWARF for you.
>>
>> The important thing is that it allocates a variable amount of space between the arguments and the frame pointer, and saves the incoming value of esp on the stack.
>
> It seems this option is the best one. What do you think?

This is the most straightforward/maintainable, probably.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144541/new/

https://reviews.llvm.org/D144541



More information about the llvm-commits mailing list