https://github.com/cdevadas commented: The new test llvm/test/CodeGen/AMDGPU/stack-slot-color-after-sgpr-regalloc.mir needs to be written precisely to show the stack indices being shared. See my previous comments. https://github.com/llvm/llvm-project/pull/93668