[PATCH] D89158: [NewPM] Provide method to run all pipeline callbacks, used for -O0
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 9 20:04:21 PST 2020
aeubanks added a comment.
With this change in its current state, it's ok to add callbacks, as long as they don't add passes at -O0.
Polly adds some callbacks. When I first submitted this, polly would add some callbacks to VectorizerStartEPCallbacks. Those callbacks didn't actually add any passes (I didn't investigate that, but it makes sense at -O0). However, the previous logic would add a FunctionPassManager if there were any callbacks, so we had an extra empty FunctionPassManager being run, which changed the output of -debug-pass-manager. Now I've changed it so that we check if the FunctionPassManager actually has any passes added to it before adding it to the ModulePassManager.
So previously it was
if (!VectorizerStartEPCallbacks.empty()) {
FunctionPassManager FPM(DebugLogging);
for (auto &C : VectorizerStartEPCallbacks)
C(FPM, Level);
MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
}
Now it is
if (!VectorizerStartEPCallbacks.empty()) {
FunctionPassManager FPM(DebugLogging);
for (auto &C : VectorizerStartEPCallbacks)
C(FPM, Level);
if (!FPM.isEmpty())
MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
}
which should take care of added registered callbacks that don't actually add anything at -O0.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D89158/new/
https://reviews.llvm.org/D89158
More information about the llvm-commits
mailing list