[PATCH] D98789: [PEI] add dwarf information for stack probe

Simonas Kazlauskas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 18 05:44:28 PDT 2021


nagisa added a comment.

> Make sense. I tried to use r11 + offset to represent CFA temporarily. However, r11d cannot be used as a dwarf register on x86_32.

What registers can be used? I did a quick search and couldn't find anything.

> Can I use another register (like di) here?

Any register that isn't callee-preserved could be used (or any register in general if its spilled first), assuming it isn't used for something else already. I did a quick search in an effort to figure out which registers are callee-saved on x86, but couldn't find anything definitive :(

This makes me wonder, though: why not leave selection of the register to use here to regalloc?



================
Comment at: llvm/test/CodeGen/X86/stack-clash-large.ll:22
+; CHECK-X86-64-NEXT:	.cfi_def_cfa_register %rdi
+; CHECK-X86-64-NEXT:	.cfi_adjust_cfa_offset 69632
 ; CHECK-X86-64-NEXT:   .LBB0_1:
----------------
I… think this wants to be a `def_cfa_offset`? `def_cfa_register` does not reset the offset so its not at all obvious what this is offsetting from.

Alternatively there's a form that combines both setting the new register and the offset into a single directive:

```
lang=asm
.cfi_def_cfa %rdi, 69632
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98789



More information about the llvm-commits mailing list