JIT: Change VN's representation for phi definitions#105198
JIT: Change VN's representation for phi definitions#105198jakobbotsch merged 2 commits intodotnet:mainfrom
Conversation
Replace `VNF_PhiDef` and `VNF_MemoryPhiDef` by new explicit representations that represent all phi args directly.
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
|
A few diffs I want to look at the cause of. I probably won't get to that until after the snap. |
|
The diffs look related to ordering in VNs. In the baseline we have: N001 [000862] CNS_INT(h) 0x400000000042cea8 static => $208 {Hnd const: 0x400000000042CEA8 GTF_ICON_STATIC_HDL}
N002 [000863] CNS_INT 0 Fseq[<unknown field>] => $242 {LngCns 0}
N003 [000864] ADD => $380 {ADD($208, $242)}where we didn't fold this handle + constant. The handle has the lower raw VN here. In the diff we have N001 [000862] CNS_INT(h) 0x400000000042cea8 static => $282 {Hnd const: 0x400000000042CEA8 GTF_ICON_STATIC_HDL}
N002 [000863] CNS_INT 0 Fseq[<unknown field>] => $202 {LngCns 0}
N003 [000864] ADD => $282 {Hnd const: 0x400000000042CEA8 GTF_ICON_STATIC_HDL}where we did fold it. The handle has the higher raw VN here. We ended up with the operands to |
|
cc @dotnet/jit-contrib PTAL @EgorBo Diffs. Minor diffs due to the above. Some TP improvements otherwise. |
| BasicBlock* Block; | ||
| unsigned* SsaArgs; | ||
| unsigned NumArgs; | ||
| }; |
There was a problem hiding this comment.
I'd probably use a single struct and unify memory with regular phi. It seems like we often probe both anyway, but LGTM as is too
There was a problem hiding this comment.
Hmm, it would require introducing some "kind" type in the unified struct anyway that you will need to check. To actually use the SSA args you need to differentiate between whether it's memory or local, so I'm not sure it simplifies much. I think I'll leave it like this and then we can introduce a helper if there is a good way to unify it.
Replace
VNF_PhiDefandVNF_MemoryPhiDefby new explicit representations that represent all phi args directly.