Skip to content

Commit b09c5d5

Browse files
kunalspathakRuihan-Yin
authored andcommitted
LSRA: Make genRegMask() return regMaskTP (dotnet#102783)
* genRegMask * Make genRegMask() return regMaskTP, introduce genSingleTypeRegMask() for LSRA * Make allFloat,allMask regMaskTP instead of `SingleTypeRegSet` so no affect on non-LSRA code * jit format * fix build errors * fix loongarch and risc * fix a typo * move more `genSingleTypeRegMask()` * jit format * Make genRegMask() use genSingleType*() * fix build errors * jit format
1 parent 190fde7 commit b09c5d5

14 files changed

+254
-162
lines changed

src/coreclr/jit/codegeninterface.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -75,31 +75,31 @@ class CodeGenInterface
7575
}
7676

7777
#if defined(TARGET_AMD64)
78-
SingleTypeRegSet rbmAllFloat;
79-
SingleTypeRegSet rbmFltCalleeTrash;
78+
regMaskTP rbmAllFloat;
79+
regMaskTP rbmFltCalleeTrash;
8080

81-
FORCEINLINE SingleTypeRegSet get_RBM_ALLFLOAT() const
81+
FORCEINLINE regMaskTP get_RBM_ALLFLOAT() const
8282
{
8383
return this->rbmAllFloat;
8484
}
85-
FORCEINLINE SingleTypeRegSet get_RBM_FLT_CALLEE_TRASH() const
85+
FORCEINLINE regMaskTP get_RBM_FLT_CALLEE_TRASH() const
8686
{
8787
return this->rbmFltCalleeTrash;
8888
}
8989
#endif // TARGET_AMD64
9090

9191
#if defined(TARGET_XARCH)
92-
SingleTypeRegSet rbmAllMask;
93-
SingleTypeRegSet rbmMskCalleeTrash;
92+
regMaskTP rbmAllMask;
93+
regMaskTP rbmMskCalleeTrash;
9494

9595
// Call this function after the equivalent fields in Compiler have been initialized.
9696
void CopyRegisterInfo();
9797

98-
FORCEINLINE SingleTypeRegSet get_RBM_ALLMASK() const
98+
FORCEINLINE regMaskTP get_RBM_ALLMASK() const
9999
{
100100
return this->rbmAllMask;
101101
}
102-
FORCEINLINE SingleTypeRegSet get_RBM_MSK_CALLEE_TRASH() const
102+
FORCEINLINE regMaskTP get_RBM_MSK_CALLEE_TRASH() const
103103
{
104104
return this->rbmMskCalleeTrash;
105105
}

src/coreclr/jit/compiler.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -3485,12 +3485,12 @@ void Compiler::compInitOptions(JitFlags* jitFlags)
34853485
// Make sure we copy the register info and initialize the
34863486
// trash regs after the underlying fields are initialized
34873487

3488-
const SingleTypeRegSet vtCalleeTrashRegs[TYP_COUNT]{
3488+
const regMaskTP vtCalleeTrashRegs[TYP_COUNT]{
34893489
#define DEF_TP(tn, nm, jitType, sz, sze, asze, st, al, regTyp, regFld, csr, ctr, tf) ctr,
34903490
#include "typelist.h"
34913491
#undef DEF_TP
34923492
};
3493-
memcpy(varTypeCalleeTrashRegs, vtCalleeTrashRegs, sizeof(SingleTypeRegSet) * TYP_COUNT);
3493+
memcpy(varTypeCalleeTrashRegs, vtCalleeTrashRegs, sizeof(regMaskTP) * TYP_COUNT);
34943494

34953495
codeGen->CopyRegisterInfo();
34963496
#endif // TARGET_XARCH

src/coreclr/jit/compiler.h

+15-15
Original file line numberDiff line numberDiff line change
@@ -11246,8 +11246,8 @@ class Compiler
1124611246
//
1124711247
// Users of these values need to define four accessor functions:
1124811248
//
11249-
// SingleTypeRegSet get_RBM_ALLFLOAT();
11250-
// SingleTypeRegSet get_RBM_FLT_CALLEE_TRASH();
11249+
// regMaskTP get_RBM_ALLFLOAT();
11250+
// regMaskTP get_RBM_FLT_CALLEE_TRASH();
1125111251
// unsigned get_CNT_CALLEE_TRASH_FLOAT();
1125211252
// unsigned get_AVAILABLE_REG_COUNT();
1125311253
//
@@ -11256,16 +11256,16 @@ class Compiler
1125611256
// This was done to avoid polluting all `targetXXX.h` macro definitions with a compiler parameter, where only
1125711257
// TARGET_AMD64 requires one.
1125811258
//
11259-
SingleTypeRegSet rbmAllFloat;
11260-
SingleTypeRegSet rbmFltCalleeTrash;
11261-
unsigned cntCalleeTrashFloat;
11259+
regMaskTP rbmAllFloat;
11260+
regMaskTP rbmFltCalleeTrash;
11261+
unsigned cntCalleeTrashFloat;
1126211262

1126311263
public:
11264-
FORCEINLINE SingleTypeRegSet get_RBM_ALLFLOAT() const
11264+
FORCEINLINE regMaskTP get_RBM_ALLFLOAT() const
1126511265
{
1126611266
return this->rbmAllFloat;
1126711267
}
11268-
FORCEINLINE SingleTypeRegSet get_RBM_FLT_CALLEE_TRASH() const
11268+
FORCEINLINE regMaskTP get_RBM_FLT_CALLEE_TRASH() const
1126911269
{
1127011270
return this->rbmFltCalleeTrash;
1127111271
}
@@ -11284,8 +11284,8 @@ class Compiler
1128411284
//
1128511285
// Users of these values need to define four accessor functions:
1128611286
//
11287-
// SingleTypeRegSet get_RBM_ALLMASK();
11288-
// SingleTypeRegSet get_RBM_MSK_CALLEE_TRASH();
11287+
// regMaskTP get_RBM_ALLMASK();
11288+
// regMaskTP get_RBM_MSK_CALLEE_TRASH();
1128911289
// unsigned get_CNT_CALLEE_TRASH_MASK();
1129011290
// unsigned get_AVAILABLE_REG_COUNT();
1129111291
//
@@ -11294,17 +11294,17 @@ class Compiler
1129411294
// This was done to avoid polluting all `targetXXX.h` macro definitions with a compiler parameter, where only
1129511295
// TARGET_XARCH requires one.
1129611296
//
11297-
SingleTypeRegSet rbmAllMask;
11298-
SingleTypeRegSet rbmMskCalleeTrash;
11299-
unsigned cntCalleeTrashMask;
11300-
SingleTypeRegSet varTypeCalleeTrashRegs[TYP_COUNT];
11297+
regMaskTP rbmAllMask;
11298+
regMaskTP rbmMskCalleeTrash;
11299+
unsigned cntCalleeTrashMask;
11300+
regMaskTP varTypeCalleeTrashRegs[TYP_COUNT];
1130111301

1130211302
public:
11303-
FORCEINLINE SingleTypeRegSet get_RBM_ALLMASK() const
11303+
FORCEINLINE regMaskTP get_RBM_ALLMASK() const
1130411304
{
1130511305
return this->rbmAllMask;
1130611306
}
11307-
FORCEINLINE SingleTypeRegSet get_RBM_MSK_CALLEE_TRASH() const
11307+
FORCEINLINE regMaskTP get_RBM_MSK_CALLEE_TRASH() const
1130811308
{
1130911309
return this->rbmMskCalleeTrash;
1131011310
}

0 commit comments

Comments
 (0)