[llvm] 9ff7011 - [LoopVectorizer] Silence warning in GetRegUsage.
Sander de Smalen via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 11 02:54:45 PST 2020
Author: Sander de Smalen
Date: 2020-11-11T10:54:20Z
New Revision: 9ff701100a868b7b680aac5c54e9db21a55531fd
URL: https://github.com/llvm/llvm-project/commit/9ff701100a868b7b680aac5c54e9db21a55531fd
DIFF: https://github.com/llvm/llvm-project/commit/9ff701100a868b7b680aac5c54e9db21a55531fd.diff
LOG: [LoopVectorizer] Silence warning in GetRegUsage.
This patch silences the warning:
error: lambda capture 'DL' is not used [-Werror,-Wunused-lambda-capture]
auto GetRegUsage = [&DL, &TTI=TTI](Type *Ty, ElementCount VF) {
~^~~
1 error generated.
Introduced in:
https://reviews.llvm.org/rGb873aba3943c067a5efd5303cbdf5aeb0732cf88
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 5d50dce7fcbc..527f38a4211c 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -5793,7 +5793,6 @@ LoopVectorizationCostModel::calculateRegisterUsage(ArrayRef<ElementCount> VFs) {
unsigned MaxSafeDepDist = -1U;
if (Legal->getMaxSafeDepDistBytes() != -1U)
MaxSafeDepDist = Legal->getMaxSafeDepDistBytes() * 8;
- const DataLayout &DL = TheFunction->getParent()->getDataLayout();
SmallVector<RegisterUsage, 8> RUs(VFs.size());
SmallVector<SmallMapVector<unsigned, unsigned, 4>, 8> MaxUsages(VFs.size());
@@ -5801,7 +5800,7 @@ LoopVectorizationCostModel::calculateRegisterUsage(ArrayRef<ElementCount> VFs) {
LLVM_DEBUG(dbgs() << "LV(REG): Calculating max register usage:\n");
// A lambda that gets the register usage for the given type and VF.
- auto GetRegUsage = [&DL, &TTI=TTI](Type *Ty, ElementCount VF) {
+ auto GetRegUsage = [&TTI=TTI](Type *Ty, ElementCount VF) {
if (Ty->isTokenTy())
return 0U;
return TTI.getRegUsageForType(VectorType::get(Ty, VF));
More information about the llvm-commits
mailing list