Skip to content

Commit 0150087

Browse files
committed
small cleanup
1 parent 85cb6cf commit 0150087

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

llvm/lib/Target/SPIRV/SPIRVStructurizer.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -288,18 +288,6 @@ void replaceBranchTargets(BasicBlock *BB, BasicBlock *OldTarget,
288288
assert(false && "Unhandled terminator type.");
289289
}
290290

291-
// Replaces basic bloc operands |OldSrc| or OpPhi instructions in |BB| by
292-
// |NewSrc|. This function does not simplify the OpPhi instruction once
293-
// transformed.
294-
void replacePhiTargets(BasicBlock *BB, BasicBlock *OldSrc, BasicBlock *NewSrc) {
295-
for (PHINode &Phi : BB->phis()) {
296-
int index = Phi.getBasicBlockIndex(OldSrc);
297-
if (index == -1)
298-
continue;
299-
Phi.setIncomingBlock(index, NewSrc);
300-
}
301-
}
302-
303291
} // anonymous namespace
304292

305293
// Given a reducible CFG, produces a structurized CFG in the SPIR-V sense,
@@ -463,7 +451,6 @@ class SPIRVStructurizer : public FunctionPass {
463451
BasicBlock *NewSrc =
464452
BasicBlock::Create(F.getContext(), "new.src", &F);
465453
replaceBranchTargets(Src, Dst, NewSrc);
466-
// replacePhiTargets(Dst, Src, NewSrc);
467454
IRBuilder<> Builder(NewSrc);
468455
Builder.CreateBr(Dst);
469456
Src = NewSrc;
@@ -507,7 +494,6 @@ class SPIRVStructurizer : public FunctionPass {
507494
if (Dsts.size() == 1) {
508495
for (auto &[Src, Dst] : FixedEdges) {
509496
replaceBranchTargets(Src, Dst, NewExit);
510-
// replacePhiTargets(Dst, Src, NewExit);
511497
}
512498
ExitBuilder.CreateBr(Dsts[0]);
513499
return NewExit;

0 commit comments

Comments
 (0)