[all-commits] [llvm/llvm-project] 8face3: [RegAlloc][LiveRegMatrix] Fix inconsistency when f...

Dhruva Chakrabarti via All-commits all-commits at lists.llvm.org
Thu May 28 12:51:01 PDT 2026


  Branch: refs/heads/users/dhruvachak/fold_lrm_fix
  Home:   https://github.com/llvm/llvm-project
  Commit: 8face3a85357434f27ad7d557e9de4c5b3b4f950
      https://github.com/llvm/llvm-project/commit/8face3a85357434f27ad7d557e9de4c5b3b4f950
  Author: Dhruva Chakrabarti <Dhruva.Chakrabarti at amd.com>
  Date:   2026-05-28 (Thu, 28 May 2026)

  Changed paths:
    M llvm/lib/CodeGen/InlineSpiller.cpp
    M llvm/lib/CodeGen/LiveRangeEdit.cpp

  Log Message:
  -----------
  [RegAlloc][LiveRegMatrix] Fix inconsistency when fold creates a CopyMI

When TargetInstrInfo::foldMemoryOperand produces a side-effect CopyMI,
the copy destination vreg's LiveInterval is extended via addSegment.
If that vreg is already assigned in LiveRegMatrix, the matrix becomes
inconsistent because it still holds the old (smaller) interval.

Fix this in two places:

- InlineSpiller::foldMemoryOperand: unassign the vreg from the matrix
  before addSegment, reassign after, so the matrix reflects the updated
  interval.

- LiveRangeEdit::foldAsLoad: notify the delegate via
  LRE_WillShrinkVirtReg before addSegment.

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