Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIT: Rewrite register parameter homing #100572

Merged
merged 27 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
40b32cd
JIT: Rewrite register parameter homing
jakobbotsch Apr 3, 2024
bf43089
Remove more unnecessary stuff
jakobbotsch Apr 3, 2024
803b86c
Clean up
jakobbotsch Apr 3, 2024
843c1c8
Handle by register instead of edge
jakobbotsch Apr 3, 2024
0b445fb
Handle circularity v1
jakobbotsch Apr 3, 2024
b04c7a1
Simplify, remove args when no longer busy
jakobbotsch Apr 3, 2024
d3ea5d3
Handle init reg properly
jakobbotsch Apr 4, 2024
e3ba587
Merge branch 'main' of github.com:dotnet/runtime into register-homing
jakobbotsch Apr 4, 2024
fb3a7fe
Add stress mode
jakobbotsch Apr 4, 2024
7926f1e
Fix after merge
jakobbotsch Apr 4, 2024
705090d
Enable it always for CI run
jakobbotsch Apr 4, 2024
2a49d31
Merge branch 'main' of github.com:dotnet/runtime into register-homing
jakobbotsch Apr 5, 2024
fcaa40a
Fix after merge
jakobbotsch Apr 5, 2024
0b04efc
Make multiple edges for arm32 doubles
jakobbotsch Apr 6, 2024
0e20159
Simplify
jakobbotsch Apr 6, 2024
753bdd5
Further simplification
jakobbotsch Apr 6, 2024
993e883
Run jit-format
jakobbotsch Apr 6, 2024
85fd667
Fix release build
jakobbotsch Apr 6, 2024
196c7d7
Fix RISC-V build
jakobbotsch Apr 6, 2024
f271cc5
Move new stress logic into its own function in LSRA
jakobbotsch Apr 6, 2024
9d7bbbe
Disable stress mode by default
jakobbotsch Apr 6, 2024
22acb2a
Fix build, hopefully last cleanup
jakobbotsch Apr 6, 2024
3355002
Add function headers and fix a comment
jakobbotsch Apr 6, 2024
bbdc3d0
Add arm32 double move optimization
jakobbotsch Apr 7, 2024
6ab6749
Rename FindNodeToHandle -> FindNodeToProcess
jakobbotsch Apr 8, 2024
865bd4d
Merge branch 'main' of github.com:dotnet/runtime into register-homing
jakobbotsch Apr 9, 2024
75126d7
Switch lvaParameterPassingInfo accesses to lvaGetParameterABIInfo
jakobbotsch Apr 9, 2024
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
16 changes: 11 additions & 5 deletions src/coreclr/jit/abi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ unsigned ABIPassingSegment::GetStackOffset() const
}

//-----------------------------------------------------------------------------
// GetRegisterStoreType:
// Return a type that can be used to store from the register this segment is
// in, taking the segment's size into account.
// GetRegisterType:
// Return the smallest type larger or equal to Size that most naturally
// represents the register this segment is passed in.
//
// Return Value:
// A type that matches ABIPassingSegment::Size and the register type.
// A type that matches ABIPassingSegment::Size and the register.
//
var_types ABIPassingSegment::GetRegisterStoreType() const
var_types ABIPassingSegment::GetRegisterType() const
{
assert(IsPassedInRegister());
if (genIsValidFloatReg(m_register))
Expand All @@ -110,6 +110,7 @@ var_types ABIPassingSegment::GetRegisterStoreType() const
return TYP_SIMD16;
#endif
default:
assert(!"Unexpected size for floating point register");
return TYP_UNDEF;
}
}
Expand All @@ -121,13 +122,18 @@ var_types ABIPassingSegment::GetRegisterStoreType() const
return TYP_UBYTE;
case 2:
return TYP_USHORT;
case 3:
case 4:
return TYP_INT;
#ifdef TARGET_64BIT
case 5:
case 6:
case 7:
case 8:
return TYP_LONG;
#endif
default:
assert(!"Unexpected size for integer register");
return TYP_UNDEF;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ABIPassingSegment
// offset, relative to the base of stack arguments.
unsigned GetStackOffset() const;

var_types GetRegisterStoreType() const;
var_types GetRegisterType() const;

static ABIPassingSegment InRegister(regNumber reg, unsigned offset, unsigned size);
static ABIPassingSegment OnStack(unsigned stackOffset, unsigned offset, unsigned size);
Expand Down
14 changes: 7 additions & 7 deletions src/coreclr/jit/codegen.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,13 @@ class CodeGen final : public CodeGenInterface
// Prolog functions and data (there are a few exceptions for more generally used things)
//

void genEstablishFramePointer(int delta, bool reportUnwindData);
#if defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV64)
void genFnPrologCalleeRegArgs();
#else
void genFnPrologCalleeRegArgs(regNumber xtraReg, bool* pXtraRegClobbered, RegState* regState);
#endif
void genEnregisterIncomingStackArgs();
void genEstablishFramePointer(int delta, bool reportUnwindData);
void genHomeRegisterParams(regNumber initReg, bool* initRegStillZeroed);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bool could be a return value, but seems ok this way too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also most functions are using this pattern so it seems good to be consistent.

regMaskTP genGetParameterHomingTempRegisterCandidates();

var_types genParamStackStoreType(LclVarDsc* dsc, const ABIPassingSegment& seg);
void genSpillOrAddRegisterParam(unsigned lclNum, class RegGraph* graph);
void genEnregisterIncomingStackArgs();
#if defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV64)
void genEnregisterOSRArgsAndLocals(regNumber initReg, bool* pInitRegZeroed);
#else
Expand Down
Loading
Loading