-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
update the location of assert for REG_ZR check #112294
base: main
Are you sure you want to change the base?
Conversation
@dotnet/jit-contrib @amanasifkhalid |
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, thanks!
src/coreclr/jit/emitarm64.cpp
Outdated
@@ -5875,6 +5875,9 @@ void emitter::emitIns_R_R_I(instruction ins, | |||
return; | |||
} | |||
|
|||
// reg2 can be alread encoded to zero |
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.
// reg2 can be alread encoded to zero | |
// reg2 can be already encoded to zero |
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.
ok to fix in next batch? don't want to run CI again.
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
Shouldn't the code that produces the add/sub be doing |
Yeah, the |
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.
Agreed that fixing the caller seems better
This probably got exposed with #111451 because that makes more usages of
SP
thanFP
. While loading or storing from stack with an offset, we already encode SP -> ZR, but if we have to produce the offset using reserved register, we performadd
orsub
to populate it. The caller already encodesREG_SP
asREG_ZR
, but inadd
/sub
, we were expecting thereg2
to be SP or GPR, but later we will encode it toZR
anyway. So, I have just moved the assert to take into account of that.Fixes: #112278