[PATCH] D143463: [X86] Use the CFA when appropriate for better variable locations around calls.

Kyle Huey via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 11 21:17:10 PDT 2023


khuey added inline comments.


================
Comment at: llvm/lib/Target/X86/X86FrameLowering.cpp:3651-3652
+  Register FrameRegister = RI->getFrameRegister(MF);
+  if (getInitialCFARegister(MF) == FrameRegister &&
+      MF.getInfo<X86MachineFunctionInfo>()->hasCFIAdjustCfa()) {
+    DwarfFrameBase FrameBase;
----------------
scott.linder wrote:
> scott.linder wrote:
> > 
> Can the new `X86MachineFunctionInfo` field be eliminated, and this instead check the same condition the rest of the X86 code checks before creating a `OpAdjustCfaOffset`? It seems to consistently just be that `!X86FrameLowering::hasFP(MF)`.
The idea here was that if the frame register is the stack pointer *and* a CFA adjustment was emitted we'd switch to the CFA. This proposal would get rid of the latter, which I discussed in more detail in the top-level comment.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143463



More information about the llvm-commits mailing list