We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
AMDGPURewriteAGPRCopyMFMAImpl::eliminateSpillsOfReassignedVGPRs()
1 parent 6308cd8 commit 497d648Copy full SHA for 497d648
llvm/lib/Target/AMDGPU/AMDGPURewriteAGPRCopyMFMA.cpp
@@ -482,12 +482,13 @@ void AMDGPURewriteAGPRCopyMFMAImpl::eliminateSpillsOfReassignedVGPRs() const {
482
}
483
484
sort(StackIntervals, [](const LiveInterval *A, const LiveInterval *B) {
485
+ // The ordering has to be strictly weak.
486
/// Sort heaviest intervals first to prioritize their unspilling
- if (A->weight() > B->weight())
487
- return true;
+ if (A->weight() != B->weight())
488
+ return A->weight() > B->weight();
489
- if (A->getSize() > B->getSize())
490
+ if (A->getSize() != B->getSize())
491
+ return A->getSize() > B->getSize();
492
493
// Tie breaker by number to avoid need for stable sort
494
return A->reg().stackSlotIndex() < B->reg().stackSlotIndex();
0 commit comments