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
Currently, if a double constant is something that can be encoded using fmov, we always load it using fmov without trying to CSE it. For cases where the occurrence of a constant is in a loop, we load it in every iteration. Below is an amplified version of the problem to understand how we generate today
We need to adjust the heuristic below to determine if it is profitable to use fmov or not. One criteria would be if it the usage is inside a hot block (compCurBB->bbWeight > BB_UNITY_WEIGHT), then do not do load it using fmov.
Currently, if a double constant is something that can be encoded using
fmov
, we always load it usingfmov
without trying to CSE it. For cases where the occurrence of a constant is in a loop, we load it in every iteration. Below is an amplified version of the problem to understand how we generate todayOn x64, we do the right thing - https://godbolt.org/z/67h7rzWaK
We need to adjust the heuristic below to determine if it is profitable to use
fmov
or not. One criteria would be if it the usage is inside a hot block (compCurBB->bbWeight > BB_UNITY_WEIGHT
), then do not do load it usingfmov
.runtime/src/coreclr/jit/gentree.cpp
Lines 3489 to 3494 in 7065279
Perhaps, this can adversely affect the code because of increased register pressure, but we should validate if that is the case.
The text was updated successfully, but these errors were encountered: