Skip to content

Commit b179e19

Browse files
authored
Kill REG_PROFILER_RET_SCRATCH (dotnet#37679)
1 parent a70a2db commit b179e19

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/coreclr/src/jit/lsraarm.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,8 @@ int LinearScan::BuildNode(GenTree* tree)
492492

493493
case GT_RETURN:
494494
srcCount = BuildReturn(tree);
495+
killMask = getKillSetForReturn();
496+
BuildDefsWithKills(tree, 0, RBM_NONE, killMask);
495497
break;
496498

497499
case GT_RETFILT:

src/coreclr/src/jit/target.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,9 @@ typedef unsigned char regNumberSmall;
11031103
// The registers trashed by profiler enter/leave/tailcall hook
11041104
// See vm\arm\asmhelpers.asm for more details.
11051105
#define RBM_PROFILER_ENTER_TRASH RBM_NONE
1106-
#define RBM_PROFILER_LEAVE_TRASH RBM_NONE
1106+
// While REG_PROFILER_RET_SCRATCH is not trashed by the method, the register allocator must
1107+
// consider it killed by the return.
1108+
#define RBM_PROFILER_LEAVE_TRASH RBM_PROFILER_RET_SCRATCH
11071109
#define RBM_PROFILER_TAILCALL_TRASH RBM_NONE
11081110

11091111
// Which register are int and long values returned in ?

0 commit comments

Comments
 (0)