Optimize `ValueNumStore::GetVNFunc` (#67395)
`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%)
Showing
想要评论请 注册 或 登录