[llvm-bugs] [Bug 50613] New: simple-register-coalescing fails to update/invalidate DBG_VALUE

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jun 8 00:10:09 PDT 2021


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

            Bug ID: 50613
           Summary: simple-register-coalescing fails to update/invalidate
                    DBG_VALUE
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: markus.lavin at ericsson.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

Created attachment 24922
  --> https://bugs.llvm.org/attachment.cgi?id=24922&action=edit
Reproducer input for Arm target.

With input as follows
---
  bb.0:
    liveins: $r0
    %4:gpr = COPY $r0
    %9:gpr = COPY %4
    %9:gpr = ADDri %9, 4, 14, $noreg, $noreg
    %12:gpr = COPY %9
    B %bb.1
  bb.1:
    %10:gpr = COPY %12
    DBG_VALUE %4, $noreg, !10, !DIExpression(), debug-location !8
    %11:gpr = COPY %10
    %11:gpr = ADDri %11, 4, 14, $noreg, $noreg
    %12:gpr = COPY %11
    B %bb.1
---
after issuing
$ llc dbg-coalesc-arm-reduced.mir -run-pass=liveintervals
-run-pass=simple-register-coalescing -o - -debug-only=regalloc
we get
---
  bb.0:
    successors: %bb.1(0x80000000)
    liveins: $r0

    %2:gpr = COPY $r0
    %2:gpr = ADDri %2, 4, 14 /* CC::al */, $noreg, $noreg
    B %bb.1

  bb.1:
    successors: %bb.1(0x80000000)

    DBG_VALUE %2, $noreg, <0xa03e470>, !DIExpression(), debug-location
!DILocation(line: 1, column: 1, scope: <0xa03e520>)
    %2:gpr = ADDri %2, 4, 14 /* CC::al */, $noreg, $noreg
    B %bb.1
---
That is the DBG_VALUE is now using a register with different value (previously
$r0 but now $r0+4).

I believe this situation should be handled by
---
commit d9c9a4e48d286a04d09a8fdea87f486a9ec02cd0
Author: Jeremy Morse <jeremy.morse at sony.com>
Date:   Mon Nov 25 13:38:27 2019 +0000

    [DebugInfo] Avoid register coalesing unsoundly changing DBG_VALUE locations
---
PS. It took a while to get to this reproducer so obviously it does handle quite
a few similar situations.

-- 
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/20210608/b3541b97/attachment.html>


More information about the llvm-bugs mailing list