-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For arm32, kill REG_PROFILER_RET_SCRATCH for LSRA but not for GC #40123
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -491,6 +491,8 @@ int LinearScan::BuildNode(GenTree* tree) | |
|
||
case GT_RETURN: | ||
srcCount = BuildReturn(tree); | ||
killMask = getKillSetForReturn(); | ||
BuildDefsWithKills(tree, 0, RBM_NONE, killMask); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am OK with this fix as-is, but I think another option that might be slightly cleaner would be to replace the above 3 lines with:
Then target.h and emit.cpp could, I believe, remain unchanged. This basically says to the register allocator: "I need an extra register and it must be r2", which will cause it to ensure that r2 is free at the return. However, I haven't tested this approach. Note that normally I wouldn't do this separately (outside of an existing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I mentioned trying something like that over in the issue but wasn't sure how to pull it off. Seems like the cleanest solution would be to inject these calls early and handle them like any other call. Not sure how to proceed -- if you're ok with this fix then approve? Else I can try the above. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll approve; not sure it's worth iterating on. |
||
break; | ||
|
||
case GT_RETFILT: | ||
|
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.
Can you please explain why this is only needed for
TARGET_ARM
and not other architectures?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.
Arm is the only target that does this sort of return value sheltering in jitted code around the profiler leave hook.
No other architecture defines
RBM_PROFILER_RET_SCRATCH
.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.
Got it, thanks