[all-commits] [llvm/llvm-project] 7af4b0: PPC: Avoid constructing TargetTransformInfo in isH...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Wed Jul 15 22:58:24 PDT 2026


  Branch: refs/heads/users/arsenm/ppc/avoid-constructing-temp-tti-instance
  Home:   https://github.com/llvm/llvm-project
  Commit: 7af4b007cbfcdb633888a1fe76b1d79c6db54eeb
      https://github.com/llvm/llvm-project/commit/7af4b007cbfcdb633888a1fe76b1d79c6db54eeb
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2026-07-16 (Thu, 16 Jul 2026)

  Changed paths:
    M llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp

  Log Message:
  -----------
  PPC: Avoid constructing TargetTransformInfo in isHardwareLoopProfitable

PPCTTIImpl::isHardwareLoopProfitable constructed a throwaway
TargetTransformInfo only to call CodeMetrics::analyzeBasicBlock. TTI
may contain pipeline configuration state, and should only be queried
from the PassManager. It was also particularly ugly to construct one here
given that we're inside a TTIImpl.

Most of what analyzeBasicBlock computes was not used here. Directly
sum the instruction code size costs, which was the only used component
of the analysis.

Co-authored-by: Claude (Claude Opus 4.8) <noreply at anthropic.com>



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