Skip to content

Commit f83e5a5

Browse files
jakobbotschmichaelgsharp
authored andcommitted
JIT: Remove LSRA arm32 quirk (dotnet#101791)
For arm32 this query can return an earlier location if the upper half register assigned to a TYP_DOUBLE interval has an earlier ref.
1 parent 2a05c20 commit f83e5a5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/coreclr/jit/lsra.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5874,6 +5874,8 @@ void LinearScan::allocateRegisters()
58745874
continue;
58755875
}
58765876

5877+
assert(!currentRefPosition.isPhysRegRef);
5878+
58775879
// If this is an exposed use, do nothing - this is merely a placeholder to attempt to
58785880
// ensure that a register is allocated for the full lifetime. The resolution logic
58795881
// will take care of moving to the appropriate register if needed.
@@ -13307,8 +13309,7 @@ regMaskTP LinearScan::RegisterSelection::select(Interval* current
1330713309

1330813310
// If there is another fixed reference to this register before the use, change the candidates
1330913311
// on this RefPosition to include that of nextRefPos.
13310-
// TODO-Quirk: Should pass right type here, but previously this didn't consider TYP_DOUBLE case for arm32.
13311-
unsigned nextFixedRegRefLocation = linearScan->getNextFixedRef(defReg, TYP_I_IMPL);
13312+
unsigned nextFixedRegRefLocation = linearScan->getNextFixedRef(defReg, currentInterval->registerType);
1331213313
if (nextFixedRegRefLocation <= nextRefPos->getRefEndLocation())
1331313314
{
1331413315
candidates |= nextRefPos->registerAssignment;
@@ -13768,7 +13769,7 @@ regMaskTP LinearScan::RegisterSelection::selectMinimal(Interval*
1376813769

1376913770
// If there is another fixed reference to this register before the use, change the candidates
1377013771
// on this RefPosition to include that of nextRefPos.
13771-
unsigned nextFixedRegRefLocation = linearScan->getNextFixedRef(defReg, TYP_I_IMPL);
13772+
unsigned nextFixedRegRefLocation = linearScan->getNextFixedRef(defReg, currentInterval->registerType);
1377213773
if (nextFixedRegRefLocation <= nextRefPos->getRefEndLocation())
1377313774
{
1377413775
candidates |= nextRefPos->registerAssignment;

0 commit comments

Comments
 (0)