[llvm] 2cf30c4 - [Coroutines] Only run verifyFunction in debug mode

Xun Li via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 2 17:35:05 PDT 2021


Author: Xun Li
Date: 2021-09-02T17:35:01-07:00
New Revision: 2cf30c4769a5423fa6a2d726df182aaa29e3c966

URL: https://github.com/llvm/llvm-project/commit/2cf30c4769a5423fa6a2d726df182aaa29e3c966
DIFF: https://github.com/llvm/llvm-project/commit/2cf30c4769a5423fa6a2d726df182aaa29e3c966.diff

LOG: [Coroutines] Only run verifyFunction in debug mode

verifyFunction can be really slow on large functions. This can significantly slow down compilation in production.
Given that coroutine passes are fairly stable now, we should only run it in debug mode.

Differential Revision: https://reviews.llvm.org/D109198

Added: 
    

Modified: 
    llvm/lib/Transforms/Coroutines/CoroSplit.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
index 4a4e8b874385..0d03d1dbc22c 100644
--- a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
+++ b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
@@ -1142,11 +1142,13 @@ static void updateCoroFrame(coro::Shape &Shape, Function *ResumeFn,
 static void postSplitCleanup(Function &F) {
   removeUnreachableBlocks(F);
 
+#ifndef NDEBUG
   // For now, we do a mandatory verification step because we don't
   // entirely trust this pass.  Note that we don't want to add a verifier
   // pass to FPM below because it will also verify all the global data.
   if (verifyFunction(F, &errs()))
     report_fatal_error("Broken function");
+#endif
 }
 
 // Assuming we arrived at the block NewBlock from Prev instruction, store


        


More information about the llvm-commits mailing list