This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Print DEBUG_VALUE once for target indices
ClosedPublic

Authored by aheejin on Dec 7 2022, 2:17 PM.

Details

Summary

DEBUG_VALUE comments are printed before an instruction, so they are
not printed with AddComment method as other comments are, but printed
using emitRawComment method. But currently emitDebugValueComment
calls emitRawComment twice for target-index-based DBG_VALUEs: once
in the switch-case,
https://github.com/llvm/llvm-project/blob/d77ae7f2513504655e555cd326208598093d66e2/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp#L1192-L1193
and again at the end of the method:
https://github.com/llvm/llvm-project/blob/d77ae7f2513504655e555cd326208598093d66e2/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp#L1227-L1228

This makes them printed twice. I think this happened through multiple
commits modifying and refactoring this method.

Diff Detail

Event Timeline

aheejin created this revision.Dec 7 2022, 2:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 7 2022, 2:17 PM
Herald added subscribers: pmatos, asb, wingo and 5 others. · View Herald Transcript
aheejin requested review of this revision.Dec 7 2022, 2:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 7 2022, 2:17 PM
dschuff accepted this revision.Dec 7 2022, 4:12 PM

LGTM. TBH i'm fine with this not having a test, since it only affects our LLVM development experience and not the output. but it's good as-is too.

This revision is now accepted and ready to land.Dec 7 2022, 4:12 PM
aheejin edited the summary of this revision. (Show Details)Dec 7 2022, 5:25 PM
aheejin updated this revision to Diff 481691.Dec 9 2022, 10:55 AM

Delete the test

This revision was landed with ongoing or failed builds.Dec 9 2022, 10:57 AM
This revision was automatically updated to reflect the committed changes.

I don't see why that can be related to this CL? This CL only affects wasm assembly printing, and only comment. Target indices are used only by wasm. remove-undef-fragment.ll doesn't even seem to go as far to print assembly, because it has -stop-after=finalize-isel.