[llvm] 99bb789 - [VPlan] Fix gcc -Wparentheses warning

Mikael Holmen via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 6 06:04:14 PST 2025


Author: Mikael Holmen
Date: 2025-11-06T15:02:13+01:00
New Revision: 99bb7895fa8367eecee661ecc20932db00597461

URL: https://github.com/llvm/llvm-project/commit/99bb7895fa8367eecee661ecc20932db00597461
DIFF: https://github.com/llvm/llvm-project/commit/99bb7895fa8367eecee661ecc20932db00597461.diff

LOG: [VPlan] Fix gcc -Wparentheses warning

Wihtout this gcc complained with
 ../lib/Transforms/Vectorize/VPlan.h: In constructor 'llvm::VPWidenMemoryRecipe::VPWidenMemoryRecipe(unsigned char, llvm::Instruction&, std::initializer_list<llvm::VPValue*>, bool, bool, const llvm::VPIRMetadata&, llvm::DebugLoc)':
 ../lib/Transforms/Vectorize/VPlan.h:3216:21: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
  3216 |            !Reverse &&
       |            ~~~~~~~~~^~
  3217 |                "Reversed acccess without VPVectorEndPointerRecipe address?");
       |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/VPlan.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index bbb03fbdff7a2..3062e1ca26af5 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -3212,9 +3212,8 @@ class LLVM_ABI_FOR_TEST VPWidenMemoryRecipe : public VPRecipeBase,
         Alignment(getLoadStoreAlignment(&I)), Consecutive(Consecutive),
         Reverse(Reverse) {
     assert((Consecutive || !Reverse) && "Reverse implies consecutive");
-    assert(isa<VPVectorEndPointerRecipe>(getAddr()) ||
-           !Reverse &&
-               "Reversed acccess without VPVectorEndPointerRecipe address?");
+    assert((isa<VPVectorEndPointerRecipe>(getAddr()) || !Reverse) &&
+           "Reversed acccess without VPVectorEndPointerRecipe address?");
   }
 
 public:


        


More information about the llvm-commits mailing list