[llvm-branch-commits] [llvm-branch] r88691 - in /llvm/branches/Apple/Leela: lib/CodeGen/LiveVariables.cpp test/CodeGen/ARM/2009-11-13-CoalescerCrash.ll

Evan Cheng evan.cheng at apple.com
Fri Nov 13 12:48:53 PST 2009


Author: evancheng
Date: Fri Nov 13 14:48:52 2009
New Revision: 88691

URL: http://llvm.org/viewvc/llvm-project?rev=88691&view=rev
Log:
Merge 88690.

Added:
    llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-11-13-CoalescerCrash.ll
Modified:
    llvm/branches/Apple/Leela/lib/CodeGen/LiveVariables.cpp

Modified: llvm/branches/Apple/Leela/lib/CodeGen/LiveVariables.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Leela/lib/CodeGen/LiveVariables.cpp?rev=88691&r1=88690&r2=88691&view=diff

==============================================================================
--- llvm/branches/Apple/Leela/lib/CodeGen/LiveVariables.cpp (original)
+++ llvm/branches/Apple/Leela/lib/CodeGen/LiveVariables.cpp Fri Nov 13 14:48:52 2009
@@ -222,8 +222,9 @@
 /// implicit defs to a machine instruction if there was an earlier def of its
 /// super-register.
 void LiveVariables::HandlePhysRegUse(unsigned Reg, MachineInstr *MI) {
+  MachineInstr *LastDef = PhysRegDef[Reg];
   // If there was a previous use or a "full" def all is well.
-  if (!PhysRegDef[Reg] && !PhysRegUse[Reg]) {
+  if (!LastDef && !PhysRegUse[Reg]) {
     // Otherwise, the last sub-register def implicitly defines this register.
     // e.g.
     // AH =
@@ -257,6 +258,11 @@
       }
     }
   }
+  else if (LastDef && !PhysRegUse[Reg] &&
+           !LastDef->findRegisterDefOperand(Reg))
+    // Last def defines the super register, add an implicit def of reg.
+    LastDef->addOperand(MachineOperand::CreateReg(Reg,
+                                                 true/*IsDef*/, true/*IsImp*/));
 
   // Remember this use.
   PhysRegUse[Reg]  = MI;

Added: llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-11-13-CoalescerCrash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-11-13-CoalescerCrash.ll?rev=88691&view=auto

==============================================================================
--- llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-11-13-CoalescerCrash.ll (added)
+++ llvm/branches/Apple/Leela/test/CodeGen/ARM/2009-11-13-CoalescerCrash.ll Fri Nov 13 14:48:52 2009
@@ -0,0 +1,20 @@
+; RUN: llc -mtriple=armv7-eabi -mcpu=cortex-a8 < %s
+; PR5410
+
+%0 = type { float, float, float, float }
+%pln = type { %vec, float }
+%vec = type { [4 x float] }
+
+define arm_aapcs_vfpcc float @aaa(%vec* nocapture %ustart, %vec* nocapture %udir, %vec* nocapture %vstart, %vec* nocapture %vdir, %vec* %upoint, %vec* %vpoint) {
+entry:
+  br i1 undef, label %bb81, label %bb48
+
+bb48:                                             ; preds = %entry
+  %0 = call arm_aapcs_vfpcc  %0 @bbb(%pln* undef, %vec* %vstart, %vec* undef) nounwind ; <%0> [#uses=0]
+  ret float 0.000000e+00
+
+bb81:                                             ; preds = %entry
+  ret float 0.000000e+00
+}
+
+declare arm_aapcs_vfpcc %0 @bbb(%pln* nocapture, %vec* nocapture, %vec* nocapture) nounwind





More information about the llvm-branch-commits mailing list