You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[MERGE #4727@sigatrev] Array profile data usage optimzation
Merge pull request #4727 from sigatrev:arrayOpts
This commit changes usage of array profile data in an attempt to better handle certain cases (such as inlined common functions) by using the most specialized (int>float>var) array type profiled when merging profile data, unless the instruction has previous bailed out on NotNativeArray, in which case it will use the least specialized type to avoid infinite bailouts.
This also fixes an infinite bailout in Ares-6 ML benchmark which was introduced by #3169
Copy file name to clipboardExpand all lines: lib/Backend/GlobOpt.cpp
+28-15Lines changed: 28 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -3406,20 +3406,22 @@ GlobOpt::OptSrc(IR::Opnd *opnd, IR::Instr * *pInstr, Value **indirIndexValRef, I
3406
3406
{
3407
3407
ValueType valueType(val->GetValueInfo()->Type());
3408
3408
3409
-
// This block uses local profiling data to optimize the case of a native array being passed to a function that fills it with other types. When the function is inlined
3410
-
// into different call paths which use different types this can cause a perf hit by performing unnecessary array conversions, so only perform this optimization when
3411
-
// the function is not inlined.
3412
-
if (valueType.IsLikelyNativeArray() && !valueType.IsObject() && instr->IsProfiledInstr() && !instr->m_func->IsInlined())
3409
+
// This block uses per-instruction profile information on array types to optimize using the best available profile
3410
+
// information and to prevent infinite bailouts by ensuring array type information is updated on bailouts.
3411
+
if (valueType.IsLikelyArray() && !valueType.IsObject() && instr->IsProfiledInstr())
0 commit comments