[llvm] [SPIR-V][Codegen] Add isPhi bit to MCInstrDesc/MIR definitions (PR #110019)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 30 08:07:32 PDT 2024
arsenm wrote:
> phi-node should have one entry for each predecessor (meaning for each instance of the edge), so that %retval.0.i = phi i32 [ 0, %sw.default.i ], [ 1, %entry ], [ 1, %entry ] is equivalent to %retval_0_i = OpPhi %uint %uint_0 %13 %uint_1 %12 where there is just one record per 2 original %entry predecessors.
OK, so I think in this case, it shouldn't be treated like a phi at all. That's structurally different, and should have a different strategy. No generic transform should be treating this as if it were a phi
> In `G_BITCAST` we see `if (SrcTy == DstTy) report("bitcast must change the type", MI);` where SrcTy and DstTy both being LLT pointers just have no means to express the notion of pointer type that is important for SPIR-V where a user may and should use bitcast between pointers with different pointee types (see, https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#OpBitcast).
Not sure what the issue here is, or how it's connected to the phi
https://github.com/llvm/llvm-project/pull/110019
More information about the llvm-commits
mailing list