If BBE is not a unique edge between start and end of the edge, it can
never dominate the use.
And the code starting at https://github.com/llvm/llvm-project/blob/d2edca6276d1715a02d1144eae577b3d79673d67/llvm/lib/IR/Dominators.cpp#L222 does handle it this way.
However, we also have two special cases for edge-phi domination and edge-edge domination, where we consider a multi-edge to be dominating. This patch makes them non-dominating, as we don't know which edge of the multi-edge we're querying.
I'm somewhat unsure about this change, because the resulting semantics could be considered somewhat odd (an edge does not dominate itself if it is a multi-edge), but I think they match the documentation and are at least self-consistent.
clang-format: please reformat the code
- StringRef ModuleString = - "define i32 @f(i32 %i, i32 *%p) {\n" - "bb0:\n" - " store i32 %i, i32 *%p\n" - " switch i32 %i, label %bb2 [\n" - " i32 0, label %bb1\n" - " i32 1, label %bb1\n" - " ]\n" - " bb1:\n" - " %phi = phi i32 [ 2, %bb0 ], [ 3, %bb0 ]\n"17 diff lines are omitted. See full path.