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.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
60,030 ms | x64 debian > libFuzzer.libFuzzer::fuzzer-leak.test |
Event Timeline
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.