[all-commits] [llvm/llvm-project] 02afcb: [SystemZ] Fix compile time regression in adjustInl...

Jonas Paulsson via All-commits all-commits at lists.llvm.org
Tue Apr 29 15:43:06 PDT 2025


  Branch: refs/heads/release/20.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 02afcbf63fee21d4acef0761693791f270460fec
      https://github.com/llvm/llvm-project/commit/02afcbf63fee21d4acef0761693791f270460fec
  Author: Jonas Paulsson <paulson1 at linux.ibm.com>
  Date:   2025-04-29 (Tue, 29 Apr 2025)

  Changed paths:
    M llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp

  Log Message:
  -----------
  [SystemZ] Fix compile time regression in adjustInliningThreshold(). (#137527)

Instead of always iterating over all GlobalVariable:s in the Module to
find the case where both Caller and Callee is using the same GV heavily,
first scan Callee (only if less than 200 instructions) for all GVs used
more than 10 times, and then do the counting for the Caller for just
those relevant GVs.

The limit of 200 instructions makes sense as this aims to inline a
relatively small function using a GV +10 times.

This resolves the compile time problem with zig where it is on main
(compared to removing the heuristic) a 380% increase, but with this
change <0.5% increase (total user compile time with opt).

Fixes #134714.

(cherry picked from commit 98b895da30c03b7061b8740d91c0e7998e69d091)



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list