llvm.org GIT mirror llvm / da4ae4b
Stabilize the order of live intervals in the priority_queue used by the linear scan reg alloc. This fixes a problem I ran into where extracting a function from a larger file caused the generated code to change (masking the problem I was trying to debug) because the allocator behaved differently. This changes the results for two X86 regression checks. stack-color-with-reg is improved, with one less instruction, but pr3495 is worse, with one more copy. As far as I can tell, these tests were just getting lucky or unlucky, so I've changed the expected results. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81060 91177308-0d34-0410-b5e6-96231b3b80d8 Bob Wilson 11 years ago
3 changed file(s) with 8 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
773773 void ComputeJoinedWeight(const LiveInterval &Other);
774774
775775 bool operator<(const LiveInterval& other) const {
776 return beginIndex() < other.beginIndex();
776 const MachineInstrIndex &thisIndex = beginIndex();
777 const MachineInstrIndex &otherIndex = other.beginIndex();
778 return (thisIndex < otherIndex ||
779 (thisIndex == otherIndex && reg < other.reg));
777780 }
778781
779782 void print(raw_ostream &OS, const TargetRegisterInfo *TRI = 0) const;
None ; RUN: llvm-as < %s | llc -march=x86 -stats |& grep {Number of reloads omited} | grep 2
1 ; RUN: llvm-as < %s | llc -march=x86 -stats |& not grep {Number of available reloads turned into copies}
2 ; RUN: llvm-as < %s | llc -march=x86 -stats |& grep {Number of machine instrs printed} | grep 39
0 ; RUN: llvm-as < %s | llc -march=x86 -stats |& grep {Number of reloads omited} | grep 1
1 ; RUN: llvm-as < %s | llc -march=x86 -stats |& grep {Number of available reloads turned into copies} | grep 1
2 ; RUN: llvm-as < %s | llc -march=x86 -stats |& grep {Number of machine instrs printed} | grep 40
33 ; PR3495
44 ; The loop reversal kicks in once here, resulting in one fewer instruction.
55
0 ; 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
11 ; RUN: grep stackcoloring %t | grep "loads eliminated"
22 ; RUN: grep stackcoloring %t | grep "stack slot refs replaced with reg refs" | grep 5
3 ; RUN: grep asm-printer %t | grep 182
3 ; RUN: grep asm-printer %t | grep 181
44
55 type { [62 x %struct.Bitvec*] } ; type %0
66 type { i8* } ; type %1