JIT: Skip unnecessary binary VN folding checks#73919
JIT: Skip unnecessary binary VN folding checks#73919jakobbotsch merged 4 commits intodotnet:mainfrom
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 |
AndyAyersMS
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.