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

Fix build break on osx/arm64 Debug #102631

Merged
merged 5 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
28 changes: 28 additions & 0 deletions src/coreclr/jit/regset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,34 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
*/

#ifdef SWIFT_SUPPORT
regMaskTP rsAllCalleeSavedMask;
regMaskTP rsIntCalleeSavedMask;
Copy link
Member

@amanasifkhalid amanasifkhalid May 23, 2024

Choose a reason for hiding this comment

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

Do you think it would be cleaner to initialize these here instead of in RegSet's constructor below? (Never mind, I realized we want the constructor to reset these values between methods compiled) Also, it might be nice to add a comment explaining these aren't const or constexpr because rsClearRegsModified (and only this method) may modify them in Swift interop scenarios.

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you think it would be cleaner to initialize these here instead of in RegSet's constructor below?

sure.

constexpr

Was there a specific TP improvement we saw by marking them constexpr? I am inclined to just make them and it is just cleaner.

regMaskTP rsAllCalleeSavedMask = RBM_CALLEE_SAVED;
regMaskTP rsIntCalleeSavedMask = RBM_INT_CALLEE_SAVED;

Copy link
Member Author

Choose a reason for hiding this comment

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

Will check if there is any TP impact with this change.

Copy link
Member

@amanasifkhalid amanasifkhalid May 23, 2024

Choose a reason for hiding this comment

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

Was there a specific TP improvement we saw by marking them constexpr?

This was part of a bigger change, so I'm not sure what the TP impact is of changing this. I'm curious to see as well. If there is no impact, then maybe we should move them back into the RegSet class.

#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.
//
Expand Down
27 changes: 3 additions & 24 deletions src/coreclr/jit/regset.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,39 +74,18 @@ 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
{
assert(rsModifiedRegsMaskInitialized);
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
Expand Down
Loading