[llvm-commits] [llvm] r54939 - /llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
Owen Anderson
resistor at mac.com
Mon Aug 18 12:52:22 PDT 2008
Author: resistor
Date: Mon Aug 18 14:52:22 2008
New Revision: 54939
URL: http://llvm.org/viewvc/llvm-project?rev=54939&view=rev
Log:
Clients of addIntervalForSpills expect the added intervals to be returned sorted by starting index.
Modified:
llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=54939&r1=54938&r2=54939&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Mon Aug 18 14:52:22 2008
@@ -1596,6 +1596,13 @@
}
}
+namespace {
+ struct LISorter {
+ bool operator()(LiveInterval* A, LiveInterval* B) {
+ return A->beginNumber() < B->beginNumber();
+ }
+ };
+}
std::vector<LiveInterval*> LiveIntervals::
addIntervalsForSpillsFast(const LiveInterval &li,
@@ -1677,6 +1684,8 @@
SSWeight = HUGE_VALF;
+ std::sort(added.begin(), added.end(), LISorter());
+
return added;
}
More information about the llvm-commits
mailing list