From 0c84e7c2f7a2c66a228102a506f1da963cb69668 Mon Sep 17 00:00:00 2001 From: "Sidorov, Dmitry" Date: Thu, 7 Nov 2024 09:38:20 -0800 Subject: [PATCH] adjust for llvm 14 Signed-off-by: Sidorov, Dmitry --- lib/SPIRV/SPIRVReader.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/SPIRV/SPIRVReader.cpp b/lib/SPIRV/SPIRVReader.cpp index 6bfb2b520..9bce500e6 100644 --- a/lib/SPIRV/SPIRVReader.cpp +++ b/lib/SPIRV/SPIRVReader.cpp @@ -3059,10 +3059,14 @@ static void validatePhiPredecessors(Function *F) { for (PHINode &Phi : BB.phis()) { SmallVector Vs; SmallVector Bs; - for (auto [V, B] : zip(Phi.incoming_values(), Phi.blocks())) { - unsigned N = PredsCnt[B]; - Vs.insert(Vs.end(), N, V); - Bs.insert(Bs.end(), N, B); + auto Vals = Phi.incoming_values(); + auto Blocks = Phi.blocks(); + auto *VIt = Vals.begin(); + auto *BIt = Blocks.begin(); + for (; VIt != Vals.end() && BIt != Blocks.end(); ++VIt, ++BIt) { + const unsigned N = PredsCnt[*BIt]; + Vs.insert(Vs.end(), N, *VIt); + Bs.insert(Bs.end(), N, *BIt); } unsigned I = 0; for (unsigned N = Phi.getNumIncomingValues(); I < N; ++I) {