[PATCH] D109198: [Coroutines] Only run verifyFunction in debug mode

Xun Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 2 14:34:38 PDT 2021


lxfind created this revision.
lxfind added a reviewer: ChuanqiXu.
Herald added subscribers: hoy, modimo, wenlei, hiraditya.
lxfind requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109198

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


Index: llvm/lib/Transforms/Coroutines/CoroSplit.cpp
===================================================================
--- llvm/lib/Transforms/Coroutines/CoroSplit.cpp
+++ llvm/lib/Transforms/Coroutines/CoroSplit.cpp
@@ -1142,11 +1142,13 @@
 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109198.370415.patch
Type: text/x-patch
Size: 719 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210902/f7eae1d3/attachment.bin>


More information about the llvm-commits mailing list