Skip to content

Commit

Permalink
adjust for llvm 15
Browse files Browse the repository at this point in the history
Signed-off-by: Sidorov, Dmitry <dmitry.sidorov@intel.com>
  • Loading branch information
MrSidims committed Nov 7, 2024
1 parent b3cab3d commit 4b64774
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lib/SPIRV/SPIRVReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3103,17 +3103,21 @@ static void validatePhiPredecessors(Function *F) {
for (PHINode &Phi : BB.phis()) {
SmallVector<Value *> Vs;
SmallVector<BasicBlock *> 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) {
for (const unsigned N = Phi.getNumIncomingValues(); I < N; ++I) {
Phi.setIncomingValue(I, Vs[I]);
Phi.setIncomingBlock(I, Bs[I]);
}
for (unsigned N = Vs.size(); I < N; ++I)
for (const unsigned N = Vs.size(); I < N; ++I)
Phi.addIncoming(Vs[I], Bs[I]);
}
}
Expand Down

0 comments on commit 4b64774

Please sign in to comment.