Improvement to the previous fix: branch following a delay slot of
authorVikram S. Adve <vadve@cs.uiuc.edu>
Thu, 14 Aug 2003 20:45:56 +0000 (20:45 +0000)
committerVikram S. Adve <vadve@cs.uiuc.edu>
Thu, 14 Aug 2003 20:45:56 +0000 (20:45 +0000)
another delayed instr. would cause the later sanity-check (assertion)
in PhyRegAlloc.cpp to fail, even though there is really no error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7848 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
lib/Target/SparcV9/LiveVar/FunctionLiveVarInfo.cpp

index 8cde6e1de7a096cdc5fbcb89625ed8f100039c57..764ec36f37faea3a07bcc129a2c696bb9515585d 100644 (file)
@@ -290,9 +290,11 @@ void FunctionLiveVarInfo::calcLiveVarSetsForBB(const BasicBlock *BB) {
       for (unsigned i = 0; i < DS; ++i, ++fwdMII) {
         assert(fwdMII != MIVec.end() && "Missing instruction in delay slot?");
         MachineInstr* DelaySlotMI = *fwdMII;
-        set_union(*MInst2LVSetBI[DelaySlotMI], *NewSet);
-        if (i+1 == DS)
-          set_union(*MInst2LVSetAI[DelaySlotMI], *NewSet);
+        if (! TM.getInstrInfo().isNop(DelaySlotMI->getOpCode())) {
+          set_union(*MInst2LVSetBI[DelaySlotMI], *NewSet);
+          if (i+1 == DS)
+            set_union(*MInst2LVSetAI[DelaySlotMI], *NewSet);
+        }
       }
     }
 
index 8cde6e1de7a096cdc5fbcb89625ed8f100039c57..764ec36f37faea3a07bcc129a2c696bb9515585d 100644 (file)
@@ -290,9 +290,11 @@ void FunctionLiveVarInfo::calcLiveVarSetsForBB(const BasicBlock *BB) {
       for (unsigned i = 0; i < DS; ++i, ++fwdMII) {
         assert(fwdMII != MIVec.end() && "Missing instruction in delay slot?");
         MachineInstr* DelaySlotMI = *fwdMII;
-        set_union(*MInst2LVSetBI[DelaySlotMI], *NewSet);
-        if (i+1 == DS)
-          set_union(*MInst2LVSetAI[DelaySlotMI], *NewSet);
+        if (! TM.getInstrInfo().isNop(DelaySlotMI->getOpCode())) {
+          set_union(*MInst2LVSetBI[DelaySlotMI], *NewSet);
+          if (i+1 == DS)
+            set_union(*MInst2LVSetAI[DelaySlotMI], *NewSet);
+        }
       }
     }