[llvm-commits] [llvm] r128888 - in /llvm/trunk: lib/CodeGen/MachineInstr.cpp test/CodeGen/X86/coalescer-cross.ll
Jakob Stoklund Olesen
stoklund at 2pi.dk
Tue Apr 5 09:53:50 PDT 2011
Author: stoklund
Date: Tue Apr 5 11:53:50 2011
New Revision: 128888
URL: http://llvm.org/viewvc/llvm-project?rev=128888&view=rev
Log:
Ensure all defs referring to a virtual register are marked dead by addRegisterDead().
There can be multiple defs for a single virtual register when they are defining
sub-registers.
The missing <dead> flag was stopping the inline spiller from eliminating dead
code after rematerialization.
Modified:
llvm/trunk/lib/CodeGen/MachineInstr.cpp
llvm/trunk/test/CodeGen/X86/coalescer-cross.ll
Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=128888&r1=128887&r2=128888&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Tue Apr 5 11:53:50 2011
@@ -1543,13 +1543,8 @@
continue;
if (Reg == IncomingReg) {
- if (!Found) {
- if (MO.isDead())
- // The register is already marked dead.
- return true;
- MO.setIsDead();
- Found = true;
- }
+ MO.setIsDead();
+ Found = true;
} else if (hasAliases && MO.isDead() &&
TargetRegisterInfo::isPhysicalRegister(Reg)) {
// There exists a super-register that's marked dead.
Modified: llvm/trunk/test/CodeGen/X86/coalescer-cross.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/coalescer-cross.ll?rev=128888&r1=128887&r2=128888&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/coalescer-cross.ll (original)
+++ llvm/trunk/test/CodeGen/X86/coalescer-cross.ll Tue Apr 5 11:53:50 2011
@@ -1,6 +1,10 @@
-; RUN: llc < %s -mtriple=i386-apple-darwin10 | not grep movaps
+; RUN: llc < %s -mtriple=i386-apple-darwin10 | FileCheck %s
+; RUN: llc < %s -mtriple=i386-apple-darwin10 -regalloc=basic | FileCheck %s
; rdar://6509240
+; CHECK: os_clock
+; CHECK-NOT: movaps
+
type { %struct.TValue } ; type %0
type { %struct.L_Umaxalign, i32, %struct.Node* } ; type %1
%struct.CallInfo = type { %struct.TValue*, %struct.TValue*, %struct.TValue*, i32*, i32, i32 }
More information about the llvm-commits
mailing list