-
Notifications
You must be signed in to change notification settings - Fork 5.2k
JIT: Skip unnecessary binary VN folding checks #73919
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
Conversation
For a lot of extremely common binary VN functions we do a series of unnecessary folding checks, in particular VNF_ValWithExc and VNF_ExcSetCons. Introduce a VNForFuncNoFolding and VNPairForFuncNoFolding that bypasses folding and use it in some cases.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsFor a lot of extremely common binary VN functions we do a series of
|
cc @dotnet/jit-contrib |
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.
Looks good.
Wondering if the assert I suggested might help catch future cases where somebody bypasses folding when it would help.
GetVNFunc2Map()->Set(fstruct, resultVN); | ||
} | ||
return resultVN; | ||
} |
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.
How costly/difficult would it be to assert that we get the same result here as if we'd tried folding?
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 suppose in the debug build we can just call the regular version from the *NoFolding
variant and validate that no folding occurred.
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 did this but I'm not too happy with it since it bypasses the "normal" implementation of VNForFuncNoFolding
in debug builds which seems scary. And since VNForFunc
has side effects related to using the cache I'm not a big fan of using that in an assert either. I'll leave this as-is, in the worst case it is just going to be some missed opportunities anyway.
For a lot of extremely common binary VN functions we do a series of
unnecessary folding checks, in particular VNF_ValWithExc and
VNF_ExcSetCons. Introduce a VNForFuncNoFolding and
VNPairForFuncNoFolding that bypasses folding and use it in some cases.