[attrs] Split the late-revisit pattern for deducing norecurse in
authorChandler Carruth <chandlerc@gmail.com>
Fri, 8 Jan 2016 10:55:52 +0000 (10:55 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Fri, 8 Jan 2016 10:55:52 +0000 (10:55 +0000)
commite96fb9ab15d4c9c20f2427190274339f38846945
tree1aa5682ae63fec5ff7e7c031c2b7e776c2906072
parent84a9919b57b7a7d83914a2adf9417d347b34467a
[attrs] Split the late-revisit pattern for deducing norecurse in
a top-down manner into a true top-down or RPO pass over the call graph.

There are specific patterns of function attributes, notably the
norecurse attribute, which are most effectively propagated top-down
because all they us caller information.

Walk in RPO over the call graph SCCs takes the form of a module pass run
immediately after the CGSCC pass managers postorder walk of the SCCs,
trying again to deduce norerucrse for each singular SCC in the call
graph.

This removes a very legacy pass manager specific trick of using a lazy
revisit list traversed during finalization of the CGSCC pass. There is
no analogous finalization step in the new pass manager, and a lazy
revisit list is just trying to produce an RPO iteration of the call
graph. We can do that more directly if more expensively. It seems
unlikely that this will be the expensive part of any compilation though
as we never examine the function bodies here. Even in an LTO run over
a very large module, this should be a reasonable fast set of operations
over a reasonably small working set -- the function call graph itself.

In the future, if this really is a compile time performance issue, we
can look at building support for both post order and RPO traversals
directly into a pass manager that builds and maintains the PO list of
SCCs.

Differential Revision: http://reviews.llvm.org/D15785

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257163 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/InitializePasses.h
include/llvm/LinkAllPasses.h
include/llvm/Transforms/IPO.h
lib/LTO/LTOCodeGenerator.cpp
lib/Transforms/IPO/FunctionAttrs.cpp
lib/Transforms/IPO/IPO.cpp
lib/Transforms/IPO/PassManagerBuilder.cpp
test/Transforms/FunctionAttrs/norecurse.ll