diff options
author | Owen Anderson <resistor@mac.com> | 2008-08-18 19:52:22 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-08-18 19:52:22 +0000 |
commit | 133f10f9bddc857d86fab89cfe5573f2515ae7cf (patch) | |
tree | e2c721987a4f3c4f39d50f1deb1437f352c5e096 /lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | d7cbd1574f1fa04a19d4fc3c82d78cf2f1e7c309 (diff) |
Clients of addIntervalForSpills expect the added intervals to be returned sorted by starting index.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54939 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index b70d610d55..8781c2b790 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -1596,6 +1596,13 @@ LiveIntervals::handleSpilledImpDefs(const LiveInterval &li, VirtRegMap &vrm, } } +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 @@ addIntervalsForSpillsFast(const LiveInterval &li, SSWeight = HUGE_VALF; + std::sort(added.begin(), added.end(), LISorter()); + return added; } |