[llvm] c146af3 - [LoopVectorize][NFC] Reinstate TTICapture workaround for gcc-6
Peter Waller via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 4 07:16:29 PDT 2022
Author: Peter Waller
Date: 2022-07-04T14:14:15Z
New Revision: c146af3f469adde04f7adb126e7d7b7b7047c88c
URL: https://github.com/llvm/llvm-project/commit/c146af3f469adde04f7adb126e7d7b7b7047c88c
DIFF: https://github.com/llvm/llvm-project/commit/c146af3f469adde04f7adb126e7d7b7b7047c88c.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-commits
mailing list