[llvm] [CVP] Check whether the default case is reachable (PR #79993)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 30 07:28:24 PST 2024


================
@@ -1227,6 +1257,7 @@ CorrelatedValuePropagationPass::run(Function &F, FunctionAnalysisManager &AM) {
   if (!Changed) {
     PA = PreservedAnalyses::all();
   } else {
+    assert(DT->verify());
----------------
dtcxzyw wrote:

Isn't it guarded by the `NDEBUG` marco?

Should I use the fast-path if `LLVM_ENABLE_EXPENSIVE_CHECKS` is OFF?
```
#if defined(EXPENSIVE_CHECKS)
  assert(DT.verify(DominatorTree::VerificationLevel::Full));
#else
  assert(DT.verify(DominatorTree::VerificationLevel::Fast));
#endif // EXPENSIVE_CHECKS
```


https://github.com/llvm/llvm-project/pull/79993


More information about the llvm-commits mailing list