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

Handle > 64 registers + predicate registers for Arm64 #98258

Closed
wants to merge 212 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
212 commits
Select commit Hold shift + click to select a range
dcb4b16
Introduce regMaskGpr, regMaskFloat, regMaskPredicate
kunalspathak Feb 7, 2024
87b0f97
Add IsGpr() and IsFloat()
kunalspathak Feb 7, 2024
ba62855
Renamed to regMaskOnlyOne and regMaskAny
kunalspathak Feb 7, 2024
375bf8e
convert from #define to typedef for better intellisense support
kunalspathak Feb 7, 2024
da71584
Make IsGprRegMask() and IsFloatRegMask()
kunalspathak Feb 7, 2024
0ba172e
Update codegen.h and related code
kunalspathak Feb 7, 2024
8639bb7
Update codegenarm.cpp and related code
kunalspathak Feb 7, 2024
3c5bdaf
Update codegenarm64.cpp and related code
kunalspathak Feb 7, 2024
bad9e8b
Update codegenarmarch.cpp and related code
kunalspathak Feb 7, 2024
8384ff2
Partial update codegencommon.cpp
kunalspathak Feb 8, 2024
c78dc4b
Update all gcRef and gcByRef to regMaskGpr
kunalspathak Feb 9, 2024
e05cece
Update codegencommon.cpp and related code
kunalspathak Feb 9, 2024
82ed9aa
Update codegeninterface.h and related code
kunalspathak Feb 9, 2024
91462c7
Update codegenxarch.cpp and related code
kunalspathak Feb 9, 2024
b9d1ed5
Update compiler.cpp and related code
kunalspathak Feb 9, 2024
83f0f01
Update compiler.h and related code
kunalspathak Feb 9, 2024
c3797e0
Update compiler.hpp and related code
kunalspathak Feb 9, 2024
147891c
Update emit.cpp and related code
kunalspathak Feb 9, 2024
2238e41
Update emit.h and related code
kunalspathak Feb 9, 2024
e5e71d1
Update emitxarch.cpp and related code
kunalspathak Feb 9, 2024
7e15435
Update gentree.cpp and related code
kunalspathak Feb 9, 2024
6bbc2d2
Update gentree.h and related code
kunalspathak Feb 9, 2024
3e3d51a
Update lclvars.cpp and related code
kunalspathak Feb 9, 2024
41959f2
Update morph.cpp and related code
kunalspathak Feb 9, 2024
4b72781
Update regalloc.cpp and related code
kunalspathak Feb 9, 2024
7214d7b
Update registerargconvention.h and related code
kunalspathak Feb 9, 2024
c7e913e
Update regset.cpp and related code
kunalspathak Feb 9, 2024
d417ad5
Update regset.h and related code
kunalspathak Feb 9, 2024
dc54b20
Update target.h and related code
kunalspathak Feb 9, 2024
5b8a1e6
Update targetamd64.h and related code
kunalspathak Feb 9, 2024
c79e9fe
Update targetarm.cpp and related code
kunalspathak Feb 9, 2024
9171cd8
Update targetarm.h and related code
kunalspathak Feb 9, 2024
0aeefe1
Update targetarm64.cpp and related code
kunalspathak Feb 9, 2024
9ccaabb
Update targetarm64.h and related code
kunalspathak Feb 9, 2024
806fc03
Update targetx86.cpp and related code
kunalspathak Feb 9, 2024
757d8f2
Update targetx86.h and related code
kunalspathak Feb 9, 2024
e6b3304
Update unwindarmarch.cpp and related code
kunalspathak Feb 9, 2024
48e2e32
Update utils.cpp and related code
kunalspathak Feb 9, 2024
93f87fa
Add singleRegMask and some notes in target.h
kunalspathak Feb 10, 2024
f2c8219
Update lsra.cpp and related code
kunalspathak Feb 10, 2024
8e97320
Update lsra.h and related code
kunalspathak Feb 10, 2024
1b24a61
fix compilation error for singleRegMask
kunalspathak Feb 10, 2024
1842bc2
Update lsraarm.cpp and related code
kunalspathak Feb 10, 2024
d3d81fe
Update lsraarm64.cpp and related code
kunalspathak Feb 10, 2024
43a19d6
Update lsraarmarch.cpp and related code
kunalspathak Feb 10, 2024
cdad314
Update lsrabuild.cpp and related code
kunalspathak Feb 10, 2024
7937068
Update lsraxarch.cpp and related code
kunalspathak Feb 10, 2024
82000a5
Convert the return type of genRegMask() from `regMaskAny` to `singleR…
kunalspathak Feb 10, 2024
515383b
Rename regMaskAny to regMaskMixed
kunalspathak Feb 10, 2024
3fb09bb
Update design notes of target.h
kunalspathak Feb 10, 2024
cdb42bc
fix the typo
kunalspathak Feb 10, 2024
e2cc19b
Update the assert in IsOnlyOneRegMask()
kunalspathak Feb 10, 2024
656629e
Fix assert in buildUpperVectorSaveRefPositions()
kunalspathak Feb 10, 2024
ec471e5
Revert to buildUpperVectorSaveRefPositions() to regMaskFloat
kunalspathak Feb 12, 2024
ac8b5ea
Change BuildDefs() to regMaskMixed
kunalspathak Feb 12, 2024
8e17746
jit format
kunalspathak Feb 12, 2024
0659741
Convert m_RegistersWithConstants to regMaskOnlyOne
kunalspathak Feb 12, 2024
15135f8
temp: Convert m_AvailableRegs to regMaskOnlyOne
kunalspathak Feb 13, 2024
4c6cfda
Add a TODO to convert m_Regs to separate variables
kunalspathak Feb 13, 2024
e08561b
Handle various `regsModified` and `RBM_` to return AllRegsMask
kunalspathak Feb 16, 2024
b1cad44
Update genPoisonFrame()
kunalspathak Feb 16, 2024
65dbc13
Merge remote-tracking branch 'origin/main' into predicate-registers
kunalspathak Feb 16, 2024
dabf8f5
Fix some of the reserved registers and related code paths
kunalspathak Feb 29, 2024
b3febfa
Add AllRegsMask for *VarRegs() method
kunalspathak Mar 1, 2024
16cdcf9
Remove regMaskMixed from emitxarch.cpp
kunalspathak Mar 1, 2024
2849c8d
Remove regMaskMixed from *gcinfo.*
kunalspathak Mar 1, 2024
eeb173a
Remove regMaskMixed from TempReg()
kunalspathak Mar 1, 2024
500b78a
Handled unwind.cpp
kunalspathak Mar 1, 2024
ae53e67
Remove regMaskMixed from misc places
kunalspathak Mar 1, 2024
03eab41
fix unwind build error
kunalspathak Mar 2, 2024
729debf
fix the handling of RemoveMaskVars()
kunalspathak Mar 4, 2024
951e9c6
Fix makeRegAvailable and setRegInUse for registerType/reg inconsistency
kunalspathak Mar 5, 2024
c66b485
fix some printing the dumps
kunalspathak Mar 5, 2024
2017d52
Add support for BuildKills/BuildDefs/BuildCall
kunalspathak Mar 6, 2024
90883b8
gentree: gtGetRegMask() and updating Npt
kunalspathak Mar 6, 2024
931001d
Remove regMaskMixed from lsraarmarch.cpp
kunalspathak Mar 8, 2024
bda4c07
Remove regMaskMixed lsra: resolveEdge, tempRegForResolution
kunalspathak Mar 8, 2024
2cddfdb
Remove regMaskMixed - lsra:getConstrainedRegMask()
kunalspathak Mar 8, 2024
a353db4
Remove regMaskMixed - lsra:freeRegister
kunalspathak Mar 10, 2024
a767406
Remove regMaskMixed - lsra:fixedRegs, registersToDump, etc.
kunalspathak Mar 11, 2024
fba4c09
Fix some typo issues
kunalspathak Mar 11, 2024
7401f00
Remove regMaskMixed: getMatchingConstants
kunalspathak Mar 11, 2024
0d6a0bf
Remove regMaskMixed: placedArgRegs
kunalspathak Mar 11, 2024
91ae489
Remove regMaskMixed from lsra.h
kunalspathak Mar 11, 2024
3d3938e
Remove regMaskMixed : lsra.cpp mostly
kunalspathak Mar 11, 2024
f2b172d
Remove regMaskMixed: lsra.cpp/resolveEdge/targetRegsToDo
kunalspathak Mar 11, 2024
0f0c60e
Remove regMaskMixed: lsra.cpp/resolveEdge/targetRegsReady
kunalspathak Mar 11, 2024
2fbef79
Remove regMaskMixed: lsra.cpp/resolveEdge/targetRegsFromStack
kunalspathak Mar 11, 2024
dbb9be3
Complete the remaining ones
kunalspathak Mar 11, 2024
1dd8e1b
Merge remote-tracking branch 'origin/main' into predicate-registers
kunalspathak Mar 11, 2024
1388622
merge errors
kunalspathak Mar 11, 2024
9c4942d
jit format
kunalspathak Mar 11, 2024
15c482f
fix some build errors and failures
kunalspathak Mar 11, 2024
37b6cce
Remove the assert(false)
kunalspathak Mar 12, 2024
e89a3ee
Pass dstCount for BuildDefWithKills()
kunalspathak Mar 12, 2024
a2c99a0
Fix dspRegMask for compilation errors:
kunalspathak Mar 12, 2024
3c80871
fix some more asserts
kunalspathak Mar 12, 2024
9e597bc
fix arm issue
kunalspathak Mar 12, 2024
badf863
jit format
kunalspathak Mar 12, 2024
27e6bdf
fix the asmdiff for windows/x64
kunalspathak Mar 12, 2024
72ce973
Merge remote-tracking branch 'origin/main' into merge-predicate-regis…
kunalspathak Mar 12, 2024
e7ee960
fix the JITStressRegs AV
kunalspathak Mar 13, 2024
85ed5a6
Introduce rbmAllFloats in emit*
kunalspathak Mar 13, 2024
9199913
fix the masks creation
kunalspathak Mar 13, 2024
3db212d
Merge remote-tracking branch 'kp/predicate-registers' into predicate-…
kunalspathak Mar 13, 2024
ab4ec81
Condition free code: reduce TP from 5% -> 3%
kunalspathak Mar 16, 2024
b1bbbbf
Some rename methods of AllRegsMask
kunalspathak Mar 16, 2024
5ca0332
fix some issues
kunalspathak Mar 18, 2024
502acd8
Merge remote-tracking branch 'origin' into predicate-registers
kunalspathak Mar 18, 2024
f283c30
fix merge conflict issues
kunalspathak Mar 18, 2024
e936cb7
Refactoring
kunalspathak Mar 19, 2024
150dd94
jit format
kunalspathak Mar 19, 2024
679cca8
Make the IsGprRegMask() and IsFloatRegMask() checks more robust
kunalspathak Mar 19, 2024
6e48e2a
Mark bunch of methods as FORCEINLINE, added TODO for others
kunalspathak Mar 19, 2024
e6e2269
Revert "Mark bunch of methods as FORCEINLINE, added TODO for others"
kunalspathak Mar 20, 2024
6af17c4
Change RegSet to use AllRegMask branch-free
kunalspathak Mar 20, 2024
ce78527
Misc change around rsRegsModified
kunalspathak Mar 20, 2024
314c464
Make some methods out of #ifdef DEBUG
kunalspathak Mar 20, 2024
973e14e
Pass AllRegsMask& by reference
kunalspathak Mar 20, 2024
4551999
Fix the byref problem
kunalspathak Mar 21, 2024
522fbd8
Mark AllRegsMask operators as FORCEINLINE
kunalspathak Mar 21, 2024
020b709
Mark AllRegsMask methods as FORCEINLINE
kunalspathak Mar 21, 2024
31a940e
Prototype of union using _float_gpr
kunalspathak Mar 24, 2024
8649987
hide predicate logic under #ifdef to see TP impact. It is just 0.5% r…
kunalspathak Mar 25, 2024
25bdad9
Remove GetMaskForRegNum()
kunalspathak Mar 26, 2024
e5d5e3b
fix the creation of certain masks
kunalspathak Mar 26, 2024
951b260
Introduce HAS_MORE_THAN_64_REGISTERS
kunalspathak Mar 26, 2024
33063eb
Introduce _hasPredicateRegister
kunalspathak Mar 28, 2024
ed29d62
fix some bugs
kunalspathak Mar 30, 2024
896fb35
Merge remote-tracking branch 'origin/main' into predicate/more-than-64
kunalspathak Mar 30, 2024
8ee87f4
fix some merge conflict
kunalspathak Mar 30, 2024
f1ae83c
Eliminate HAS_PREDICATE_REGS with FEATURE_MASKED_HW_INTRINSICS/HAS_MO…
kunalspathak Mar 31, 2024
6c2eb77
jit format
kunalspathak Mar 31, 2024
af618db
Merge remote-tracking branch 'origin/main' into predicate/more-than-64
kunalspathak Apr 1, 2024
f94e6cf
Arm64: Have predicate registers from 64~79
kunalspathak Apr 1, 2024
d560200
Add FEATURE_MASKED_HW_INSTRINSICS at few more places
kunalspathak Apr 1, 2024
5ff6d61
Have own version of updateDeadCandidatesAtBlockStart for AllRegsMask
kunalspathak Apr 1, 2024
8d6a2b6
Fix resetting availableMaskRegs
kunalspathak Apr 1, 2024
57a0746
Remove some unneeded methods from AllRegsMask
kunalspathak Apr 1, 2024
1e960b4
Arm64: Update predicate callee-saved and callee-trash registers
kunalspathak Apr 1, 2024
adc51ac
update save/restore of predicate registers on arm64
kunalspathak Apr 1, 2024
06e31ec
Remove _hasPredicateRegister
kunalspathak Apr 1, 2024
e4700f8
fix gprRegs()
kunalspathak Apr 2, 2024
6763c70
Restruture AllRegsMask to remove build errors for linux
kunalspathak Apr 2, 2024
5a69528
Replace _float_gpr and _allRegisters with _combinedRegisters
kunalspathak Apr 2, 2024
704fcb1
fix assert in arm64
kunalspathak Apr 2, 2024
dda6d8a
fix some #define and remove Create_AllRegsMask()
kunalspathak Apr 2, 2024
8adc9f7
fix arm build break
kunalspathak Apr 2, 2024
4461bdd
Arm64: Increase REGNUM_BITS 6->7
kunalspathak Apr 2, 2024
5d4f507
fix sve unit test
kunalspathak Apr 2, 2024
fc1ff92
fix osx/arm64 replay failures
kunalspathak Apr 2, 2024
f27b326
fix dumpRegMask()
kunalspathak Apr 3, 2024
e9f0a46
Introduce MORE_THAN_64_REG_ARG
kunalspathak Apr 3, 2024
f6f1e03
Update genRegNumFromMask() to take MORE_THAN_64_REG_ARG
kunalspathak Apr 3, 2024
e808d0f
Update genFirstRegNumFromMask() to take MORE_THAN_64_REG_ARG
kunalspathak Apr 3, 2024
cdabdcf
Handle TYP_MASK in getTempRegForResolution()
kunalspathak Apr 3, 2024
47c683f
Add assert in genUpdateRegLife()
kunalspathak Apr 3, 2024
611ed21
Update genFirstRegNumFromMaskAndToggle() to take MORE_THAN_64_REG_ARG
kunalspathak Apr 3, 2024
b29b417
fix freeRegisterMask() typo
kunalspathak Apr 3, 2024
25b9893
Display predicate registers in Allocation table
kunalspathak Apr 3, 2024
952af0d
make gprRegs() use RBM_ALLINT
kunalspathak Apr 3, 2024
ce370e3
Fix JITDump for AllMask
kunalspathak Apr 3, 2024
6f96b57
make floatRegs() and predicateRegs() use RBM_ALLFLOAT/RBM_ALLMASK
kunalspathak Apr 3, 2024
ff56a4f
fix the dumping of gpr/float registers
kunalspathak Apr 4, 2024
bff97e5
Introduce RBM_ALLGPR
kunalspathak Apr 4, 2024
49194e1
move getRegType from lsra.h -> target.h
kunalspathak Apr 4, 2024
9041b49
Rewrite AddRegNum/RemoveRegNum/IsRegNum for arm
kunalspathak Apr 4, 2024
ccba323
jit format 17.0.6
kunalspathak Apr 4, 2024
1fefa86
Merge remote-tracking branch 'origin/main' into temp
kunalspathak Apr 4, 2024
82a3518
jit format 17.0.6
kunalspathak Apr 4, 2024
3407277
Merge remote-tracking branch 'origin/main' into predicate/more-than-64
kunalspathak Apr 4, 2024
e43bd80
jit format
kunalspathak Apr 4, 2024
4f546c6
some fixes + formatting
kunalspathak Apr 5, 2024
7657166
Merge remote-tracking branch 'origin/main' into predicate/more-than-64
kunalspathak Apr 5, 2024
a1f157b
Fix changes from swift
kunalspathak Apr 5, 2024
40bb3b1
Fix the argument for AllRegsMask()
kunalspathak Apr 5, 2024
506dc9f
Remove TODO #1
kunalspathak Apr 7, 2024
847701c
Remove TODO #2
kunalspathak Apr 9, 2024
1289175
Refactor freeRegsiterMask()
kunalspathak Apr 9, 2024
5ba1773
Return `RegBit64` for gtGetContainedRegMask(), gtGetRegMask()
kunalspathak Apr 9, 2024
4f4c317
Remove another TODO
kunalspathak Apr 9, 2024
dc6ff1f
Remaining gtGetContainedRegMask() fix
kunalspathak Apr 9, 2024
80faa40
Move registerType to Referencable
kunalspathak Apr 9, 2024
204d17b
Mark some of the AllRegsMask as const
kunalspathak Apr 9, 2024
5d16126
Replace AllRegsMask() with AllRegsMask_NONE
kunalspathak Apr 9, 2024
99de237
Added CONSTREF and REF to pass AllRegsMask by (const) reference
kunalspathak Apr 9, 2024
13819f6
Merge remote-tracking branch 'origin/main' into predicate/more-than-64
kunalspathak Apr 9, 2024
baf4e36
fix the merge conflicts from parameter homing
kunalspathak Apr 9, 2024
78614fa
jit format
kunalspathak Apr 9, 2024
ad513dc
Move from target definition to compiler object
kunalspathak Apr 10, 2024
c38cfdb
Use AllRegsMask_* from compiler object
kunalspathak Apr 10, 2024
3b1eeed
WIP: Make methods return CONSTREF
kunalspathak Apr 10, 2024
d8ba174
Introduce compInitAllRegsMask()
kunalspathak Apr 10, 2024
0ccb59a
Remove rsAllCalleeSavedMask from RegSet
kunalspathak Apr 10, 2024
e27691c
Revert "Remove rsAllCalleeSavedMask from RegSet"
kunalspathak Apr 10, 2024
dc96a99
Move the initialization of rbmAllFloat inside compInitAllRegsMask()
kunalspathak Apr 10, 2024
cba4510
Reapply "Remove rsAllCalleeSavedMask from RegSet"
kunalspathak Apr 10, 2024
fc6b76f
Move codeGen->CopyRegisterInfo() in compInitAllRegsMask()
kunalspathak Apr 10, 2024
3df5a5d
Copy calleeTrashRegs info as well
kunalspathak Apr 10, 2024
c591106
Make emitGetGCRegsKilledByNoGCCall() return CONSTREF_
kunalspathak Apr 10, 2024
72f27e8
fix some more CONSTREF
kunalspathak Apr 10, 2024
e1823d4
Consolidate updateDeadCandidates and inActivateRegisters
kunalspathak Apr 10, 2024
41d49af
Replace AllRegsMask_NONE with .Clear()
kunalspathak Apr 10, 2024
8e448c5
Add AllRegsMask in clrjit.natvis:
kunalspathak Apr 10, 2024
e5eb8e4
Remove the commented out #define
kunalspathak Apr 10, 2024
7e522f1
Make emitGetGCRegsKilledByNoGCCall() return RegbitSet64 instead of Al…
kunalspathak Apr 10, 2024
3eb1237
emitGetGCRegsSaveOrModified() returns RegBitSet64
kunalspathak Apr 10, 2024
335b2b5
add back some RBM_* in target**
kunalspathak Apr 10, 2024
c60f3b1
misc. cleanup
kunalspathak Apr 10, 2024
7042510
jit format
kunalspathak Apr 10, 2024
22077eb
fix linux-x86 build
kunalspathak Apr 10, 2024
893f6be
fix linux-x64 Native_GCC build error
kunalspathak Apr 10, 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
14 changes: 7 additions & 7 deletions src/coreclr/inc/patchpointinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct PatchpointInfo
// Initialize
void Initialize(unsigned localCount, int totalFrameSize)
{
m_calleeSaveRegisters = 0;
m_calleeSaveGprRegisters = 0;
m_totalFrameSize = totalFrameSize;
m_numberOfLocals = localCount;
m_genericContextArgOffset = -1;
Expand All @@ -49,7 +49,7 @@ struct PatchpointInfo
// Copy
void Copy(const PatchpointInfo* original)
{
m_calleeSaveRegisters = original->m_calleeSaveRegisters;
m_calleeSaveGprRegisters = original->m_calleeSaveGprRegisters;
m_genericContextArgOffset = original->m_genericContextArgOffset;
m_keptAliveThisOffset = original->m_keptAliveThisOffset;
m_securityCookieOffset = original->m_securityCookieOffset;
Expand Down Expand Up @@ -163,14 +163,14 @@ struct PatchpointInfo
// Callee save registers saved by the original method.
// Includes all saves that must be restored (eg includes pushed RBP on x64).
//
uint64_t CalleeSaveRegisters() const
uint64_t CalleeSaveGprRegisters() const
{
return m_calleeSaveRegisters;
return m_calleeSaveGprRegisters;
}

void SetCalleeSaveRegisters(uint64_t registerMask)
void SetCalleeSaveGprRegisters(uint64_t gprRegs)
{
m_calleeSaveRegisters = registerMask;
m_calleeSaveGprRegisters = gprRegs;
}

private:
Expand All @@ -180,7 +180,7 @@ struct PatchpointInfo
EXPOSURE_MASK = 0x1
};

uint64_t m_calleeSaveRegisters;
uint64_t m_calleeSaveGprRegisters;
unsigned m_numberOfLocals;
int m_totalFrameSize;
int m_genericContextArgOffset;
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/jit/abi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ regNumber ABIPassingSegment::GetRegister() const
// Return Value:
// The register mask.
//
regMaskTP ABIPassingSegment::GetRegisterMask() const
regMaskOnlyOne ABIPassingSegment::GetRegisterMask() const
{
assert(IsPassedInRegister());
regMaskTP reg = genRegMask(m_register);
regMaskOnlyOne reg = genRegMask(m_register);

#ifdef TARGET_ARM
if (genIsValidFloatReg(m_register) && (Size == 8))
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 @@ -25,7 +25,7 @@ class ABIPassingSegment
// If this segment is passed in a register, return the particular register.
regNumber GetRegister() const;

regMaskTP GetRegisterMask() const;
regMaskOnlyOne GetRegisterMask() const;

// If this segment is passed on the stack then return the particular stack
// offset, relative to the base of stack arguments.
Expand Down
18 changes: 10 additions & 8 deletions src/coreclr/jit/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -1601,8 +1601,8 @@ struct BasicBlock : private LIR::Range
// is bbCodeOffsEnd - bbCodeOffs, assuming neither are BAD_IL_OFFSET.

#ifdef DEBUG
void dspBlockILRange() const; // Display the block's IL range as [XXX...YYY), where XXX and YYY might be "???" for
// BAD_IL_OFFSET.
void dspBlockILRange() const; // Display the block's IL range as [XXX...YYY), where XXX and YYY might be "???"
// for BAD_IL_OFFSET.
#endif // DEBUG

VARSET_TP bbVarUse; // variables used by block (before a definition)
Expand Down Expand Up @@ -1642,8 +1642,8 @@ struct BasicBlock : private LIR::Range
};
static MemoryPhiArg* EmptyMemoryPhiDef; // Special value (0x1, FWIW) to represent a to-be-filled in Phi arg list
// for Heap.
MemoryPhiArg* bbMemorySsaPhiFunc[MemoryKindCount]; // If the "in" Heap SSA var is not a phi definition, this value
// is NULL.
MemoryPhiArg* bbMemorySsaPhiFunc[MemoryKindCount]; // If the "in" Heap SSA var is not a phi definition, this
// value is NULL.
// Otherwise, it is either the special value EmptyMemoryPhiDefn, to indicate
// that Heap needs a phi definition on entry, or else it is the linked list
// of the phi arguments.
Expand Down Expand Up @@ -1677,7 +1677,8 @@ struct BasicBlock : private LIR::Range
{
EXPSET_TP bbCseOut; // CSEs available on exit
ASSERT_TP bbAssertionOut; // assertions available on exit (global prop, local prop & !BBJ_COND)
ASSERT_TP bbAssertionOutIfFalse; // assertions available on exit along false/next edge (BBJ_COND, local prop)
ASSERT_TP bbAssertionOutIfFalse; // assertions available on exit along false/next edge (BBJ_COND, local
// prop)
};

void* bbEmitCookie;
Expand Down Expand Up @@ -1981,8 +1982,8 @@ struct BasicBlock : private LIR::Range
}
};

// BBCompilerSuccEdgeList: adapter class for forward iteration of block successors edges, using range-based `for`,
// normally used via BasicBlock::SuccEdges(), e.g.:
// BBCompilerSuccEdgeList: adapter class for forward iteration of block successors edges, using range-based
// `for`, normally used via BasicBlock::SuccEdges(), e.g.:
// for (FlowEdge* const succEdge : block->SuccEdges(compiler)) ...
//
// This version uses NumSucc(Compiler*)/GetSucc(Compiler*). See the documentation there for the explanation
Expand Down Expand Up @@ -2448,7 +2449,8 @@ inline BasicBlock* BBArrayIterator::operator*() const
return edgeTarget->getDestinationBlock();
}

// Pred list iterator implementations (that are required to be defined after the declaration of BasicBlock and FlowEdge)
// Pred list iterator implementations (that are required to be defined after the declaration of BasicBlock and
// FlowEdge)

inline PredEdgeList::iterator::iterator(FlowEdge* pred)
: m_pred(pred)
Expand Down
45 changes: 30 additions & 15 deletions src/coreclr/jit/clrjit.natvis
Original file line number Diff line number Diff line change
Expand Up @@ -139,26 +139,26 @@ Documentation for VS debugger format specifiers: https://learn.microsoft.com/en-
</CustomListItems>
<Item Name="AvailableRegs mask">this-&gt;m_AvailableRegs</Item>
<CustomListItems>
<Variable Name="reg" InitialValue="this->m_AvailableRegs" />
<Variable Name="regIndex" InitialValue="0" />
<Loop Condition="reg != 0">
<Item Condition="(reg &amp; 1) != 0">((regNumber)regIndex),en</Item>
<Exec>regIndex++</Exec>
<Exec>reg = reg >> 1</Exec>
</Loop>
<Variable Name="reg" InitialValue="this->m_AvailableRegs" />
<Variable Name="regIndex" InitialValue="0" />
<Loop Condition="reg != 0">
<Item Condition="(reg &amp; 1) != 0">((regNumber)regIndex),en</Item>
<Exec>regIndex++</Exec>
<Exec>reg = reg >> 1</Exec>
</Loop>
</CustomListItems>
<Item Name="RegistersWithConstants mask">this-&gt;m_RegistersWithConstants</Item>
<CustomListItems>
<Variable Name="reg" InitialValue="this->m_RegistersWithConstants" />
<Variable Name="regIndex" InitialValue="0" />
<Loop Condition="reg != 0">
<Item Condition="(reg &amp; 1) != 0">((regNumber)regIndex),en</Item>
<Exec>regIndex++</Exec>
<Exec>reg = reg >> 1</Exec>
</Loop>
<Variable Name="reg" InitialValue="this->m_RegistersWithConstants" />
<Variable Name="regIndex" InitialValue="0" />
<Loop Condition="reg != 0">
<Item Condition="(reg &amp; 1) != 0">((regNumber)regIndex),en</Item>
<Exec>regIndex++</Exec>
<Exec>reg = reg >> 1</Exec>
</Loop>
</CustomListItems>
</Expand>
</Type>
</Type>

<Type Name="RefPosition">
<DisplayString>[#{rpNum,d} - {refType,en}]</DisplayString>
Expand All @@ -177,6 +177,21 @@ Documentation for VS debugger format specifiers: https://learn.microsoft.com/en-
</Expand>
</Type>

<Type Name="_regMaskAll">
<!--<DisplayString></DisplayString>-->
<Expand>
<CustomListItems>
<Variable Name="reg" InitialValue="this->_combinedRegisters" />
<Variable Name="regIndex" InitialValue="0" />
<Loop Condition="reg != 0">
<Item Condition="(reg &amp; 1) != 0">((regNumber)regIndex),en</Item>
<Exec>regIndex++</Exec>
<Exec>reg = reg >> 1</Exec>
</Loop>
</CustomListItems>
</Expand>
</Type>

<Type Name="Interval">
<DisplayString Condition="this->isUpperVector">[U{this->relatedInterval->varNum,d}, #{this->intervalIndex, d}, reg={(regNumber)physReg, en}]</DisplayString>
<DisplayString Condition="this->isLocalVar">[V{this->varNum,d}, #{this->intervalIndex, d}, reg={(regNumber)physReg, en}]</DisplayString>
Expand Down
73 changes: 42 additions & 31 deletions src/coreclr/jit/codegen.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,9 @@ 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);
void genHomeRegisterParams(regNumber initReg, bool* initRegStillZeroed);
regMaskTP genGetParameterHomingTempRegisterCandidates();
void genEstablishFramePointer(int delta, bool reportUnwindData);
void genHomeRegisterParams(regNumber initReg, bool* initRegStillZeroed);
RegBitSet64 genGetParameterHomingTempRegisterCandidates();

var_types genParamStackStoreType(LclVarDsc* dsc, const ABIPassingSegment& seg);
void genSpillOrAddRegisterParam(unsigned lclNum, class RegGraph* graph);
Expand Down Expand Up @@ -335,16 +335,23 @@ class CodeGen final : public CodeGenInterface
}
};

static void genBuildRegPairsStack(regMaskTP regsMask, ArrayStack<RegPair>* regStack);
static void genBuildRegPairsStack(regMaskOnlyOne regsMask,
ArrayStack<RegPair>* regStack MORE_THAN_64_REG_ARG(var_types type));
static void genSetUseSaveNextPairs(ArrayStack<RegPair>* regStack);

static int genGetSlotSizeForRegsInMask(regMaskTP regsMask);
static int genGetSlotSizeForRegsInMask(regMaskOnlyOne regsMask);

void genSaveCalleeSavedRegisterGroup(regMaskTP regsMask, int spDelta, int spOffset);
void genRestoreCalleeSavedRegisterGroup(regMaskTP regsMask, int spDelta, int spOffset);
void genSaveCalleeSavedRegisterGroup(regMaskOnlyOne regsMask,
int spDelta,
int spOffset MORE_THAN_64_REG_ARG(var_types type));
void genRestoreCalleeSavedRegisterGroup(regMaskOnlyOne regsMask,
int spDelta,
int spOffset MORE_THAN_64_REG_ARG(var_types type));

void genSaveCalleeSavedRegistersHelp(regMaskTP regsToSaveMask, int lowestCalleeSavedOffset, int spDelta);
void genRestoreCalleeSavedRegistersHelp(regMaskTP regsToRestoreMask, int lowestCalleeSavedOffset, int spDelta);
void genSaveCalleeSavedRegistersHelp(CONSTREF_AllRegsMask regsToSaveMask, int lowestCalleeSavedOffset, int spDelta);
void genRestoreCalleeSavedRegistersHelp(CONSTREF_AllRegsMask regsToRestoreMask,
int lowestCalleeSavedOffset,
int spDelta);

void genPushCalleeSavedRegisters(regNumber initReg, bool* pInitRegZeroed);

Expand All @@ -361,9 +368,9 @@ class CodeGen final : public CodeGenInterface
void genStackProbe(ssize_t frameSize, regNumber rOffset, regNumber rLimit, regNumber rPageSize);
#endif

void genAllocLclFrame(unsigned frameSize, regNumber initReg, bool* pInitRegZeroed, regMaskTP maskArgRegsLiveIn);
void genAllocLclFrame(unsigned frameSize, regNumber initReg, bool* pInitRegZeroed, regMaskGpr maskArgRegsLiveIn);

void genPoisonFrame(regMaskTP bbRegLiveIn);
void genPoisonFrame(regMaskGpr bbRegLiveIn);

#if defined(TARGET_ARM)

Expand All @@ -372,11 +379,9 @@ class CodeGen final : public CodeGenInterface

bool genStackPointerAdjustment(ssize_t spAdjustment, regNumber tmpReg);

void genPushFltRegs(regMaskTP regMask);
void genPopFltRegs(regMaskTP regMask);
regMaskTP genStackAllocRegisterMask(unsigned frameSize, regMaskTP maskCalleeSavedFloat);

regMaskTP genJmpCallArgMask();
void genPushFltRegs(regMaskFloat regMask);
void genPopFltRegs(regMaskFloat regMask);
regMaskGpr genStackAllocRegisterMask(unsigned frameSize, regMaskFloat maskCalleeSavedFloat);

void genFreeLclFrame(unsigned frameSize,
/* IN OUT */ bool* pUnwindStarted);
Expand All @@ -393,11 +398,12 @@ class CodeGen final : public CodeGenInterface
// same.
struct FuncletFrameInfoDsc
{
regMaskTP fiSaveRegs; // Set of registers saved in the funclet prolog (includes LR)
unsigned fiFunctionCallerSPtoFPdelta; // Delta between caller SP and the frame pointer
unsigned fiSpDelta; // Stack pointer delta
unsigned fiPSP_slot_SP_offset; // PSP slot offset from SP
int fiPSP_slot_CallerSP_offset; // PSP slot offset from Caller SP
regMaskGpr fiSaveGprRegs; // Set of GPR registers saved in the funclet prolog (includes LR)
regMaskFloat fiSaveFloatRegs; // Set of Float registers saved in the funclet prolog (includes LR)
unsigned fiFunctionCallerSPtoFPdelta; // Delta between caller SP and the frame pointer
unsigned fiSpDelta; // Stack pointer delta
unsigned fiPSP_slot_SP_offset; // PSP slot offset from SP
int fiPSP_slot_CallerSP_offset; // PSP slot offset from Caller SP
};

FuncletFrameInfoDsc genFuncletInfo;
Expand All @@ -409,7 +415,12 @@ class CodeGen final : public CodeGenInterface
// same.
struct FuncletFrameInfoDsc
{
regMaskTP fiSaveRegs; // Set of callee-saved registers saved in the funclet prolog (includes LR)
regMaskGpr fiSaveGprRegs; // Set of callee-saved GPR registers saved in the funclet prolog (includes LR)
regMaskFloat fiSaveFloatRegs; // Set of callee-saved float registers saved in the funclet prolog (includes LR)
#ifdef FEATURE_MASKED_HW_INTRINSICS
regMaskPredicate fiSavePredicateRegs; // Set of callee-saved predicate registers saved in the funclet prolog
// (includes LR)
#endif
int fiFunction_CallerSP_to_FP_delta; // Delta between caller SP and the frame pointer in the parent function
// (negative)
int fiSP_to_FPLR_save_delta; // FP/LR register save offset from SP (positive)
Expand Down Expand Up @@ -444,7 +455,7 @@ class CodeGen final : public CodeGenInterface
// and used by all funclet prologs and epilogs, which must all be the same.
struct FuncletFrameInfoDsc
{
regMaskTP fiSaveRegs; // Set of callee-saved registers saved in the funclet prolog (includes RA)
regMaskMixed fiSaveRegs; // Set of callee-saved registers saved in the funclet prolog (includes RA)
int fiFunction_CallerSP_to_FP_delta; // Delta between caller SP and the frame pointer in the parent function
// (negative)
int fiSP_to_CalleeSaved_delta; // CalleeSaved register save offset from SP (positive)
Expand All @@ -463,7 +474,7 @@ class CodeGen final : public CodeGenInterface
// and used by all funclet prologs and epilogs, which must all be the same.
struct FuncletFrameInfoDsc
{
regMaskTP fiSaveRegs; // Set of callee-saved registers saved in the funclet prolog (includes RA)
regMaskMixed fiSaveRegs; // Set of callee-saved registers saved in the funclet prolog (includes RA)
int fiFunction_CallerSP_to_FP_delta; // Delta between caller SP and the frame pointer in the parent function
// (negative)
int fiSP_to_CalleeSaved_delta; // CalleeSaved register save offset from SP (positive)
Expand All @@ -485,7 +496,7 @@ class CodeGen final : public CodeGenInterface

#endif // TARGET_XARCH

void genZeroInitFltRegs(const regMaskTP& initFltRegs, const regMaskTP& initDblRegs, const regNumber& initReg);
void genZeroInitFltRegs(const regMaskFloat& initFltRegs, const regMaskFloat& initDblRegs, const regNumber& initReg);

regNumber genGetZeroReg(regNumber initReg, bool* pInitRegZeroed);

Expand Down Expand Up @@ -533,7 +544,7 @@ class CodeGen final : public CodeGenInterface
//

#if defined(TARGET_ARM)
bool genCanUsePopToReturn(regMaskTP maskPopRegsInt, bool jmpEpilog);
bool genCanUsePopToReturn(bool jmpEpilog);
#endif

#if defined(TARGET_ARM64)
Expand All @@ -545,7 +556,7 @@ class CodeGen final : public CodeGenInterface
void genPopCalleeSavedRegisters(bool jmpEpilog = false);

#if defined(TARGET_XARCH)
unsigned genPopCalleeSavedRegistersFromMask(regMaskTP rsPopRegs);
unsigned genPopCalleeSavedRegistersFromMask(regMaskGpr rsPopRegs);
#endif // !defined(TARGET_XARCH)

#endif // !defined(TARGET_ARM64)
Expand Down Expand Up @@ -671,10 +682,10 @@ class CodeGen final : public CodeGenInterface
//
//-------------------------------------------------------------------------

void genSinglePush();
void genSinglePop();
regMaskTP genPushRegs(regMaskTP regs, regMaskTP* byrefRegs, regMaskTP* noRefRegs);
void genPopRegs(regMaskTP regs, regMaskTP byrefRegs, regMaskTP noRefRegs);
void genSinglePush();
void genSinglePop();
regMaskGpr genPushRegs(regMaskGpr regs, regMaskGpr* byrefRegs, regMaskGpr* noRefRegs);
void genPopRegs(regMaskGpr regs, regMaskGpr byrefRegs, regMaskGpr noRefRegs);

/*
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Expand Down
Loading
Loading