[llvm] 447da95 - [SLP][NFC]Use DenseSet instead of SetVector, NFC.

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 28 11:28:00 PST 2023


Author: Alexey Bataev
Date: 2023-11-28T11:27:49-08:00
New Revision: 447da954c7dc3175ef3e04da7b2c65cd75c16f92

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

LOG: [SLP][NFC]Use DenseSet instead of SetVector, NFC.

For CSEBlocks we can safely use DenseSet, the order should not be
preserved for this container.

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 e6ac4c9024f2287..a9ee101566e9795 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -3034,7 +3034,7 @@ class BoUpSLP {
   SetVector<Instruction *> GatherShuffleExtractSeq;
 
   /// A list of blocks that we are going to CSE.
-  SetVector<BasicBlock *> CSEBlocks;
+  DenseSet<BasicBlock *> CSEBlocks;
 
   /// Contains all scheduling relevant data for an instruction.
   /// A ScheduleData either represents a single instruction or a member of an
@@ -10093,12 +10093,12 @@ class BoUpSLP::ShuffleInstructionBuilder final : public BaseShuffleAnalysis {
     /// Holds all of the instructions that we gathered.
     SetVector<Instruction *> &GatherShuffleExtractSeq;
     /// A list of blocks that we are going to CSE.
-    SetVector<BasicBlock *> &CSEBlocks;
+    DenseSet<BasicBlock *> &CSEBlocks;
 
   public:
     ShuffleIRBuilder(IRBuilderBase &Builder,
                      SetVector<Instruction *> &GatherShuffleExtractSeq,
-                     SetVector<BasicBlock *> &CSEBlocks)
+                     DenseSet<BasicBlock *> &CSEBlocks)
         : Builder(Builder), GatherShuffleExtractSeq(GatherShuffleExtractSeq),
           CSEBlocks(CSEBlocks) {}
     ~ShuffleIRBuilder() = default;


        


More information about the llvm-commits mailing list