[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
This commit is contained in:
Xun Li 2021-09-02 17:35:01 -07:00
parent 054487c5b2
commit 2cf30c4769

View file

@ -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