-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
JIT: Use small register types for some enregisterable locals #67274
Conversation
Fix two cases where small enregisterable locals can't be saved to the stack using actual (widened) types: * small memory args for OSX ARM64 * promoted fields of OSR locals Closes dotnet#67152. Closes dotnet#67188.
Tagging subscribers to this area: @JulieLeeMSFT |
@EgorBo PTAL I don't have a simple repro as the failures above are only seen in spilling. |
CI hit two test failures Ubuntu amd64
Alpine arm64
Neither repros locally (I don't have alpine arm64 hw, so ran on OSX). Will retry these. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/coreclr/jit/lclvars.cpp
Outdated
if (varTypeIsSmall(TypeGet())) | ||
{ | ||
|
||
#ifdef OSX_ARM64_ABI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this define exist?
I would have expected a compMacOsArm64Abi()
check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, thanks.
We really should run Antigen and Fuzzlyn on macOS. I would expect this to be the kind of bug that they could find quickly. |
is that something difficult to setup? |
Probably not, I am making a PR right now :-) |
src/coreclr/jit/lclvars.cpp
Outdated
if (lvIsOSRLocal && lvIsStructField) | ||
{ | ||
return GetRegisterType(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth adding a comment and/or assert about how this will not work on x86 due to the byteability requirement?
(I realize OSR isn't supported on x86 right now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
On the repro from #67188 ;; before
910003FD mov fp, sp
B94013A2 ldr w2, [fp,#16] // [V08 arg8]
B84123A1 ldr w1, [fp,#18] // [V09 arg9]
;; bbWeight=1 PerfScore 5.50
G_M37948_IG02: ;; offset=0010H
13003C40 sxth w0, w2
13003C21 sxth w1, w1
0B010000 add w0, w0, w1
B90013A2 str w2, [fp,#16]
13003C4B sxth w11, w2
0B0B0000 add w0, w0, w11
13003C01 sxth w1, w0
B80123A1 str w1, [fp,#18]
;; after
79C023A2 ldrsh w2, [fp,#16] // [V08 arg8]
79C027A1 ldrsh w1, [fp,#18] // [V09 arg9]
;; bbWeight=1 PerfScore 5.50
G_M37948_IG02: ;; offset=0010H
13003C40 sxth w0, w2
13003C21 sxth w1, w1
0B010000 add w0, w0, w1
790023A2 strh w2, [fp,#16]
13003C4B sxth w11, w2
0B0B0000 add w0, w0, w11
13003C01 sxth w1, w0
790027A1 strh w1, [fp,#18] |
Fix two cases where small enregisterable locals can't be saved to the stack
using actual (widened) types:
Closes #67152.
Closes #67188.