[all-commits] [llvm/llvm-project] 0d4a70: [Pipeline] Adjust PostOrderFunctionAttrs placement...

aeubanks via All-commits all-commits at lists.llvm.org
Mon Mar 6 09:02:16 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0d4a709bb876824a0afa5f86e138e8ffdcaf7661
      https://github.com/llvm/llvm-project/commit/0d4a709bb876824a0afa5f86e138e8ffdcaf7661
  Author: Arthur Eubanks <aeubanks at google.com>
  Date:   2023-03-06 (Mon, 06 Mar 2023)

  Changed paths:
    M llvm/include/llvm/Transforms/IPO/FunctionAttrs.h
    M llvm/lib/Analysis/CGSCCPassManager.cpp
    M llvm/lib/Passes/PassBuilder.cpp
    M llvm/lib/Passes/PassBuilderPipelines.cpp
    M llvm/lib/Passes/PassRegistry.def
    M llvm/lib/Transforms/IPO/FunctionAttrs.cpp
    M llvm/test/Other/new-pm-defaults.ll
    M llvm/test/Other/new-pm-print-pipeline.ll
    M llvm/test/Other/new-pm-thinlto-defaults.ll
    M llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll
    M llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll
    M llvm/test/Other/new-pm-thinlto-prelink-pgo-defaults.ll
    M llvm/test/Other/new-pm-thinlto-prelink-samplepgo-defaults.ll
    M llvm/test/Transforms/InstCombine/unused-nonnull.ll
    M llvm/test/Transforms/PhaseOrdering/func-attrs.ll

  Log Message:
  -----------
  [Pipeline] Adjust PostOrderFunctionAttrs placement in simplification pipeline

We can infer more attribute information once functions are fully
simplified, so move the PostOrderFunctionAttrs pass after the function
simplification pipeline. However, just doing this can impact
simplification of recursive functions since function simplification
takes advantage of function attributes of callees (some LLVM tests are
actually impacted by this), so keep a copy of PostOrderFunctionAttrs
before the function simplification pipeline that only runs on recursive
functions.

For example, this fixes the small regression noticed in https://reviews.llvm.org/D128830.

This requires some restructuring of the CGSCC NoRerun feature. We need
to cache the ShouldNotRunFunctionPassesAnalysis analysis after the
simplification is done, which now is after the second
PostOrderFunctionAttrs run, rather than after the function
simplification pipeline.

Compile time impact:
https://llvm-compile-time-tracker.com/compare.php?from=33cf40122279342b50f92a3a53f5c185390b6018&to=1bb2a07875634e508a6bdf2ca1b130f55510f060&stat=instructions:u

Compile time increase from unconditionally running the first PostOrderFunctionAttrs:
https://llvm-compile-time-tracker.com/compare.php?from=1bb2a07875634e508a6bdf2ca1b130f55510f060&to=f4f87e89cc7a35c64e3a103a8036192a84ae002b&stat=instructions:u

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D145210




More information about the All-commits mailing list