Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert ARM LSRA changes
These cause some larger than expected regressions so will open a
separate issue for it.
  • Loading branch information
jakobbotsch committed Jun 10, 2022
commit 6ef03b4d112b8915a41acf54cdd10a1c7bd3f3b9
14 changes: 1 addition & 13 deletions src/coreclr/jit/lsrabuild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -893,20 +893,8 @@ regMaskTP LinearScan::getKillSetForCall(GenTreeCall* call)
killMask &= ~RBM_FLT_CALLEE_TRASH;
}
#ifdef TARGET_ARM
// Indirection cell arg may go in callee saved register on ARM.
// Technically these may not be killed by the call, but we have special
// handling for arguments to keep their registers busy until they are
// killed expecting to see this kill at the call site.
WellKnownArg indirCellKind = call->GetIndirectionCellArgKind();
if (indirCellKind != WellKnownArg::None)
if (call->IsVirtualStub())
{
#ifdef DEBUG
// Assume the different indir cells use the same register to avoid
// having to find the arg in release builds, but assert it here.
CallArg* indirCellArg = call->gtArgs.FindWellKnownArg(indirCellKind);
assert((indirCellArg != nullptr) &&
(indirCellArg->AbiInfo.GetRegNum() == compiler->virtualStubParamInfo->GetReg()));
#endif
killMask |= compiler->virtualStubParamInfo->GetRegMask();
}
#else // !TARGET_ARM
Expand Down
11 changes: 10 additions & 1 deletion src/coreclr/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2111,6 +2111,15 @@ void CallArgs::AddFinalArgsAndDetermineABIInfo(Compiler* comp, GenTreeCall* call
indirectCellAddress->AsIntCon()->gtTargetHandle = (size_t)call->gtCallMethHnd;
#endif

#ifdef TARGET_ARM
// TODO-ARM: We currently do not properly kill this register in LSRA
// (see getKillSetForCall which does so only for VSD calls).
// We should be able to remove these two workarounds once we do so,
// however when this was tried there were significant regressions.
indirectCellAddress->SetRegNum(REG_R2R_INDIRECT_PARAM);
indirectCellAddress->SetDoNotCSE();
#endif

// Push the stub address onto the list of arguments.
NewCallArg indirCellAddrArg =
NewCallArg::Primitive(indirectCellAddress).WellKnown(WellKnownArg::R2RIndirectionCell);
Expand Down Expand Up @@ -7911,7 +7920,7 @@ void Compiler::fgMorphTailCallViaJitHelper(GenTreeCall* call)
// call - a call that needs virtual stub dispatching.
//
// Return Value:
// addr tree with set resister requirements.
// addr tree
//
GenTree* Compiler::fgGetStubAddrArg(GenTreeCall* call)
{
Expand Down