llvm.org GIT mirror llvm / d656774
[DebugInfo][Docs] Document that prologue/epilogue variable location changes are ignored This patch documents that LLVM does not describe all changes in variable locations during the prologue and the epilogue. The debugger doesn't / shouldn't step through that portion of the function anyway, and describing every location through such stages would bloat location lists. Perform some minor cleanup at the same time, * Fix an enumerated list * Document that dbg.declare intrinsics have their variable location recorded in a MachineFunction table, not with DBG_VALUE meta-insts * Adds frame-indexes to the list of things that can be operands to DBG_VALUEs. Differential Revision: https://reviews.llvm.org/D63083 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363654 91177308-0d34-0410-b5e6-96231b3b80d8 Jeremy Morse a month ago
1 changed file(s) with 13 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
530530 variable to their machine locations over ranges of instructions.
531531 From IR to object emission, the major transformations which affect variable
532532 location fidelity are:
533
533534 1. Instruction Selection
534535 2. Register allocation
535536 3. Block layout
537538 each of which are discussed below. In addition, instruction scheduling can
538539 significantly change the ordering of the program, and occurs in a number of
539540 different passes.
541
542 Some variable locations are not transformed during CodeGen. Stack locations
543 specified by ``llvm.dbg.declare`` are valid and unchanging for the entire
544 duration of the function, and are recorded in a simple MachineFunction table.
545 Location changes in the prologue and epilogue of a function are also ignored:
546 frame setup and destruction may take several instructions, require a
547 disproportionate amount of debugging information in the output binary to
548 describe, and should be stepped over by debuggers anyway.
540549
541550 Variable locations in Instruction Selection and MIR
542551 ---------------------------------------------------
572581 DBG_VALUE %1, $noreg, !123, !DIExpression()
573582
574583 And have the following operands:
575 * The first operand can record the variable location as a register, an
576 immediate, or the base address register if the original debug intrinsic
577 referred to memory. ``$noreg`` indicates the variable location is undefined,
578 equivalent to an ``undef`` dbg.value operand.
584 * The first operand can record the variable location as a register,
585 a frame index, an immediate, or the base address register if the original
586 debug intrinsic referred to memory. ``$noreg`` indicates the variable
587 location is undefined, equivalent to an ``undef`` dbg.value operand.
579588 * The type of the second operand indicates whether the variable location is
580589 directly referred to by the DBG_VALUE, or whether it is indirect. The
581590 ``$noreg`` register signifies the former, an immediate operand (0) the