We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3f379e commit fc15731Copy full SHA for fc15731
llvm/lib/Transforms/Scalar/GVN.cpp
@@ -2622,8 +2622,8 @@ bool GVNPass::processInstruction(Instruction *I) {
2622
2623
// Remember how many outgoing edges there are to every successor.
2624
SmallDenseMap<BasicBlock *, unsigned, 16> SwitchEdges;
2625
- for (unsigned i = 0, n = SI->getNumSuccessors(); i != n; ++i)
2626
- ++SwitchEdges[SI->getSuccessor(i)];
+ for (BasicBlock *Succ : successors(Parent))
+ ++SwitchEdges[Succ];
2627
2628
for (SwitchInst::CaseIt i = SI->case_begin(), e = SI->case_end();
2629
i != e; ++i) {
0 commit comments