[all-commits] [llvm/llvm-project] 42c2dc: [IPSCCP] Move the IPSCCP run function under the IP...

Alexandros Lamprineas via All-commits all-commits at lists.llvm.org
Thu Dec 8 04:23:06 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 42c2dc401742266da3e0251b6c1ca491f4779963
      https://github.com/llvm/llvm-project/commit/42c2dc401742266da3e0251b6c1ca491f4779963
  Author: Alexandros Lamprineas <alexandros.lamprineas at arm.com>
  Date:   2022-12-08 (Thu, 08 Dec 2022)

  Changed paths:
    M llvm/include/llvm/Transforms/Scalar/SCCP.h
    M llvm/include/llvm/Transforms/Utils/SCCPSolver.h
    M llvm/lib/Transforms/IPO/CMakeLists.txt
    M llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
    M llvm/lib/Transforms/IPO/SCCP.cpp
    M llvm/lib/Transforms/Scalar/SCCP.cpp
    M llvm/lib/Transforms/Utils/SCCPSolver.cpp
    M llvm/utils/gn/secondary/llvm/lib/Transforms/IPO/BUILD.gn

  Log Message:
  -----------
  [IPSCCP] Move the IPSCCP run function under the IPO directory.

The LLVMipo library no longer depends on the Scalar component.
The shared functions between IPSCCP and SCCP have been moved
under Utils, in the SCCPSolver.

This is preliminary work for D126455, in order to break a cyclic
dependency between LLVM libraries.

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


  Commit: 877a9f9abec61f06e39f1cd872e37b828139c2d1
      https://github.com/llvm/llvm-project/commit/877a9f9abec61f06e39f1cd872e37b828139c2d1
  Author: Alexandros Lamprineas <alexandros.lamprineas at arm.com>
  Date:   2022-12-08 (Thu, 08 Dec 2022)

  Changed paths:
    M llvm/include/llvm/InitializePasses.h
    M llvm/include/llvm/LinkAllPasses.h
    M llvm/include/llvm/Transforms/IPO.h
    A llvm/include/llvm/Transforms/IPO/FunctionSpecialization.h
    M llvm/include/llvm/Transforms/IPO/SCCP.h
    M llvm/include/llvm/Transforms/Scalar/SCCP.h
    M llvm/include/llvm/Transforms/Utils/SCCPSolver.h
    M llvm/lib/Passes/PassBuilderPipelines.cpp
    M llvm/lib/Passes/PassRegistry.def
    M llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
    M llvm/lib/Transforms/IPO/IPO.cpp
    M llvm/lib/Transforms/IPO/SCCP.cpp
    M llvm/lib/Transforms/Utils/SCCPSolver.cpp
    M llvm/test/Transforms/FunctionSpecialization/bug52821-use-after-free.ll
    M llvm/test/Transforms/FunctionSpecialization/bug55000-read-uninitialized-value.ll
    M llvm/test/Transforms/FunctionSpecialization/compiler-crash-58759.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization-always-inline.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression2.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression3.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression4.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression5.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-integers.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization-loop.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization-minsize.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization-minsize2.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization-minsize3.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization-nodup.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization-nodup2.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization-noexec.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization-nonconst-glob.ll
    R llvm/test/Transforms/FunctionSpecialization/function-specialization-nothing-todo.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization-poison.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization-recursive.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization-recursive2.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization-recursive3.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization-recursive4.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization-stats.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization2.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization3.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization4.ll
    M llvm/test/Transforms/FunctionSpecialization/function-specialization5.ll
    M llvm/test/Transforms/FunctionSpecialization/get-possible-constants.ll
    M llvm/test/Transforms/FunctionSpecialization/identical-specializations.ll
    M llvm/test/Transforms/FunctionSpecialization/literal-const.ll
    M llvm/test/Transforms/FunctionSpecialization/no-spec-unused-arg.ll
    M llvm/test/Transforms/FunctionSpecialization/noinline.ll
    M llvm/test/Transforms/FunctionSpecialization/remove-dead-recursive-function.ll
    M llvm/test/Transforms/FunctionSpecialization/specialization-order.ll
    M llvm/test/Transforms/FunctionSpecialization/specialize-multiple-arguments.ll

  Log Message:
  -----------
  [FuncSpec] Make the Function Specializer part of the IPSCCP pass.

The aim of this patch is to minimize the compilation time overhead of
running Function Specialization. It is about 40% slower to run as a
standalone pass (IPSCCP + FuncSpec vs IPSCCP with FuncSpec) according
to my measurements. I compiled the llvm testsuite with NewPM-O3 + LTO
and measured single threaded [user + system] time of IPSCCP and FuncSpec
by passing the '-time-passes' option to lld. Then I compared the two
configurations in terms of Instruction Count of the total compilation
(not of the individual passes) as in https://llvm-compile-time-tracker.com.
Geomean for non-LTO builds is -0.25% and LTO is -0.5% approximately.

You can find more info below:

https://discourse.llvm.org/t/rfc-should-we-enable-function-specialization/61518

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


Compare: https://github.com/llvm/llvm-project/compare/f0f33957d034...877a9f9abec6


More information about the All-commits mailing list