From: Owen Anderson Date: Mon, 18 Aug 2008 19:52:22 +0000 (+0000) Subject: Clients of addIntervalForSpills expect the added intervals to be returned sorted... X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=133f10f9bddc857d86fab89cfe5573f2515ae7cf;p=oota-llvm.git 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 --- diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index b70d610d55e..8781c2b7905 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 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; }