[PATCH] D47498: [VPlan] Replace LLVM_ATTRIBUTE_USED with ifndef NDEBUG

Diego Caballero via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 29 14:56:54 PDT 2018


dcaballe created this revision.
dcaballe added reviewers: dblaikie, fhahn, hsaito.
Herald added subscribers: llvm-commits, rkruppe, tschuett, bollu.

Minor replacement. LLVM_ATTRIBUTE_USED was introduced to silence a warning but using #ifndef NDEBUG makes more sense in this case.


Repository:
  rL LLVM

https://reviews.llvm.org/D47498

Files:
  lib/Transforms/Vectorize/VPlanVerifier.cpp


Index: lib/Transforms/Vectorize/VPlanVerifier.cpp
===================================================================
--- lib/Transforms/Vectorize/VPlanVerifier.cpp
+++ lib/Transforms/Vectorize/VPlanVerifier.cpp
@@ -24,18 +24,19 @@
                                         cl::Hidden,
                                         cl::desc("Verify VPlan H-CFG."));
 
+#ifndef NDEBUG
 /// Utility function that checks whether \p VPBlockVec has duplicate
 /// VPBlockBases.
-LLVM_ATTRIBUTE_USED static bool
-hasDuplicates(const SmallVectorImpl<VPBlockBase *> &VPBlockVec) {
+static bool hasDuplicates(const SmallVectorImpl<VPBlockBase *> &VPBlockVec) {
   SmallDenseSet<const VPBlockBase *, 8> VPBlockSet;
   for (const auto *Block : VPBlockVec) {
     if (VPBlockSet.count(Block))
       return true;
     VPBlockSet.insert(Block);
   }
   return false;
 }
+#endif
 
 /// Helper function that verifies the CFG invariants of the VPBlockBases within
 /// \p Region. Checks in this function are generic for VPBlockBases. They are


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47498.148987.patch
Type: text/x-patch
Size: 1021 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180529/e70818e5/attachment.bin>


More information about the llvm-commits mailing list