[all-commits] [llvm/llvm-project] 20c8f5: [FuncSpec] Split the specialization bonus into Cod...

Alexandros Lamprineas via All-commits all-commits at lists.llvm.org
Wed Jul 26 04:07:33 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 20c8f58c11d06d4a31fef5033ea5417fb99dfd0e
      https://github.com/llvm/llvm-project/commit/20c8f58c11d06d4a31fef5033ea5417fb99dfd0e
  Author: Alexandros Lamprineas <alexandros.lamprineas at arm.com>
  Date:   2023-07-26 (Wed, 26 Jul 2023)

  Changed paths:
    M llvm/include/llvm/Transforms/IPO/FunctionSpecialization.h
    M llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
    M llvm/unittests/Transforms/IPO/FunctionSpecializationTest.cpp

  Log Message:
  -----------
  [FuncSpec] Split the specialization bonus into CodeSize and Latency.

Currently we use a combined metric TargetTransformInfo::TCK_SizeAndLatency
when estimating the specialization bonus. This is suboptimal, and in some
cases erroneous. For example we shouldn't be weighting the codesize decrease
attributed to constant propagation by the block frequency of the dead code.
Instead only the latency savings should be weighted by block frequency. The
total codesize savings from all the specialization arguments should be
deducted from the specialization cost.

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




More information about the All-commits mailing list