This is an archive of the discontinued LLVM Phabricator instance.

[Analys] Added new context analys for BB/Inst
Needs RevisionPublic

Authored by dbakunevich on Mar 20 2023, 7:31 AM.

Details

Summary

Added a new analysis pass that allows collecting context information
about instructions and basic blocks. This analysis will help to give more
meaningful names for instructions and basic blocks in the MetaRenamer pass.
Also, this pass collects the full context for the given instruction/basic block.

Diff Detail

Event Timeline

dbakunevich created this revision.Mar 20 2023, 7:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 20 2023, 7:31 AM
dbakunevich requested review of this revision.Mar 20 2023, 7:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 20 2023, 7:31 AM

I don't think a separate analysis is justified here. If you want to improve the meta renamer just make the necessary changes there.

I'm not sure why you need "Context" info for meta renames.

Actually it was I who proposed Dmitry to split it off into a separate analysis. The main advantage of this approach is that we can then create some static analysis tools that don't necessarily modify the IR to give you the same info.

nikic added a subscriber: nikic.Mar 21 2023, 1:42 AM

Actually it was I who proposed Dmitry to split it off into a separate analysis. The main advantage of this approach is that we can then create some static analysis tools that don't necessarily modify the IR to give you the same info.

I think it would still be preferable to start implementing this as a MetaRenamer improvement, and then extracting it into a separate analysis if we have an actual use case for it.

mkazantsev added inline comments.Mar 21 2023, 5:38 AM
llvm/lib/Analysis/ContextAnalysis.cpp
14–15

StringRef (here and everywhere)

16

.empty() (here and everywhere)

dbakunevich marked 2 inline comments as done.

Marking to remove it from my review list, please update if you have plans on it. Let's start from MetaRenamer changes.

mkazantsev requested changes to this revision.Apr 12 2023, 10:19 PM
This revision now requires changes to proceed.Apr 12 2023, 10:19 PM