[llvm] dd83bef - [SLP][NFC]Improved isAltShuffle by comparing instructions instead of

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 5 12:32:11 PST 2022


Author: Alexey Bataev
Date: 2022-01-05T12:30:13-08:00
New Revision: dd83befe33a055c9053f16ff44f4639c6ea15f4a

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

LOG: [SLP][NFC]Improved isAltShuffle by comparing instructions instead of
opcodes, NFC.

NFC part of D115955.

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 1dd31dcae2539..803dabc5e07be 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -435,7 +435,7 @@ struct InstructionsState {
   }
 
   /// Some of the instructions in the list have alternate opcodes.
-  bool isAltShuffle() const { return getOpcode() != getAltOpcode(); }
+  bool isAltShuffle() const { return AltOp != MainOp; }
 
   bool isOpcodeOrAlt(Instruction *I) const {
     unsigned CheckedOpcode = I->getOpcode();
@@ -2019,9 +2019,7 @@ class BoUpSLP {
     }
 
     /// Some of the instructions in the list have alternate opcodes.
-    bool isAltShuffle() const {
-      return getOpcode() != getAltOpcode();
-    }
+    bool isAltShuffle() const { return MainOp != AltOp; }
 
     bool isOpcodeOrAlt(Instruction *I) const {
       unsigned CheckedOpcode = I->getOpcode();


        


More information about the llvm-commits mailing list