[Vectorize] Fix a warning

This patch fixes:

  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:2699:49: error:
  captured structured bindings are a C++20 extension
  [-Werror,-Wc++20-extensions]
This commit is contained in:
Kazu Hirata
2024-12-09 10:26:48 -08:00
parent 337936a83b
commit 9099d694f6

View File

@@ -2691,7 +2691,11 @@ static void addFullyUnrolledInstructionsToIgnore(
auto *Cmp = L->getLatchCmpInst();
if (Cmp)
InstsToIgnore.insert(Cmp);
for (const auto &[IV, IndDesc] : IL) {
for (const auto &KV : IL) {
// Extract the key by hand so that it can be used in the lambda below. Note
// that captured structured bindings are a C++20 extension.
const PHINode *IV = KV.first;
// Get next iteration value of the induction variable.
Instruction *IVInst =
cast<Instruction>(IV->getIncomingValueForBlock(L->getLoopLatch()));