This is an archive of the discontinued LLVM Phabricator instance.

[NewPM] Run ObjC ARC passes
ClosedPublic

Authored by aeubanks on Dec 22 2020, 9:44 PM.

Details

Summary

Match the legacy PM in running various ObjC ARC passes.

This requires making some module passes into function passes. These were
initially ported as module passes since they add function declarations
(e.g. https://reviews.llvm.org/D86178), but that's still up for debate
and other passes do so.

Diff Detail

Event Timeline

aeubanks created this revision.Dec 22 2020, 9:44 PM
aeubanks requested review of this revision.Dec 22 2020, 9:44 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptDec 22 2020, 9:44 PM

I couldn't find any existing tests that these passes run under the legacy PM. Perhaps checking the output of -debug-pass-manager is enough for a test?

The changes LGTM, but I'd rather defer final review to ahatanak@.
It would be good to have some testing but it could be addressed in a separate patch, potentially by folks more familiar with the ObjCARC passes.

Is this change safe considering calls to EP.get() can add function declarations to the module as you mentioned in https://reviews.llvm.org/D86178?

Is this change safe considering calls to EP.get() can add function declarations to the module as you mentioned in https://reviews.llvm.org/D86178?

It's definitely safe right now since we have no support for concurrency right now. Many existing function passes will create function definitions, e.g. replacing some snippet with an intrinsic.
Of course if we ever decide to figure out concurrency we'll have to solve this issue, but we would have to solve it anyway even without this change.

ahatanak accepted this revision.Jan 8 2021, 3:10 PM

LGTM. ARC contract pass isn't being run by the NPM, but you are going to change that in the future, I guess?

This revision is now accepted and ready to land.Jan 8 2021, 3:10 PM

LGTM. ARC contract pass isn't being run by the NPM, but you are going to change that in the future, I guess?

Looks like that's part of the codegen pipeline and not the optimization pipeline, and the NPM switch is only for the optimization pipeline.

This revision was automatically updated to reflect the committed changes.