[llvm] [SPIR-V][Codegen] Add isPhi bit to MCInstrDesc/MIR definitions (PR #110019)

Vyacheslav Levytskyy via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 30 10:38:19 PDT 2024


VyacheslavLevytskyy wrote:

> > * %retval.0.i = phi i32 [ 0, %sw.default.i ], [ 1, %entry ], [ 1, %entry ]
> 
> This is legal? "After this, the ‘phi’ instruction takes a list of pairs as arguments, with one pair for each predecessor basic block of the current block. " Looks like there should be 1 value per predecessor, so only 2 pairs for this instruction no? (Even if there are 2 edges, it's still the same predecessor)

Please have a look at https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/2702 for more context, there I've tried to describe it with details. It's exotic but legal.

https://github.com/llvm/llvm-project/pull/110019


More information about the llvm-commits mailing list