[llvm] 58a2c4e - [SLP][NFC]Check for equal opcode preliminary to meet weak strict order

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 18 06:44:56 PST 2023


Author: Alexey Bataev
Date: 2023-12-18T06:42:03-08:00
New Revision: 58a2c4e2f24ffce3966c3988d1a4ca7b04c52244

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

LOG: [SLP][NFC]Check for equal opcode preliminary to meet weak strict order
requirement, NFC.

This change does not affect functionality, just fixes the assertions in
some standard c++ library implementations.

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 9d799124074ca1..8c3ed0888e4631 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -15777,6 +15777,8 @@ static bool compareCmp(Value *V, Value *V2, TargetLibraryInfo &TLI,
           if (NodeI1 != NodeI2)
             return NodeI1->getDFSNumIn() < NodeI2->getDFSNumIn();
         }
+        if (I1->getOpcode() == I2->getOpcode())
+          continue;
         InstructionsState S = getSameOpcode({I1, I2}, TLI);
         if (S.getOpcode() && (IsCompatibility || !S.isAltShuffle()))
           continue;


        


More information about the llvm-commits mailing list