This is an archive of the discontinued LLVM Phabricator instance.

Local: fix debug output of replaceDominatedUsesWith()
ClosedPublic

Authored by artagnon on Jul 26 2023, 5:08 AM.

Details

Summary

The debug output of replaceDominatedUsesWith() prints incorrect
information, and the user is left confused about what exactly was
replaced. Fix this.

Diff Detail

Event Timeline

artagnon created this revision.Jul 26 2023, 5:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 26 2023, 5:08 AM
artagnon requested review of this revision.Jul 26 2023, 5:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 26 2023, 5:08 AM

Any chance of a test case?

artagnon updated this revision to Diff 544356.Jul 26 2023, 7:12 AM

Add test.

nikic added inline comments.Jul 27 2023, 3:36 AM
llvm/lib/Transforms/Utils/Local.cpp
2902–2903

If you're already here, I think this should either print *From or From->printAsOperand(dbgs()) (the former prints the whole instruction, the latter just the name, but in a way that e.g. also works if it's an unnamed instruction).

llvm/test/Transforms/Util/local-dbg-print.ll
2

This needs REQUIRES: asserts.

artagnon updated this revision to Diff 544705.Jul 27 2023, 4:30 AM

Address review comments by @nikic.

artagnon marked 2 inline comments as done.Jul 27 2023, 4:30 AM
nikic accepted this revision.Jul 27 2023, 5:13 AM

LG

llvm/lib/Transforms/Utils/Local.cpp
2901

as -> with?

This revision is now accepted and ready to land.Jul 27 2023, 5:13 AM
This revision was landed with ongoing or failed builds.Jul 27 2023, 5:24 AM
This revision was automatically updated to reflect the committed changes.