[PATCH] D94576: [LoopVectorize] Guard verifyFunction with EXPENSIVE_CHECKS macro
Tarique Islam via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 12 18:36:05 PST 2021
tislam created this revision.
Herald added a subscriber: hiraditya.
tislam requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
We have found that the calls to `verifyFunction` can take up to 66% of the time spent in `llvm::LoopVectorizePass::processLoop`. For some source files, `verifyFunction` took around 10% of the total compile time.
This patch guards the calls to `verifyFunction` with the `EXPENSIVE_CHECKS` macro.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D94576
Files:
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Index: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
===================================================================
--- llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -9100,7 +9100,10 @@
// Mark the loop as already vectorized to avoid vectorizing again.
Hints.setAlreadyVectorized();
+#ifdef EXPENSIVE_CHECKS
assert(!verifyFunction(*L->getHeader()->getParent(), &dbgs()));
+#endif
+
return true;
}
@@ -9437,7 +9440,10 @@
Hints.setAlreadyVectorized();
}
+#ifdef EXPENSIVE_CHECKS
assert(!verifyFunction(*L->getHeader()->getParent(), &dbgs()));
+#endif
+
return true;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94576.316294.patch
Type: text/x-patch
Size: 666 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210113/ac440632/attachment.bin>
More information about the llvm-commits
mailing list