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 | 1cf81693af5626bbe196955fff612141a7c0115c (patch) | |
tree | e2c721987a4f3c4f39d50f1deb1437f352c5e096 /lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | d5ef7087a599e4e1d0fc4308ccdcc781fce3c6f1 (diff) | |
download | external_llvm-1cf81693af5626bbe196955fff612141a7c0115c.zip external_llvm-1cf81693af5626bbe196955fff612141a7c0115c.tar.gz external_llvm-1cf81693af5626bbe196955fff612141a7c0115c.tar.bz2 |
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 b70d610..8781c2b 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; } |