From 39486753d5c69d98d510c9ed43c92f076ec4c602 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Sat, 30 Jan 2021 17:56:51 +0000 Subject: [PATCH] [ConstraintElimination] Verify CS and DFSInStack are in sync.(NFC) 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp b/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp index 3b8af6f21ce5..a3f739fd5c34 100644 --- a/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp +++ b/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp @@ -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; }