[llvm-bugs] [Bug 44119] New: Missed opportunity to emit call site parameter entry

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 22 07:55:02 PST 2019


https://bugs.llvm.org/show_bug.cgi?id=44119

            Bug ID: 44119
           Summary: Missed opportunity to emit call site parameter entry
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: DebugInfo
          Assignee: unassignedbugs at nondot.org
          Reporter: david.stenberg at ericsson.com
                CC: jdevlieghere at apple.com, keith.walker at arm.com,
                    llvm-bugs at lists.llvm.org,
                    paul_robinson at playstation.sony.com

Reproduced on 3889ff82bf4057ead22dad91a89384ac20ebd557.

Compiling the following file:

  extern void callee(int);
  extern int value(void);
  extern int global;

  int caller() {
    if (global) {
      int local = value();
      callee(local);
      return local;
    }
    return 0;
  }

using:

  clang --target=x86_64 -O1 -g -Xclang -femit-debug-entry-values -c missed.c

we do not get a call site parameter entry for callee's parameter:

  llvm-dwarfdump missed.o | grep -c call_site_parameter
  0

This is the code for the call and the parameter value:

  CALL64pcrel32 @value, csr_64, implicit $rsp, implicit $ssp, implicit-def
$rsp, implicit-def $ssp, implicit-def $eax, debug-location !26
  $ebx = MOV32rr $eax, debug-location !26
  DBG_VALUE $ebx, $noreg, !17, !DIExpression(), debug-location !27
  $edi = MOV32rr $eax, debug-location !28
  CALL64pcrel32 @callee, csr_64, implicit $rsp, implicit $ssp, implicit killed
$edi, implicit-def $rsp, implicit-def $ssp, debug-location !28
  JMP_1 %bb.3

The describeLoadedValue() hook will be able to describe that the value of $edi
is available in $eax, but as that is not a preserved register we can't emit a
call site entry using that. The code does not understand that $eax's value is
available in the preserved register $ebx during the call. When looking for call
site values in collectCallSiteParameters(), should we also keep track of other
copy instructions, and then try to find a preserved copy of the register to
instead describe the call site entry with?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20191122/3ed13515/attachment.html>


More information about the llvm-bugs mailing list