Don't call dominates on unreachable instructions.
authorRafael Espindola <rafael.espindola@gmail.com>
Sun, 26 Feb 2012 02:14:25 +0000 (02:14 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Sun, 26 Feb 2012 02:14:25 +0000 (02:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151468 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Verifier.cpp

index fbd43d4e775c78100b590393509d83550cf240fc..16a57537dcac11bd189d11b1e48560365338de96 100644 (file)
@@ -1648,8 +1648,8 @@ void Verifier::visitInstruction(Instruction &I) {
         }
 
         // Definition must dominate use unless use is unreachable!
-        Assert2(InstsInThisBlock.count(Op) || DT->dominates(Op, &I) ||
-                !DT->isReachableFromEntry(BB),
+        Assert2(InstsInThisBlock.count(Op) || !DT->isReachableFromEntry(BB)
+                || DT->dominates(Op, &I),
                 "Instruction does not dominate all uses!", Op, &I);
       }
     } else if (isa<InlineAsm>(I.getOperand(i))) {