[PATCH] D15785: [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.

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 27 01:59:51 PST 2015


chandlerc created this revision.
chandlerc added a reviewer: jmolloy.
chandlerc added a subscriber: llvm-commits.
Herald added a subscriber: joker.eph.

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.

http://reviews.llvm.org/D15785

Files:
  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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15785.43653.patch
Type: text/x-patch
Size: 16631 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151227/2a172a5f/attachment.bin>


More information about the llvm-commits mailing list