Skip to content

Commit

Permalink
[LoopVectorizer] Silence warning in GetRegUsage.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sdesmalen-arm committed Nov 11, 2020
1 parent c3b1395 commit 9ff7011
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Expand Up @@ -5793,15 +5793,14 @@ 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());

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));
Expand Down

0 comments on commit 9ff7011

Please sign in to comment.