[PATCH] D116821: [DebugInfo][InstrRef] Move instr-ref controlling flag out of TargetOptions

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 21 10:54:06 PST 2022


jmorse added a comment.

In D116821#3261927 <https://reviews.llvm.org/D116821#3261927>, @aganea wrote:

> Some mappings seem to be missing, but I don't know why the `Location->Register` didn't return the FPU stack ST0-ST7 before?

Ah, I might have an explanation -- the x87 FP stackifier pass complete ignores debug instructions, and so DBG_VALUEs of $fp0 pass through to the DWARF/CodeView emitter untouched. Wheras the "new" variable location tracking extracts physreg locations from the instructions that define values, so it'll produce references to ST0-7 taken from "real" instructions, instead of unstackified FP0-7.

I'm no expert on x87, as I understand it the registers are referred to in a stack but the old variable location tracking paid no attention to the stack changing depth, and that probably lead to lots of wrong variable locations. I haven't tried to fix this in "instruction referencing" mode, but it's technically do-able. I was rather hoping that everyone just used the SSE registers on x86_64, but I guess that doesn't happen when people us "long double".


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116821



More information about the llvm-commits mailing list