[ConstraintElimination] Verify CS and DFSInStack are in sync.(NFC)
authorFlorian Hahn <flo@fhahn.com>
Sat, 30 Jan 2021 17:56:51 +0000 (17:56 +0000)
committerFlorian Hahn <flo@fhahn.com>
Sat, 30 Jan 2021 18:27:04 +0000 (18:27 +0000)
After the main loop is done, we should have one constraint per item in
DFSInStack. Otherwise we added a constraint without a proper DFSInStack
item.

llvm/lib/Transforms/Scalar/ConstraintElimination.cpp

index 3b8af6f..a3f739f 100644 (file)
@@ -352,6 +352,8 @@ static bool eliminateConstraints(Function &F, DominatorTree &DT) {
       DFSInStack.emplace_back(CB.NumIn, CB.NumOut, CB.Condition, CB.Not);
   }
 
+  assert(CS.size() == DFSInStack.size() &&
+         "updates to CS and DFSInStack are out of sync");
   return Changed;
 }