aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/llvm/CodeGen/LiveInterval.h5
-rw-r--r--test/CodeGen/X86/pr3495.ll6
-rw-r--r--test/CodeGen/X86/stack-color-with-reg.ll2
3 files changed, 8 insertions, 5 deletions
diff --git a/include/llvm/CodeGen/LiveInterval.h b/include/llvm/CodeGen/LiveInterval.h
index 921c557..2a8c2c8 100644
--- a/include/llvm/CodeGen/LiveInterval.h
+++ b/include/llvm/CodeGen/LiveInterval.h
@@ -774,7 +774,10 @@ namespace llvm {
void ComputeJoinedWeight(const LiveInterval &Other);
bool operator<(const LiveInterval& other) const {
- return beginIndex() < other.beginIndex();
+ const MachineInstrIndex &thisIndex = beginIndex();
+ const MachineInstrIndex &otherIndex = other.beginIndex();
+ return (thisIndex < otherIndex ||
+ (thisIndex == otherIndex && reg < other.reg));
}
void print(raw_ostream &OS, const TargetRegisterInfo *TRI = 0) const;
diff --git a/test/CodeGen/X86/pr3495.ll b/test/CodeGen/X86/pr3495.ll
index ca6204c..368c38c 100644
--- a/test/CodeGen/X86/pr3495.ll
+++ b/test/CodeGen/X86/pr3495.ll
@@ -1,6 +1,6 @@
-; RUN: llvm-as < %s | llc -march=x86 -stats |& grep {Number of reloads omited} | grep 2
-; RUN: llvm-as < %s | llc -march=x86 -stats |& not grep {Number of available reloads turned into copies}
-; RUN: llvm-as < %s | llc -march=x86 -stats |& grep {Number of machine instrs printed} | grep 39
+; RUN: llvm-as < %s | llc -march=x86 -stats |& grep {Number of reloads omited} | grep 1
+; RUN: llvm-as < %s | llc -march=x86 -stats |& grep {Number of available reloads turned into copies} | grep 1
+; RUN: llvm-as < %s | llc -march=x86 -stats |& grep {Number of machine instrs printed} | grep 40
; PR3495
; The loop reversal kicks in once here, resulting in one fewer instruction.
diff --git a/test/CodeGen/X86/stack-color-with-reg.ll b/test/CodeGen/X86/stack-color-with-reg.ll
index 114e9bf..604bd4f 100644
--- a/test/CodeGen/X86/stack-color-with-reg.ll
+++ b/test/CodeGen/X86/stack-color-with-reg.ll
@@ -1,7 +1,7 @@
; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin10 -relocation-model=pic -disable-fp-elim -color-ss-with-regs -stats -info-output-file - > %t
; RUN: grep stackcoloring %t | grep "loads eliminated"
; RUN: grep stackcoloring %t | grep "stack slot refs replaced with reg refs" | grep 5
-; RUN: grep asm-printer %t | grep 182
+; RUN: grep asm-printer %t | grep 181
type { [62 x %struct.Bitvec*] } ; type %0
type { i8* } ; type %1