[PATCH] D145205: [codegen][riscv] Emit CFI directives when using shadow call stack
Roland McGrath via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 8 18:21:56 PST 2023
mcgrathr added inline comments.
================
Comment at: llvm/lib/Target/RISCV/RISCVFrameLowering.cpp:87
+ 18, // register
+ 2, // length
+ static_cast<char>(unsigned(dwarf::DW_OP_breg18)),
----------------
jrtc27 wrote:
> Similarly don't hard-code (up to you whether you unconditionally use bregx or branch on whether reg num is < 32)
Definitely don't use bregx. That takes another byte and CFI size is precious. Just use `DW_OP_breg0 + n` after an assertion that n < 32 because it actually is (it's 18 and will only ever be 18).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D145205/new/
https://reviews.llvm.org/D145205
More information about the llvm-commits
mailing list