[llvm] 3948675 - [ConstraintElimination] Verify CS and DFSInStack are in sync.(NFC)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 30 10:29:09 PST 2021


Author: Florian Hahn
Date: 2021-01-30T18:27:04Z
New Revision: 39486753d5c69d98d510c9ed43c92f076ec4c602

URL: https://github.com/llvm/llvm-project/commit/39486753d5c69d98d510c9ed43c92f076ec4c602
DIFF: https://github.com/llvm/llvm-project/commit/39486753d5c69d98d510c9ed43c92f076ec4c602.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/ConstraintElimination.cpp

Removed: 
    


################################################################################
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;
 }
 


        


More information about the llvm-commits mailing list