In case phi was in the default block it could lead to multi-edge.
Fixes #55721.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp | ||
---|---|---|
1308 | I don't think this is sufficient. Can you please add a test where the default doesn't directly go to the phi block, but have one dummy block in between? (That is, go to a sw.19 block from both 19 and default.) I think the right fix would be adding a ++SuccCount[SI->getDefaultDest()]. |
llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp | ||
---|---|---|
1308 | I'll add this test case, but I'm pretty sure that this is covered by the dominance check DT.dominates(BasicBlockEdge(IDom, It->second), BasicBlockEdge(Pred, BB)); I think this check will only succeed when both edges are the "same". Then again, I think your proposed fix would work as well (at the expense of slightly more work), so I can switch to it. |
clang-format not found in user’s local PATH; not linting file.