This is an archive of the discontinued LLVM Phabricator instance.

[InstrProf] Clear `ReferencedNames` as well (NFC).
AbandonedPublic

Authored by michele.scandale on Aug 1 2022, 6:53 PM.

Details

Reviewers
davidxl
vsk
Summary

Ensure that the all state that depends on a module or context is cleared
so that there are no issues when the same instance of the pass is used
to process different modules.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptAug 1 2022, 6:53 PM
michele.scandale requested review of this revision.Aug 1 2022, 6:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 1 2022, 6:53 PM

Do you have a test case showing the problem?

Do you have a test case showing the problem?

There is no simple test case that shows the issue. As I mentioned https://reviews.llvm.org/D130952#3693697 and in the comments of D130954, this is something I discovered while investigating issues with running the same pass manager on different modules -- in light of the issue with ModuleInlinerWrapperPass I did a local run of the llvm LIT test with a modified version of opt where I used the same pass manager to process the input module twice. In this particular case the missing clear was causing crashes in the instrprofiling tests as there are stale references to GlobalVariable objects in a module that is long gone.

Based on the discussion in D130954, it seems that currently there is no intention to support the use case I was experimenting with, therefore this change is not required.
From the initial performance analysis rebuilding the pass manager is much cheaper with the new pass manager than the legacy one, and for now I can use such alternative approach for my use case.

michele.scandale abandoned this revision.Dec 15 2022, 11:16 PM