[llvm] [AMDGPU] Fixed verifier crash because of multiple live range components. (PR #190719)

Dhruva Chakrabarti via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 8 11:33:46 PDT 2026


================
@@ -548,7 +548,24 @@ void AMDGPURewriteAGPRCopyMFMAImpl::eliminateSpillsOfReassignedVGPRs() const {
       // replacement vreg uses.
       LiveInterval &NewLI = LIS.createAndComputeVirtRegInterval(NewVReg);
       VRM.grow();
+
+      // A spill slot can be stored to multiple times, so the replacement
+      // vreg may have multiple disconnected live range components. Split
+      // them into separate vregs to maintain the single-component invariant.
+      SmallVector<LiveInterval *, 4> SplitLIs;
+      LIS.splitSeparateComponents(NewLI, SplitLIs);
+
+      LLVM_DEBUG(if (!SplitLIs.empty()) {
+        dbgs() << "Split unspilled interval into " << (SplitLIs.size() + 1)
----------------
dhruvachak wrote:

> Though actually this seems like an unnecessary print; nowhere else using splitSeparateComponents does this

I added the print so that I could FileCheck it.

https://github.com/llvm/llvm-project/pull/190719


More information about the llvm-commits mailing list