Skip to content

Commit

Permalink
Add missing "internal use" for register created for LoadAndInsertScal…
Browse files Browse the repository at this point in the history
…ar() (#98814)

* Add internal use for LoadAndInsertScalar()

* Small cleanup

* Handle internal registers in constrained mode

* jit format
  • Loading branch information
kunalspathak committed Feb 23, 2024
1 parent d98af68 commit 3138206
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/coreclr/jit/lsra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11745,8 +11745,7 @@ void LinearScan::verifyFinalAllocation()
}
}

LsraLocation newLocation = currentRefPosition.nodeLocation;
currentLocation = newLocation;
currentLocation = currentRefPosition.nodeLocation;

switch (currentRefPosition.refType)
{
Expand Down
24 changes: 19 additions & 5 deletions src/coreclr/jit/lsraarm64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1684,6 +1684,7 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree, int* pDstCou

assert(intrinsicTree->OperIsMemoryLoadOrStore());
srcCount += BuildAddrUses(intrin.op3);
buildInternalRegisterUses();
FALLTHROUGH;
}

Expand Down Expand Up @@ -2024,17 +2025,30 @@ bool RefPosition::isLiveAtConsecutiveRegistersLoc(LsraLocation consecutiveRegist
return true;
}

bool atConsecutiveRegsLoc = consecutiveRegistersLocation == nodeLocation;
bool treeNeedsConsecutiveRegisters = false;

if ((treeNode != nullptr) && treeNode->OperIsHWIntrinsic())
{
const HWIntrinsic intrin(treeNode->AsHWIntrinsic());
treeNeedsConsecutiveRegisters = HWIntrinsicInfo::NeedsConsecutiveRegisters(intrin.id);
}

if (refType == RefTypeDef)
{
if (treeNode->OperIsHWIntrinsic())
return treeNeedsConsecutiveRegisters;
}
else if (refType == RefTypeUse)
{
if (isIntervalRef() && getInterval()->isInternal)
{
const HWIntrinsic intrin(treeNode->AsHWIntrinsic());
return HWIntrinsicInfo::NeedsConsecutiveRegisters(intrin.id);
return treeNeedsConsecutiveRegisters;
}
return atConsecutiveRegsLoc;
}
else if ((refType == RefTypeUse) || (refType == RefTypeUpperVectorRestore))
else if (refType == RefTypeUpperVectorRestore)
{
return consecutiveRegistersLocation == nodeLocation;
return atConsecutiveRegsLoc;
}
return false;
}
Expand Down

0 comments on commit 3138206

Please sign in to comment.