Optimize ValueNumStore::GetVNFunc#67395
Conversation
`ValueNumStore::GetVNFunc` is very hot, in fact so hot that it shows up right at the top in a profile of SPMI over libraries.pmi, next to `fgMorphSmpOp`. Instead of copying all args just return a pointer to the arguments which allows all the cases to be unified and makes the function small enough for MSVC to inline it. Most of the work here is to make sure we do not end up with undefined behavior. I also removed some of the duplication by using a templated struct for func apps instead of the old VNDefFuncNArg. Windows x64 SPMI over libraries.pmi: PIN before: 329991512865 PIN after: 326098430289 (-1.19%)
|
Tagging subscribers to this area: @JulieLeeMSFT Issue Details
Most of the work here is to make sure we do not end up with undefined Windows x64 SPMI over libraries.pmi: cc @dotnet/jit-contrib
|
SingleAccretion
left a comment
There was a problem hiding this comment.
1.2%
The numbers speak for themselves :).
ValueNumStore::GetVNFuncis very hot, in fact so hot that it shows upright at the top in a profile of SPMI over libraries.pmi, next to
fgMorphSmpOp. Instead of copying all args just return a pointer to thearguments which allows all the cases to be unified and makes the
function small enough for MSVC to inline it.
Most of the work here is to make sure we do not end up with undefined
behavior. I also removed some of the duplication by using a templated
struct for func apps instead of the old VNDefFuncNArg.
Windows x64 SPMI over libraries.pmi:
PIN before: 329991512865
PIN after: 326098430289 (-1.19%)
cc @dotnet/jit-contrib