[all-commits] [llvm/llvm-project] 6519c0: [1/3][RegAlloc][LiveRegMatrix] Fix inconsistency i...
Dhruva Chakrabarti via All-commits
all-commits at lists.llvm.org
Tue May 26 13:04:38 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 6519c04eb459deab1c71756ddfc04fd7ee852904
https://github.com/llvm/llvm-project/commit/6519c04eb459deab1c71756ddfc04fd7ee852904
Author: Dhruva Chakrabarti <Dhruva.Chakrabarti at amd.com>
Date: 2026-05-26 (Tue, 26 May 2026)
Changed paths:
M llvm/lib/CodeGen/InlineSpiller.cpp
Log Message:
-----------
[1/3][RegAlloc][LiveRegMatrix] Fix inconsistency in HoistSpillHelper delegates (#197773)
HoistSpillHelper's LiveRangeEdit delegate callbacks did not keep the
LiveRegMatrix consistent when eliminateDeadDefs triggered interval
shrinking and splitting during spill hoisting.
Three issues:
1. No LRE_WillShrinkVirtReg override: when eliminateDeadDefs shrinks a
vreg's interval via shrinkToUses, the matrix was not updated. Add an
override that unassigns the vreg from the matrix and records it in
PendingReassignments for later re-assignment.
2. LRE_DidCloneVirtReg called VRM.assignVirt2Phys without
Matrix->assign: when splitSeparateComponents creates new vregs, the
clones got VRM entries but were never inserted into the matrix. Fix by
consuming PendingReassignments and properly assigning both Old (shrunk)
and New (split) intervals to the matrix.
3. No flush for shrink-without-split: if a vreg was shrunk but not
split, LRE_DidCloneVirtReg was never called to re-assign it. Add a flush
loop at the end of hoistAllSpills to re-assign any remaining pending
vregs.
Also update LRE_CanEraseVirtReg to clear pending entries for erased
vregs.
LIT tests exercised by this patch (i.e. if I introduce consistency
verification as in https://github.com/llvm/llvm-project/pull/197778 but
not this patch, the following tests fail):
CodeGen/X86/AMX/amx-gemm.ll
CodeGen/X86/apx/push2-pop2.ll
CodeGen/X86/udivmodei5.ll
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