[llvm] c89d511 - [SLP]Use It->second.first for BWSz, NFC.

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 28 06:38:53 PST 2024


Author: Alexey Bataev
Date: 2024-02-28T06:38:41-08:00
New Revision: c89d51112d329a4a37ff6dbcda7002853847c8a3

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

LOG: [SLP]Use It->second.first for BWSz, NFC.

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 de4e56ff80659a..2b7d518c1c1a78 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -9364,7 +9364,7 @@ InstructionCost BoUpSLP::getTreeCost(ArrayRef<Value *> VectorizedVals) {
                 VectorCasts
                     .insert(std::make_pair(ScalarTE, FTy->getElementType()))
                     .second) {
-              unsigned BWSz = It->second.second;
+              unsigned BWSz = It->second.first;
               unsigned DstBWSz = DL->getTypeSizeInBits(FTy->getElementType());
               unsigned VecOpcode;
               if (DstBWSz < BWSz)
@@ -9376,7 +9376,7 @@ InstructionCost BoUpSLP::getTreeCost(ArrayRef<Value *> VectorizedVals) {
               InstructionCost C = TTI->getCastInstrCost(
                   VecOpcode, FTy,
                   FixedVectorType::get(
-                      IntegerType::get(FTy->getContext(), It->second.first),
+                      IntegerType::get(FTy->getContext(), BWSz),
                       FTy->getNumElements()),
                   TTI::CastContextHint::None, CostKind);
               LLVM_DEBUG(dbgs() << "SLP: Adding cost " << C


        


More information about the llvm-commits mailing list