[PATCH] D139590: [RegAllocFast] Handle new debug values for spills

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 15 07:46:14 PST 2022


nikic added a comment.

MIR before RegAllocFast:

  # *** IR Dump After Two-Address instruction pass (twoaddressinstruction) ***:
  # Machine code for function _ZN55_$LT$std..io..stdio..Stdin$u20$as$u20$std..io..Read$GT$11read_to_end17haba70a09681d41d3E: NoPHIs, TracksLiveness, TiedOpsRewritten
  Function Live Ins: $x3 in %2
  
  bb.0 (%ir-block.1):
    successors: %bb.1, %bb.2
    liveins: $x3
    %2:g8rc = COPY $x3
    %8:g8rc = ANDI8_rec %2:g8rc, 1, implicit-def $cr0
    %3:crbitrc = COPY $cr0gt
    %0:g8rc = LD 0, $zero8 :: (load (s64) from `ptr null`)
    %1:g8rc = LI8 0
    DBG_VALUE_LIST !"iterator", !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_constu, 1, DW_OP_mul, DW_OP_plus, DW_OP_stack_value, DW_OP_LLVM_fragment, 64, 64), %0:g8rc, %1:g8rc, debug-location !140; library/alloc/src/vec/spec_extend.rs:0 @[ library/alloc/src/vec/mod.rs:2392:9 @[ library/std/src/io/buffered/bufreader.rs:330:9 @[ library/std/src/io/stdio.rs:464:9 @[ library/std/src/io/stdio.rs:430:9 ] ] ] ] line no:83
    %4:crbitrc = CRSET
    %5:crbitrc = CRXOR %3:crbitrc, killed %4:crbitrc
    BC killed %5:crbitrc, %bb.2
    B %bb.1
  
  bb.1 (%ir-block.4):
  ; predecessors: %bb.0
  
    BLR8 implicit $lr8, implicit $rm
  
  bb.2 (%ir-block.5):
  ; predecessors: %bb.0
    successors: %bb.4, %bb.3
  
    ADJCALLSTACKDOWN 32, 0, implicit-def dead $r1, implicit $r1
    %6:g8rc = LI8 0
    $x3 = COPY %6:g8rc
    $x4 = COPY %0:g8rc
    $x5 = COPY %1:g8rc
    BL8_NOP &memcpy, <regmask $zero $cr2 $cr3 $cr4 $f14 $f15 $f16 $f17 $f18 $f19 $f20 $f21 $f22 $f23 $f24 $f25 $f26 $f27 $f28 $f29 $f30 $f31 $r14 $r15 $r16 $r17 $r18 $r19 $r20 $r21 $r22 $r23 $r24 and 62 more...>, implicit-def dead $lr8, implicit $rm, implicit $x3, implicit $x4, implicit $x5, implicit $x2, implicit-def $r1, implicit-def $x3
    ADJCALLSTACKUP 32, 0, implicit-def dead $r1, implicit $r1
    %7:g8rc = COPY $x3
    BC %3:crbitrc, %bb.4
    B %bb.3
  
  bb.3 (%ir-block.6):
  ; predecessors: %bb.2
    successors: %bb.4
  
    B %bb.4
  
  bb.4 (%ir-block.7):
  ; predecessors: %bb.2, %bb.3
  
    BLR8 implicit $lr8, implicit $rm
  
  # End machine code for function _ZN55_$LT$std..io..stdio..Stdin$u20$as$u20$std..io..Read$GT$11read_to_end17haba70a09681d41d3E.

I've also made the debug print for this failure a bit more precise, and it now says:

  Remaining virtual register %0...
  ...in instruction: DBG_VALUE_LIST !"iterator", !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_deref, DW_OP_constu, 1, DW_OP_mul, DW_OP_plus, DW_OP_stack_value, DW_OP_LLVM_fragment, 64, 64), %0:g8rc, %stack.0, debug-location !140; library/alloc/src/vec/spec_extend.rs:0 @[ library/alloc/src/vec/mod.rs:2392:9 @[ library/std/src/io/buffered/bufreader.rs:330:9 @[ library/std/src/io/stdio.rs:464:9 @[ library/std/src/io/stdio.rs:430:9 ] ] ] ] line no:83
  
  ...in instruction: DBG_VALUE_LIST !"iterator", !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_deref, DW_OP_constu, 1, DW_OP_mul, DW_OP_plus, DW_OP_stack_value, DW_OP_LLVM_fragment, 64, 64), %0:g8rc, %stack.0, debug-location !140; library/alloc/src/vec/spec_extend.rs:0 @[ library/alloc/src/vec/mod.rs:2392:9 @[ library/std/src/io/buffered/bufreader.rs:330:9 @[ library/std/src/io/stdio.rs:464:9 @[ library/std/src/io/stdio.rs:430:9 ] ] ] ] line no:83

So yes @MatzeB, this is related to DBG_VALUE_LIST.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139590



More information about the llvm-commits mailing list