[LLParser] Allow zero-input phi nodes
Zero-input phi nodes are accepted by the verifier and bitcode reader, but currently rejected by the IR parser. Allow them there as well. Because phi nodes must have one entry for each predecessor, such phis can only occur in blocks without predecessors, aka unreachable code. Usually, when removing the last predecessor from a block, we also remove phi nodes in it. However, this is not possible for invalidation reasons sometimes, which is why we ended up allowing zero-entry phis at some point in the past. See 9eb2c011, D92247 and PR48296 for context. I've dropped the verifier unit test, because this is now covered by the regular IR test. This fixes at least part of https://github.com/llvm/llvm-project/issues/57446. Differential Revision: https://reviews.llvm.org/D133000
Loading
Please sign in to comment