[llvm] cb9cf33 - [SLP][NFC]Do not lookup in MinBWs, reuse previously used iterator.

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 2 06:08:36 PDT 2024


Author: Alexey Bataev
Date: 2024-04-02T05:53:34-07:00
New Revision: cb9cf331fa69bb8319886cdca043a742b4d19ce5

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

LOG: [SLP][NFC]Do not lookup in MinBWs, reuse previously used iterator.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 1ffc39a9067431..b1940e3feed958 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -12297,7 +12297,7 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E, bool PostponedPHIs) {
       Value *V = Builder.CreateBinOp(
           static_cast<Instruction::BinaryOps>(E->getOpcode()), LHS,
           RHS);
-      propagateIRFlags(V, E->Scalars, VL0, !MinBWs.contains(E));
+      propagateIRFlags(V, E->Scalars, VL0, It == MinBWs.end());
       if (auto *I = dyn_cast<Instruction>(V))
         V = propagateMetadata(I, E->Scalars);
 
@@ -12598,8 +12598,8 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E, bool PostponedPHIs) {
           },
           Mask, &OpScalars, &AltScalars);
 
-      propagateIRFlags(V0, OpScalars, E->getMainOp(), !MinBWs.contains(E));
-      propagateIRFlags(V1, AltScalars, E->getAltOp(), !MinBWs.contains(E));
+      propagateIRFlags(V0, OpScalars, E->getMainOp(), It == MinBWs.end());
+      propagateIRFlags(V1, AltScalars, E->getAltOp(), It == MinBWs.end());
 
       Value *V = Builder.CreateShuffleVector(V0, V1, Mask);
       if (auto *I = dyn_cast<Instruction>(V)) {


        


More information about the llvm-commits mailing list