[PATCH] D21921: [proof of concept] Port old PM CGSCC visitation logic to new PM
Sean Silva via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 30 23:06:41 PDT 2016
silvas created this revision.
silvas added reviewers: chandlerc, davidxl, dberlin, hfinkel, eraman, sanjoy, mehdi_amini, reames, davide.
silvas added a subscriber: llvm-commits.
silvas set the repository for this revision to rL LLVM.
Herald added a subscriber: mehdi_amini.
This patch implements a proof of concept port of the old PM CGSCC visitation logic to the new PM. It also ports all the remaining CGSCC passes (inliner, argpromotion, prune-eh). I have done some basic sanity checks to make sure things work. Tomorrow I'll add a CC1 flag to clang that allows running new-PM passes and give test-suite a shot.
This was done as a sort of mad dash to get a proof of concept; all the changes are meant to be as mechanical as possible. I fully expect to have to redo every change here incrementally and with proper attention to detail, but seeing it all come together and working is important IMO. Especially the port of the inliner can be done much more cleanly than I have done here.
Most of the patch is just porting the passes and threading state through various places.
But pay attention to include/llvm/Analysis/CGSCCPassManager.h
That is where the real business happens. Especially the "run" methods of ModuleToPostOrderCGSCCPassAdaptor and CGSCCToFunctionPassAdaptor. In total, they are less than 100 lines of code which are at the heart of this patch.
Thoughts?
Repository:
rL LLVM
http://reviews.llvm.org/D21921
Files:
include/llvm/Analysis/CGSCCPassManager.h
include/llvm/Analysis/CallGraphSCCPass.h
include/llvm/Analysis/InlineCost.h
include/llvm/Transforms/IPO/ArgumentPromotion.h
include/llvm/Transforms/IPO/FunctionAttrs.h
include/llvm/Transforms/IPO/InlinerPass.h
include/llvm/Transforms/IPO/PruneEH.h
include/llvm/Transforms/Utils/Cloning.h
lib/Analysis/CGSCCPassManager.cpp
lib/Analysis/CallGraphSCCPass.cpp
lib/Analysis/InlineCost.cpp
lib/Passes/PassBuilder.cpp
lib/Passes/PassRegistry.def
lib/Transforms/IPO/ArgumentPromotion.cpp
lib/Transforms/IPO/FunctionAttrs.cpp
lib/Transforms/IPO/InlineSimple.cpp
lib/Transforms/IPO/Inliner.cpp
lib/Transforms/IPO/PruneEH.cpp
lib/Transforms/IPO/SampleProfile.cpp
lib/Transforms/Utils/InlineFunction.cpp
test/Other/new-pass-manager.ll
test/Other/pass-pipeline-parsing.ll
test/Transforms/ArgumentPromotion/byval.ll
test/Transforms/Inline/alloca-in-scc.ll
test/Transforms/PruneEH/2008-06-02-Weak.ll
test/Transforms/PruneEH/operand-bundles.ll
test/Transforms/PruneEH/pr23971.ll
test/Transforms/PruneEH/pr26263.ll
test/Transforms/PruneEH/recursivetest.ll
test/Transforms/PruneEH/seh-nounwind.ll
test/Transforms/PruneEH/simplenoreturntest.ll
test/Transforms/PruneEH/simpletest.ll
unittests/Analysis/CGSCCPassManagerTest.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21921.62465.patch
Type: text/x-patch
Size: 77383 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160701/7ce75097/attachment-0001.bin>
More information about the llvm-commits
mailing list