Index: llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp =================================================================== --- llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp +++ llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp @@ -1100,6 +1100,10 @@ return true; } + // Do not attempt to relax schedule even more if we are already spilling. + if (isRegionWithExcessRP()) + return false; + LLVM_DEBUG( dbgs() << "\n\t *** In shouldRevertScheduling ***\n"