[llvm-commits] [llvm] r161075 - /llvm/trunk/lib/CodeGen/MachineSink.cpp
Manman Ren
mren at apple.com
Tue Jul 31 13:45:38 PDT 2012
Author: mren
Date: Tue Jul 31 15:45:38 2012
New Revision: 161075
URL: http://llvm.org/viewvc/llvm-project?rev=161075&view=rev
Log:
MachineSink: Sort the successors before trying to find SuccToSinkTo.
Use stable_sort instead of sort. Follow-up to r161062.
rdar://11980766
Modified:
llvm/trunk/lib/CodeGen/MachineSink.cpp
Modified: llvm/trunk/lib/CodeGen/MachineSink.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineSink.cpp?rev=161075&r1=161074&r2=161075&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineSink.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineSink.cpp Tue Jul 31 15:45:38 2012
@@ -538,7 +538,7 @@
// we should sink to.
// We give successors with smaller loop depth higher priority.
SmallVector<MachineBasicBlock*, 4> Succs(MBB->succ_begin(), MBB->succ_end());
- std::sort(Succs.begin(), Succs.end(), SuccessorSorter(LI));
+ std::stable_sort(Succs.begin(), Succs.end(), SuccessorSorter(LI));
for (SmallVector<MachineBasicBlock*, 4>::iterator SI = Succs.begin(),
E = Succs.end(); SI != E; ++SI) {
MachineBasicBlock *SuccBlock = *SI;
More information about the llvm-commits
mailing list