[all-commits] [llvm/llvm-project] 265657: [IPSCCP] Enable specialization of functions.

Alexandros Lamprineas via All-commits all-commits at lists.llvm.org
Sun Dec 25 04:30:28 PST 2022


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

  Changed paths:
    M llvm/docs/ReleaseNotes.rst
    M llvm/include/llvm/Transforms/IPO/SCCP.h
    M llvm/lib/Passes/PassBuilderPipelines.cpp
    M llvm/test/Other/new-pm-defaults.ll
    M llvm/test/Other/new-pm-lto-defaults.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/FunctionSpecialization/compiler-crash-58759.ll

  Log Message:
  -----------
  [IPSCCP] Enable specialization of functions.

This patch enables Function Specialization by default at all
optimization levels except Os, Oz.

Compilation Time Overhead:
--------------------------
Measured the Instruction Count increase (Geomean) for CTMark from
the llvm-testsuite as in https://llvm-compile-time-tracker.com.
 * {-O3, Non-LTO}: +0.136% Instruction Count
 * {-O3, LTO}: +0.346% Instruction Count

Performance Uplift:
-------------------
Measured +9.121% score increase for 505.mcf_r from SPEC Int 2017
(Tested on Neoverse N1 with -O3 + LTO)

Correctness Testing:
--------------------
 * Passes bootstrap Clang with ASAN + LTO + FuncSpec aggressive options:
   { MaxClonesThreshold=10,
     SmallFunctionThreshold=10,
     AvgLoopIterationCount=30,
     SpecializeOnAddresses=true,
     EnableSpecializationForLiteralConstant=true,
     FuncSpecializationMaxIters=10 }
 * Builds Chromium and passes its unittests with the above options + ThinLTO.

For more info please refer to
https://discourse.llvm.org/t/rfc-should-we-enable-function-specialization/61518

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




More information about the All-commits mailing list