diff options
| -rw-r--r-- | llvm/lib/CodeGen/StackColoring.cpp | 4 | 
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/StackColoring.cpp b/llvm/lib/CodeGen/StackColoring.cpp index 1cbee843a12..e306a2f2c20 100644 --- a/llvm/lib/CodeGen/StackColoring.cpp +++ b/llvm/lib/CodeGen/StackColoring.cpp @@ -720,7 +720,9 @@ bool StackColoring::runOnMachineFunction(MachineFunction &Func) {    // and continue.    // Sort the slots according to their size. Place unused slots at the end. -  std::sort(SortedSlots.begin(), SortedSlots.end(), SlotSizeSorter(MFI)); +  // Use stable sort to guarantee deterministic code generation. +  std::stable_sort(SortedSlots.begin(), SortedSlots.end(), +                   SlotSizeSorter(MFI));    bool Chanded = true;    while (Chanded) {  | 

