[Verifier] Duplicated Predecessors of BasicBlock can pass verifier #114796
Labels
accepts-invalid
llvm:ir
question
A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
IR below is generated with LLVM-3.6, this BB (block_1645788) has three duplicated predecessors (block_1645730) and its PHINode has three duplicated incoming values ( [ %tmp41218, %block_1645730 ] ). This BB is actually a switch case, and the duplicated predecessors are where the SwitchInst is located, the duplicated predecessors is because different cases fall through the same block.
To compare, in the latest LLVM/Clang, the compiler will not generate BB with duplicated predecessors: https://godbolt.org/z/Pxond9x47
*I don't understand why this IR can pass the verifier? Why not just keep one predecessors? * In other words, when can we assume that PHI Node can only have incoming values from distinct incoming blocks (predecessors)?
The text was updated successfully, but these errors were encountered: