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.
Paths
| Differential D47259
[IPSCCP,PM] Preserve DT in the new pass manager. ClosedPublic Authored by fhahn on May 23 2018, 7:25 AM.
Details Summary 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 Timelinefhahn retitled this revision from [IPSCCP] Preserve DT in the new pass manager. to [IPSCCP,PM] Preserve DT in the new pass manager.. Comment ActionsRebased 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. kuhar added inline comments. 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. This revision is now accepted and ready to land.Nov 8 2018, 10:04 AM
Comment Actions LGTM and I'm glad to see other passes working to preserve DTU.
Comment Actions LGTM, nit below.
fhahn marked 3 inline comments as done. Comment ActionsThank 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? Closed by commit rL346486: [IPSCCP,PM] Preserve DT in the new pass manager. (authored by fhahn). · Explain WhyNov 9 2018, 3:55 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 173205 include/llvm/Transforms/Scalar/SCCP.h
lib/Transforms/IPO/SCCP.cpp
lib/Transforms/Scalar/SCCP.cpp
test/Transforms/SCCP/ipsccp-preserve-domtree.ll
|
s/Analysis/AnalysisResults/ ?