[llvm-commits] [llvm] r113614 - in /llvm/trunk/lib/CodeGen: RegAllocFast.cpp SelectionDAG/FastISel.cpp

Devang Patel dpatel at apple.com
Fri Sep 10 13:32:09 PDT 2010


Author: dpatel
Date: Fri Sep 10 15:32:09 2010
New Revision: 113614

URL: http://llvm.org/viewvc/llvm-project?rev=113614&view=rev
Log:
Add DEBUG message.

Modified:
    llvm/trunk/lib/CodeGen/RegAllocFast.cpp
    llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp

Modified: llvm/trunk/lib/CodeGen/RegAllocFast.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocFast.cpp?rev=113614&r1=113613&r2=113614&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocFast.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocFast.cpp Fri Sep 10 15:32:09 2010
@@ -798,9 +798,11 @@
             setPhysReg(MI, i, LRI->second.PhysReg);
           else {
             int SS = StackSlotForVirtReg[Reg];
-            if (SS == -1)
+            if (SS == -1) {
               // We can't allocate a physreg for a DebugValue, sorry!
+              DEBUG(dbgs() << "Unable to allocate vreg used by DBG_VALUE");
               MO.setReg(0);
+            }
             else {
               // Modify DBG_VALUE now that the value is in a spill slot.
               int64_t Offset = MI->getOperand(1).getImm();
@@ -817,9 +819,11 @@
                 MI = NewDV;
                 ScanDbgValue = true;
                 break;
-              } else
+              } else {
                 // We can't allocate a physreg for a DebugValue; sorry!
+                DEBUG(dbgs() << "Unable to allocate vreg used by DBG_VALUE");
                 MO.setReg(0);
+              }
             }
           }
         }

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=113614&r1=113613&r2=113614&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Fri Sep 10 15:32:09 2010
@@ -473,10 +473,18 @@
       return true;
     const AllocaInst *AI = dyn_cast<AllocaInst>(Address);
     // Don't handle byval struct arguments or VLAs, for example.
-    if (!AI)
+    if (!AI) {
       // Building the map above is target independent.  Generating DBG_VALUE
       // inline is target dependent; do this now.
-      (void)TargetSelectInstruction(cast<Instruction>(I));
+      DenseMap<const Value *, unsigned>::iterator It =
+        FuncInfo.ValueMap.find(Address);
+      if (0 && It != FuncInfo.ValueMap.end()) {
+        BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, 
+                TII.get(TargetOpcode::DBG_VALUE))
+               .addReg(It->second, RegState::Debug).addImm(0).addMetadata(DI->getVariable());
+      } else
+        (void)TargetSelectInstruction(cast<Instruction>(I));
+    }
     return true;
   }
   case Intrinsic::dbg_value: {





More information about the llvm-commits mailing list