This is an archive of the discontinued LLVM Phabricator instance.

[RFC] [DRAFT] [IR] Add instruction IDs to simplify debugging.
Needs ReviewPublic

Authored by ygribov on Feb 4 2023, 7:31 AM.

Details

Reviewers
rusyaev-roman
Summary

This provides an easy way to map from instruction in dumpfile to a place where it's created or modified in the compiler (by using conditional breakpoints in debugger).

Diff Detail

Repository
rL LLVM

Event Timeline

ygribov created this revision.Feb 4 2023, 7:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 4 2023, 7:31 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
ygribov requested review of this revision.Feb 4 2023, 7:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 4 2023, 7:31 AM

These data structures have been designed quite carefully with size in mind, so I am against making these debug-only additions. The change as-is is also not thread-safe.

Have you tried just attaching metadata to instructions instead?

These data structures have been designed quite carefully with size in mind, so I am against making these debug-only additions.

Right. I wonder if separate Cmake switch could alleviate this.

The change as-is is also not thread-safe.

That's true. What's worse, I'm afraid it will be inherently racy in parallel compilations.

Have you tried just attaching metadata to instructions instead?

I haven't, thanks for the suggestion.

ygribov retitled this revision from [DRAFT] [IR] Add instruction IDs to simplify debugging. to [RFC] [DRAFT] [IR] Add instruction IDs to simplify debugging..Feb 7 2023, 10:13 AM