[all-commits] [llvm/llvm-project] d81e8a: [AMDGPU] RewriteMFMAFormStage: fix SpillCost early...

xgxanq via All-commits all-commits at lists.llvm.org
Tue Jun 2 08:11:25 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d81e8afe7a51005f5fa58cf4b25ccfdb41f685b1
      https://github.com/llvm/llvm-project/commit/d81e8afe7a51005f5fa58cf4b25ccfdb41f685b1
  Author: xgxanq <anqfu at amd.com>
  Date:   2026-06-02 (Tue, 02 Jun 2026)

  Changed paths:
    M llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
    M llvm/lib/Target/AMDGPU/GCNSchedStrategy.h
    A llvm/test/CodeGen/AMDGPU/rewrite-mfma-form-spill-cost-reset.ll

  Log Message:
  -----------
  [AMDGPU] RewriteMFMAFormStage: fix SpillCost early-return missing reset (#199708)

Extract resetRewriteCandsToVGPR() to consolidate the logic that restores
MFMA candidates from AGPR form back to VGPR form after cost analysis.

getRewriteCost() returned early when SpillCost > 0 without resetting the
AGPR-form register classes set by initHeuristics(), leaving MRI in a
corrupted state. Call resetRewriteCandsToVGPR() on both the early-return
path and the normal exit path to fix this.

Also change getRewriteCost() and rewrite() to take ArrayRef instead of
const std::vector& for cleaner API.

---------

Co-authored-by: Claude Sonnet 4 (1M context) <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