Skip DEBUG_VALUE in some places where it was affecting codegen.
authorDale Johannesen <dalej@apple.com>
Tue, 9 Feb 2010 02:01:46 +0000 (02:01 +0000)
committerDale Johannesen <dalej@apple.com>
Tue, 9 Feb 2010 02:01:46 +0000 (02:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95647 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CalcSpillWeights.cpp
lib/CodeGen/LiveVariables.cpp
lib/CodeGen/TwoAddressInstructionPass.cpp

index b8ef219bf9c1d4a222172038c324ee6f91c01f6a..7da833bbbf8f0b48b144e302151d29a0369e0204 100644 (file)
@@ -64,6 +64,9 @@ bool CalculateSpillWeights::runOnMachineFunction(MachineFunction &fn) {
       if (mi->getOpcode() == TargetInstrInfo::IMPLICIT_DEF)
         continue;
 
+      if (mi->getOpcode() == TargetInstrInfo::DEBUG_VALUE)
+        continue;
+
       for (unsigned i = 0, e = mi->getNumOperands(); i != e; ++i) {
         const MachineOperand &mopi = mi->getOperand(i);
         if (!mopi.isReg() || mopi.getReg() == 0)
index b44a2202e76497256d42cd8bf19880be7f30efbe..23ee8c3eda163a87d2d2d7b9f3d144ffa9e3b138 100644 (file)
@@ -543,6 +543,8 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &mf) {
     for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end();
          I != E; ++I) {
       MachineInstr *MI = I;
+      if (MI->getOpcode()==TargetInstrInfo::DEBUG_VALUE)
+        continue;
       DistanceMap.insert(std::make_pair(MI, Dist++));
 
       // Process all of the operands of the instruction...
index a3f6364aa8ed6350c2f31d44387a6d5de290fb96..71d9b83f7bf9bd89fb5f8be3a46a91f0e84b420c 100644 (file)
@@ -318,6 +318,8 @@ bool TwoAddressInstructionPass::NoUseAfterLastDef(unsigned Reg,
     MachineInstr *MI = MO.getParent();
     if (MI->getParent() != MBB)
       continue;
+    if (MI->getOpcode() == TargetInstrInfo::DEBUG_VALUE)
+      continue;
     DenseMap<MachineInstr*, unsigned>::iterator DI = DistanceMap.find(MI);
     if (DI == DistanceMap.end())
       continue;
@@ -341,6 +343,8 @@ MachineInstr *TwoAddressInstructionPass::FindLastUseInMBB(unsigned Reg,
     MachineInstr *MI = MO.getParent();
     if (MI->getParent() != MBB)
       continue;
+    if (MI->getOpcode() == TargetInstrInfo::DEBUG_VALUE)
+      continue;
     DenseMap<MachineInstr*, unsigned>::iterator DI = DistanceMap.find(MI);
     if (DI == DistanceMap.end())
       continue;