-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Replace AddrOpnd with IntConstOpnd for 64-bit immediates #1630
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
Conversation
|
@rajatd , @satheeshravi Please take a look when you can, thanks! |
lib/Backend/Lower.cpp
Outdated
| @@ -12936,7 +12935,7 @@ Lowerer::LowerInlineeEnd(IR::Instr *instr) | |||
| { | |||
| // REVIEW (michhol): OOP JIT. why are we creating an addropnd with 0? | |||
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.
Could get rid of this review comment. What do you think @MikeHolman?
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.
lib/Backend/LowerMDShared.cpp
Outdated
| instr = IR::Instr::New(Js::OpCode::SHR, opndOffset, opndOffset, IR::IntConstOpnd::New(rightShiftAmount - leftShiftAmount, TyUint8, instrLdSt->m_func, true), instrLdSt->m_func); | ||
| instrLdSt->InsertBefore(instr); | ||
| instr = IR::Instr::New(Js::OpCode::AND, opndOffset, opndOffset, IR::AddrOpnd::New((void*)((__int64)(polymorphicInlineCacheSize - 1) << leftShiftAmount), IR::AddrOpndKindConstant, instrLdSt->m_func, true), instrLdSt->m_func); | ||
| instr = IR::Instr::New(Js::OpCode::AND, opndOffset, opndOffset, IR::IntConstOpnd::New(((__int64)(polymorphicInlineCacheSize - 1) << leftShiftAmount), TyInt64, instrLdSt->m_func, true), instrLdSt->m_func); |
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.
__int64 [](start = 92, length = 7)
I think you should be able to remove the cast and change the type to TyMachReg
lib/Backend/LowerMDShared.cpp
Outdated
| // Unconditionally set the sign bit. This will get XORd away when we remove the tag. | ||
| // dst64 = OR 0x8000000000000000 | ||
| insertInstr->InsertBefore(IR::Instr::New(Js::OpCode::OR, dst, dst, IR::AddrOpnd::New((void *)MachSignBit, IR::AddrOpndKindConstant, this->m_func), this->m_func)); | ||
| insertInstr->InsertBefore(IR::Instr::New(Js::OpCode::OR, dst, dst, IR::IntConstOpnd::New(MachSignBit, TyInt64, this->m_func), this->m_func)); |
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.
TyInt64 [](start = 110, length = 7)
Consider changing this to TyMachReg
|
LGTM other than the comments. |
|
|
||
| instrNew = LowererMD::CreateAssign(regOpnd, opnd, instr); | ||
|
|
||
| size_t cookie = (size_t)Math::Rand(); |
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.
cookie [](start = 11, length = 6)
nit: Please check if TyMachReg is ok when the value is an unsigned int. I am not sure about the implications.
lib/Backend/LowerMDShared.cpp
Outdated
| if (!instr->isInlineeEntryInstr) | ||
| { | ||
| Assert(forms & L_Reg); | ||
| IR::IndirOpnd * indirOpnd = instr->m_func->GetTopFunc()->GetConstantAddressIndirOpnd(intOpnd->GetValue(), IR::AddrOpndKindConstantAddress, TyMachPtr, Js::OpCode::MOV); |
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.
intOpnd->GetValue() [](start = 105, length = 19)
This is still being treated as an address inside the API. and it looks like the API is creating AddrOpnd. Should you be creating a IntOpnd in this case ?
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.
yes, changed this to IntConstOpnd
lib/Backend/LowerMDShared.cpp
Outdated
| if (!instr->isInlineeEntryInstr) | ||
| { | ||
| Assert(forms & L_Reg); | ||
| IR::IndirOpnd * indirOpnd = instr->m_func->GetTopFunc()->GetConstantAddressIndirOpnd(intOpnd->GetValue(), IR::AddrOpndKindConstantAddress, TyMachPtr, Js::OpCode::MOV); |
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.
AddrOpndKindConstantAddress [](start = 130, length = 27)
same here.
|
@meg-gupta FYI Tab Check issues were resolved in #1636 |
dd9db5c to
c4a5d80
Compare
|
@dotnet-bot test Windows x86_debug please |
|
@dotnet-bot test Windows arm_debug |
|
|
e748e39 to
29936de
Compare
|
@dotnet-bot test Windows x64_release |
AddrOpnd was used with AddOpndKindConstant for 64bit immediates, and then legalized. Replace all such uses with IntConstOpnd, and add code in legalizer to handle them.
29936de to
965a30a
Compare
…t immediates Merge pull request #1630 from meg-gupta:newchangeimmop AddrOpnd was used with AddrOpndKindConstant for 64bit immediates, and then legalized. Replace all such uses with IntConstOpnd, and add code in legalizer to handle them.
AddrOpnd was used with AddrOpndKindConstant for 64bit immediates, and then
legalized. Replace all such uses with IntConstOpnd, and add code in
legalizer to handle them.