[all-commits] [llvm/llvm-project] bf3a9d: [AMDGPU] Fix overlapping insert crash during rewri...

Dhruva Chakrabarti via All-commits all-commits at lists.llvm.org
Thu Jun 25 19:58:04 PDT 2026


  Branch: refs/heads/users/dhruvachak/issue-204224
  Home:   https://github.com/llvm/llvm-project
  Commit: bf3a9d333691bd9033d1c18a2361c5ecef64cb09
      https://github.com/llvm/llvm-project/commit/bf3a9d333691bd9033d1c18a2361c5ecef64cb09
  Author: Dhruva Chakrabarti <Dhruva.Chakrabarti at amd.com>
  Date:   2026-06-25 (Thu, 25 Jun 2026)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPURewriteAGPRCopyMFMA.cpp
    A llvm/test/CodeGen/AMDGPU/rewrite-vgpr-mfma-to-agpr-spill-discontiguous-interval.mir

  Log Message:
  -----------
  [AMDGPU] Fix overlapping insert crash during rewrite-agpr-copy-mfma

Fixes https://github.com/llvm/llvm-project/issues/204224

Guard against a possibly wrong interference result for a discontiguous
stack slot interval by using the entire range.

A spilled stack slot can have a discontiguous live interval, e.g. a single
value live across several disjoint segments:

  [a, b)  [c, d)  ........gap........  [e, f)

with gaps where the slot is dead. The interference check previously only
considered the covered segments, so it could pick a PhysReg that is free
within them but busy inside a gap. Unspilling replaces the slot with a vreg
whose recomputed interval is continuous over [a, f) (it fills the gaps),
so assigning that PhysReg could overlap the value live in the gap and trip
the "Overlapping insert" assertion in LiveRegMatrix::assign. Checking
interference over the whole [a, f) hull avoids this.

Assisted-by: Cursor/Claude Opus



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