[PATCH] D94328: [SLP] put verifyFunction call behind EXPENSIVE_CHECKS

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 8 11:30:38 PST 2021


spatel created this revision.
spatel added reviewers: rnk, lebedev.ri, nikic, dyung.
Herald added subscribers: hiraditya, mcrosier.
spatel requested review of this revision.
Herald added a project: LLVM.

A severe compile-time slowdown from this call is noted in: 
https://llvm.org/PR48689
My naive fix was to put it under `LLVM_DEBUG` ( 267ff79 <https://reviews.llvm.org/rG267ff7901c745dc903d55599240464ebc4c0bda3> ), but that's not limiting in the way we want.
IIUC, this is an acceptable quick fix (or we could just remove the call completely and rely on some later pass to discover potentially wrong IR?).
A bigger/better fix would be to improve/limit verifyFunction() as noted in:
https://llvm.org/PR47712


https://reviews.llvm.org/D94328

Files:
  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp


Index: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
===================================================================
--- llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -2499,7 +2499,11 @@
            "trying to erase instruction with users.");
     Pair.getFirst()->eraseFromParent();
   }
-  LLVM_DEBUG(verifyFunction(*F));
+#ifdef EXPENSIVE_CHECKS
+  // If we could guarantee that this call is not extremely slow, we could
+  // remove the ifdef limitation (see PR47712).
+  assert(!verifyFunction(*F, %dbgs()));
+#endif
 }
 
 void BoUpSLP::eraseInstructions(ArrayRef<Value *> AV) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94328.315462.patch
Type: text/x-patch
Size: 647 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210108/cd7cd4db/attachment.bin>


More information about the llvm-commits mailing list