This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo][InstrRef] "Final" test cleanup switching x86 tests to instruction referencing

Authored by jmorse on Nov 25 2021, 5:49 AM.



These are some final test changes for using instruction referencing on X86:

  • Most of these tests just have the flag switched so that they run with instr-ref, and just work: these tests were fixed by earlier patches.
  • One or two have minor differences in how debug values are printed in textual output,
  • A couple have different temporary labels in the text asm output, due to more MCSymbols being created in the output. The actual variable locations don't change.
  • One test checking for "debug-location !1234" at the end of DBG_VALUEs is modified because InstrRefBasedLDV creates new DILocations for variable locations, they don't get assigned metadata node numbers, and are instead represented inline. This test isn't checking for line number information though, so it's not important.

Diff Detail

Event Timeline

jmorse created this revision.Nov 25 2021, 5:49 AM
jmorse requested review of this revision.Nov 25 2021, 5:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 25 2021, 5:49 AM
jmorse updated this revision to Diff 389840.Nov 25 2021, 10:42 AM

Fold in a change to 2010-05-26-DotDebugLoc.ll -- I wasn't sure why it needed a change, however it turns out to be spurious too. In DBG_VALUE mode, a DBG_VALUE is issued after a copy of the argument $rdi to $rbx, but in instr-ref mode that copy is deferred until after an instruction that clobbers $rdi. Hence, we expect the location-list MCSymbol to come after one additional copy.

jmorse updated this revision to Diff 389959.Nov 26 2021, 2:26 AM

Remove live-debug-variables.ll from the test updates -- on closer inspection, this turns out to be exercising a specific part of LiveDebugVariables to endure that it does coalesce virtual registers together. That's not something instruction referencing has any part of, so w should leave it as explicitly testing DBG_VALUE mode.

djtodoro added inline comments.Nov 26 2021, 3:03 AM

why this? Is this a code change?


Cool :)

jmorse added inline comments.Nov 26 2021, 3:12 AM

It's not a code change, instead the position at which a variable location changes has moved. With DBG_VALUEs it's:

$rbx = MOV64rr $rdi
DBG_VALUE $rbx, $noreg, !18, !DIExpression(), 
renamable $edi = MOV32rm $rdi, 1, $noreg, 0, $noreg, ...

But with instruction referencing it's:

$rbx = MOV64rr $rdi
renamable $edi = MOV32rm $rdi, 1, $noreg, 0, $noreg, 
DBG_VALUE $rbx, $noreg, !18, !DIExpression(),

The reason why is that VarLocBasedLDV will follow the COPY from a volatile register to a non-volatile immediately, but InstrRefBasedLDV waits until $rdi is clobbered before moving the variable location. That moves the ".Ltmp" symbol for where the variable changes location to be one instruction later.

Looking at it again, it needs the comment above to be updated.

djtodoro added inline comments.Nov 26 2021, 3:15 AM

OK, got it. So the comment above should be updated.

jmorse updated this revision to Diff 389978.Nov 26 2021, 3:15 AM

Update a comment in 2010-05-25-DotDebugLoc.ll to reflect the new layout of debug instructions.

djtodoro accepted this revision.Nov 26 2021, 3:16 AM

Small nit. Otherwise lgtm.

This revision is now accepted and ready to land.Nov 26 2021, 3:16 AM
This revision was automatically updated to reflect the committed changes.