-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JIT: Change VN's representation for phi definitions #105198
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_PhiDef
andVNF_MemoryPhiDef
by new explicit representations that represent all phi args directly.