After D45330, Dominators are required for IPSCCP and can be preserved.
This patch preserves DominatorTreeAnalysis in the new pass manager. AFAIK the legacy pass manager cannot preserve function analysis required by a module analysis.
Differential D47259
[IPSCCP,PM] Preserve DT in the new pass manager. fhahn on May 23 2018, 7:25 AM. Authored by
Details After D45330, Dominators are required for IPSCCP and can be preserved. This patch preserves DominatorTreeAnalysis in the new pass manager. AFAIK the legacy pass manager cannot preserve function analysis required by a module analysis.
Diff Detail Event TimelineComment Actions Rebased after DTUpdater changes landed. This patch also restructures the way analyses are passed between the solver and IPO/SCCP.cpp, to make it slightly simpler. Comment Actions Fixed test case (new pm needs -passes='ipsccp,function(verify<domtree>) to verify the DTs afterwards), also pass DTU to other changeToUnreachable and ConstantFoldTerminator calls.
Comment Actions Looks good to me now, thanks for the fixes! You may want for somebody else to take a look at it, though. Have you looked into preserving PDT if available? It should be easy with DTU, but I don't know if it makes sense to preserve it in this place of the pipeline.
Comment Actions LGTM and I'm glad to see other passes working to preserve DTU.
Comment Actions LGTM, nit below.
Comment Actions Thank you very much for having a look! I updated the patch to use deleteBB, added a comment in lib/Transform/IPO/SCCP.cpp on why nullptr is passed in as DT for the legacy pass manager and renamed AnalysisForFn to AnalysisResultsForFn. Unless there are any additional comments, I plan to commit this tomorrow.
Comment Actions FWIW, still LGTM and I think you can go ahead and submit. I would like to see PDT preserved as well (as suggested in review) and maybe other improvements, but all of those seem totally fine for follow-up patches. Comment Actions Great, thank you very much for the prompt review!
I will prepare a patch for preserving PDT tomorrow. I am more than happy to take a look at any follow up improvements. Do you have anything particular in mind, besides preserving PDT? |
s/Analysis/AnalysisResults/ ?