diff options
| author | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2012-11-15 19:33:30 +0000 | 
|---|---|---|
| committer | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2012-11-15 19:33:30 +0000 | 
| commit | dcee8ce8ed4ee0aacb770334d727697e05f79452 (patch) | |
| tree | 12c9a8516a6617b4155aaad6faa7d658238b2305 /llvm/lib | |
| parent | 4921017afdac6ce9c4e0447f8dd66f1311f42721 (diff) | |
| download | bcm5719-llvm-dcee8ce8ed4ee0aacb770334d727697e05f79452.tar.gz bcm5719-llvm-dcee8ce8ed4ee0aacb770334d727697e05f79452.zip  | |
Use std::stable_sort instead of std::sort when sorting stack slots
to guarantee deterministic code generation.
llvm-svn: 168074
Diffstat (limited to 'llvm/lib')
| -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) {  | 

