[llvm] a5eaec8 - [SLP]Fix variable redefinition error

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 11 12:02:21 PDT 2024


Author: Alexey Bataev
Date: 2024-04-11T12:01:38-07:00
New Revision: a5eaec83b3446f217169fdd94e03ec67823af058

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

LOG: [SLP]Fix variable redefinition error

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 55dc0867e2ea9b..df891371fdf758 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -12930,9 +12930,9 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E, bool PostponedPHIs) {
         if (auto *I = dyn_cast<Instruction>(Vec);
             I && Opcode == Instruction::Sub && !MinBWs.contains(E) &&
             any_of(E->Scalars, [](Value *V) {
-              auto *I = cast<Instruction>(V);
-              return I->getOpcode() == Instruction::Sub &&
-                     isCommutative(cast<Instruction>(V));
+              auto *IV = cast<Instruction>(V);
+              return IV->getOpcode() == Instruction::Sub &&
+                     isCommutative(cast<Instruction>(IV));
             }))
           I->setHasNoUnsignedWrap(/*b=*/false);
       };


        


More information about the llvm-commits mailing list