[llvm-branch-commits] [llvm] 65e311a - [LoopVectorize][NFC] Reinstate TTICapture workaround for gcc-6

Peter Waller via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Jul 4 07:13:32 PDT 2022


Author: Peter Waller
Date: 2022-07-04T14:13:16Z
New Revision: 65e311ac0da02203c188caea9f171f4496ca9178

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

LOG: [LoopVectorize][NFC] Reinstate TTICapture workaround for gcc-6

Fixes #56374.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 25ec712f43dd..c9e9136bbd3c 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -5937,10 +5937,11 @@ LoopVectorizationCostModel::calculateRegisterUsage(ArrayRef<ElementCount> VFs) {
 
   LLVM_DEBUG(dbgs() << "LV(REG): Calculating max register usage:\n");
 
-  auto GetRegUsage = [&TTI = TTI](Type *Ty, ElementCount VF) -> unsigned {
+  const auto &TTICapture = TTI;
+  auto GetRegUsage = [&TTICapture](Type *Ty, ElementCount VF) -> unsigned {
     if (Ty->isTokenTy() || !VectorType::isValidElementType(Ty))
       return 0;
-    return TTI.getRegUsageForType(VectorType::get(Ty, VF));
+    return TTICapture.getRegUsageForType(VectorType::get(Ty, VF));
   };
 
   for (unsigned int i = 0, s = IdxToInstr.size(); i < s; ++i) {


        


More information about the llvm-branch-commits mailing list