From dc5ad929fc17171a0635db37851530c901019012 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Thu, 23 May 2024 13:30:11 -0700 Subject: [PATCH 1/5] fix build break on osx/arm64 Debug --- src/coreclr/jit/regset.cpp | 28 ++++++++++++++++++++++++++++ src/coreclr/jit/regset.h | 27 +++------------------------ 2 files changed, 31 insertions(+), 24 deletions(-) diff --git a/src/coreclr/jit/regset.cpp b/src/coreclr/jit/regset.cpp index 2ef2f9c1e17f1..3003dbf2a60e3 100644 --- a/src/coreclr/jit/regset.cpp +++ b/src/coreclr/jit/regset.cpp @@ -44,6 +44,34 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */ +#ifdef SWIFT_SUPPORT + regMaskTP rsAllCalleeSavedMask; + regMaskTP rsIntCalleeSavedMask; +#else // !SWIFT_SUPPORT + static constexpr regMaskTP rsAllCalleeSavedMask = RBM_CALLEE_SAVED; + static constexpr regMaskTP rsIntCalleeSavedMask = RBM_INT_CALLEE_SAVED; +#endif // !SWIFT_SUPPORT + +regMaskTP RegSet::rsGetModifiedCalleeSavedRegsMask() const +{ + assert(rsModifiedRegsMaskInitialized); + return (rsModifiedRegsMask & rsAllCalleeSavedMask); +} + +#ifdef TARGET_AMD64 +regMaskTP RegSet::rsGetModifiedOsrIntCalleeSavedRegsMask() const +{ + assert(rsModifiedRegsMaskInitialized); + return (rsModifiedRegsMask & (rsIntCalleeSavedMask | RBM_EBP)); +} +#endif // TARGET_AMD64 + +regMaskTP RegSet::rsGetModifiedIntCalleeSavedRegsMask() const +{ + assert(rsModifiedRegsMaskInitialized); + return (rsModifiedRegsMask & rsIntCalleeSavedMask); +} + //------------------------------------------------------------------------ // verifyRegUsed: verify that the register is marked as used. // diff --git a/src/coreclr/jit/regset.h b/src/coreclr/jit/regset.h index 20b55610594fc..1ca2539f72958 100644 --- a/src/coreclr/jit/regset.h +++ b/src/coreclr/jit/regset.h @@ -74,14 +74,6 @@ class RegSet bool rsModifiedRegsMaskInitialized; // Has rsModifiedRegsMask been initialized? Guards against illegal use. #endif // DEBUG -#ifdef SWIFT_SUPPORT - regMaskTP rsAllCalleeSavedMask; - regMaskTP rsIntCalleeSavedMask; -#else // !SWIFT_SUPPORT - static constexpr regMaskTP rsAllCalleeSavedMask = RBM_CALLEE_SAVED; - static constexpr regMaskTP rsIntCalleeSavedMask = RBM_INT_CALLEE_SAVED; -#endif // !SWIFT_SUPPORT - public: regMaskTP rsGetModifiedRegsMask() const { @@ -89,24 +81,11 @@ class RegSet return rsModifiedRegsMask; } - regMaskTP rsGetModifiedCalleeSavedRegsMask() const - { - assert(rsModifiedRegsMaskInitialized); - return (rsModifiedRegsMask & rsAllCalleeSavedMask); - } - - regMaskTP rsGetModifiedIntCalleeSavedRegsMask() const - { - assert(rsModifiedRegsMaskInitialized); - return (rsModifiedRegsMask & rsIntCalleeSavedMask); - } + regMaskTP rsGetModifiedCalleeSavedRegsMask() const; + regMaskTP rsGetModifiedIntCalleeSavedRegsMask() const; #ifdef TARGET_AMD64 - regMaskTP rsGetModifiedOsrIntCalleeSavedRegsMask() const - { - assert(rsModifiedRegsMaskInitialized); - return (rsModifiedRegsMask & (rsIntCalleeSavedMask | RBM_EBP)); - } + regMaskTP rsGetModifiedOsrIntCalleeSavedRegsMask() const; #endif // TARGET_AMD64 regMaskTP rsGetModifiedFltCalleeSavedRegsMask() const From e67ca1a4f46f1b00de48dd7a742b99418cd3f625 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Thu, 23 May 2024 14:00:54 -0700 Subject: [PATCH 2/5] remove constexpr --- src/coreclr/jit/regset.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/coreclr/jit/regset.cpp b/src/coreclr/jit/regset.cpp index 3003dbf2a60e3..ba3a567ab333e 100644 --- a/src/coreclr/jit/regset.cpp +++ b/src/coreclr/jit/regset.cpp @@ -44,13 +44,8 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */ -#ifdef SWIFT_SUPPORT - regMaskTP rsAllCalleeSavedMask; - regMaskTP rsIntCalleeSavedMask; -#else // !SWIFT_SUPPORT - static constexpr regMaskTP rsAllCalleeSavedMask = RBM_CALLEE_SAVED; - static constexpr regMaskTP rsIntCalleeSavedMask = RBM_INT_CALLEE_SAVED; -#endif // !SWIFT_SUPPORT +regMaskTP rsAllCalleeSavedMask = RBM_CALLEE_SAVED; +regMaskTP rsIntCalleeSavedMask = RBM_INT_CALLEE_SAVED; regMaskTP RegSet::rsGetModifiedCalleeSavedRegsMask() const { @@ -296,11 +291,6 @@ RegSet::RegSet(Compiler* compiler, GCInfo& gcInfo) rsMaskPreSpillAlign = RBM_NONE; #endif -#ifdef SWIFT_SUPPORT - rsAllCalleeSavedMask = RBM_CALLEE_SAVED; - rsIntCalleeSavedMask = RBM_INT_CALLEE_SAVED; -#endif // SWIFT_SUPPORT - #ifdef DEBUG rsModifiedRegsMaskInitialized = false; #endif // DEBUG From e4750faaa849b21956fdad97e13e96c4ef97fabb Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Thu, 23 May 2024 14:05:04 -0700 Subject: [PATCH 3/5] Revert "remove constexpr" This reverts commit e67ca1a4f46f1b00de48dd7a742b99418cd3f625. --- src/coreclr/jit/regset.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/coreclr/jit/regset.cpp b/src/coreclr/jit/regset.cpp index ba3a567ab333e..3003dbf2a60e3 100644 --- a/src/coreclr/jit/regset.cpp +++ b/src/coreclr/jit/regset.cpp @@ -44,8 +44,13 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */ -regMaskTP rsAllCalleeSavedMask = RBM_CALLEE_SAVED; -regMaskTP rsIntCalleeSavedMask = RBM_INT_CALLEE_SAVED; +#ifdef SWIFT_SUPPORT + regMaskTP rsAllCalleeSavedMask; + regMaskTP rsIntCalleeSavedMask; +#else // !SWIFT_SUPPORT + static constexpr regMaskTP rsAllCalleeSavedMask = RBM_CALLEE_SAVED; + static constexpr regMaskTP rsIntCalleeSavedMask = RBM_INT_CALLEE_SAVED; +#endif // !SWIFT_SUPPORT regMaskTP RegSet::rsGetModifiedCalleeSavedRegsMask() const { @@ -291,6 +296,11 @@ RegSet::RegSet(Compiler* compiler, GCInfo& gcInfo) rsMaskPreSpillAlign = RBM_NONE; #endif +#ifdef SWIFT_SUPPORT + rsAllCalleeSavedMask = RBM_CALLEE_SAVED; + rsIntCalleeSavedMask = RBM_INT_CALLEE_SAVED; +#endif // SWIFT_SUPPORT + #ifdef DEBUG rsModifiedRegsMaskInitialized = false; #endif // DEBUG From a6a8111302d5359c8ceac1fc4316b17b068ccf5d Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Thu, 23 May 2024 14:05:13 -0700 Subject: [PATCH 4/5] Revert "fix build break on osx/arm64 Debug" This reverts commit dc5ad929fc17171a0635db37851530c901019012. --- src/coreclr/jit/regset.cpp | 28 ---------------------------- src/coreclr/jit/regset.h | 27 ++++++++++++++++++++++++--- 2 files changed, 24 insertions(+), 31 deletions(-) diff --git a/src/coreclr/jit/regset.cpp b/src/coreclr/jit/regset.cpp index 3003dbf2a60e3..2ef2f9c1e17f1 100644 --- a/src/coreclr/jit/regset.cpp +++ b/src/coreclr/jit/regset.cpp @@ -44,34 +44,6 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */ -#ifdef SWIFT_SUPPORT - regMaskTP rsAllCalleeSavedMask; - regMaskTP rsIntCalleeSavedMask; -#else // !SWIFT_SUPPORT - static constexpr regMaskTP rsAllCalleeSavedMask = RBM_CALLEE_SAVED; - static constexpr regMaskTP rsIntCalleeSavedMask = RBM_INT_CALLEE_SAVED; -#endif // !SWIFT_SUPPORT - -regMaskTP RegSet::rsGetModifiedCalleeSavedRegsMask() const -{ - assert(rsModifiedRegsMaskInitialized); - return (rsModifiedRegsMask & rsAllCalleeSavedMask); -} - -#ifdef TARGET_AMD64 -regMaskTP RegSet::rsGetModifiedOsrIntCalleeSavedRegsMask() const -{ - assert(rsModifiedRegsMaskInitialized); - return (rsModifiedRegsMask & (rsIntCalleeSavedMask | RBM_EBP)); -} -#endif // TARGET_AMD64 - -regMaskTP RegSet::rsGetModifiedIntCalleeSavedRegsMask() const -{ - assert(rsModifiedRegsMaskInitialized); - return (rsModifiedRegsMask & rsIntCalleeSavedMask); -} - //------------------------------------------------------------------------ // verifyRegUsed: verify that the register is marked as used. // diff --git a/src/coreclr/jit/regset.h b/src/coreclr/jit/regset.h index 1ca2539f72958..20b55610594fc 100644 --- a/src/coreclr/jit/regset.h +++ b/src/coreclr/jit/regset.h @@ -74,6 +74,14 @@ class RegSet bool rsModifiedRegsMaskInitialized; // Has rsModifiedRegsMask been initialized? Guards against illegal use. #endif // DEBUG +#ifdef SWIFT_SUPPORT + regMaskTP rsAllCalleeSavedMask; + regMaskTP rsIntCalleeSavedMask; +#else // !SWIFT_SUPPORT + static constexpr regMaskTP rsAllCalleeSavedMask = RBM_CALLEE_SAVED; + static constexpr regMaskTP rsIntCalleeSavedMask = RBM_INT_CALLEE_SAVED; +#endif // !SWIFT_SUPPORT + public: regMaskTP rsGetModifiedRegsMask() const { @@ -81,11 +89,24 @@ class RegSet return rsModifiedRegsMask; } - regMaskTP rsGetModifiedCalleeSavedRegsMask() const; - regMaskTP rsGetModifiedIntCalleeSavedRegsMask() const; + regMaskTP rsGetModifiedCalleeSavedRegsMask() const + { + assert(rsModifiedRegsMaskInitialized); + return (rsModifiedRegsMask & rsAllCalleeSavedMask); + } + + regMaskTP rsGetModifiedIntCalleeSavedRegsMask() const + { + assert(rsModifiedRegsMaskInitialized); + return (rsModifiedRegsMask & rsIntCalleeSavedMask); + } #ifdef TARGET_AMD64 - regMaskTP rsGetModifiedOsrIntCalleeSavedRegsMask() const; + regMaskTP rsGetModifiedOsrIntCalleeSavedRegsMask() const + { + assert(rsModifiedRegsMaskInitialized); + return (rsModifiedRegsMask & (rsIntCalleeSavedMask | RBM_EBP)); + } #endif // TARGET_AMD64 regMaskTP rsGetModifiedFltCalleeSavedRegsMask() const From 96fd46be8f455612f3154f2fd423fa4f79f3a912 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Thu, 23 May 2024 14:06:08 -0700 Subject: [PATCH 5/5] remove static constexpr --- src/coreclr/jit/regset.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/coreclr/jit/regset.h b/src/coreclr/jit/regset.h index 20b55610594fc..99c7f8be6bc55 100644 --- a/src/coreclr/jit/regset.h +++ b/src/coreclr/jit/regset.h @@ -74,13 +74,8 @@ class RegSet bool rsModifiedRegsMaskInitialized; // Has rsModifiedRegsMask been initialized? Guards against illegal use. #endif // DEBUG -#ifdef SWIFT_SUPPORT - regMaskTP rsAllCalleeSavedMask; - regMaskTP rsIntCalleeSavedMask; -#else // !SWIFT_SUPPORT - static constexpr regMaskTP rsAllCalleeSavedMask = RBM_CALLEE_SAVED; - static constexpr regMaskTP rsIntCalleeSavedMask = RBM_INT_CALLEE_SAVED; -#endif // !SWIFT_SUPPORT + regMaskTP rsAllCalleeSavedMask = RBM_CALLEE_SAVED; + regMaskTP rsIntCalleeSavedMask = RBM_INT_CALLEE_SAVED; public: regMaskTP rsGetModifiedRegsMask() const