-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Let GenTreeCopyOrReload handle scenarios when FEATURE_MULTIREG_RET is disabled #82451
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -8039,17 +8039,14 @@ struct GenTreePutArgSplit : public GenTreePutArgStk | |||
// Represents GT_COPY or GT_RELOAD node | ||||
// | ||||
// As it turns out, these are only needed on targets that happen to have multi-reg returns. | ||||
// However, they are actually needed on any target that has any multi-reg ops. It is just | ||||
// coincidence that those are the same (and there isn't a FEATURE_MULTIREG_OPS). | ||||
// However, they are actually needed on any target that has any multi-reg ops. | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Otherwise the comments contradict themselves:
|
||||
// | ||||
struct GenTreeCopyOrReload : public GenTreeUnOp | ||||
{ | ||||
#if FEATURE_MULTIREG_RET | ||||
// State required to support copy/reload of a multi-reg call node. | ||||
// The first register is always given by GetRegNum(). | ||||
// | ||||
regNumberSmall gtOtherRegs[MAX_MULTIREG_COUNT - 1]; | ||||
#endif | ||||
|
||||
//---------------------------------------------------------- | ||||
// ClearOtherRegs: set gtOtherRegs to REG_NA. | ||||
|
@@ -8062,12 +8059,10 @@ struct GenTreeCopyOrReload : public GenTreeUnOp | |||
// | ||||
void ClearOtherRegs() | ||||
{ | ||||
#if FEATURE_MULTIREG_RET | ||||
for (unsigned i = 0; i < MAX_MULTIREG_COUNT - 1; ++i) | ||||
{ | ||||
gtOtherRegs[i] = REG_NA; | ||||
} | ||||
#endif | ||||
} | ||||
|
||||
//----------------------------------------------------------- | ||||
|
@@ -8088,11 +8083,7 @@ struct GenTreeCopyOrReload : public GenTreeUnOp | |||
return GetRegNum(); | ||||
} | ||||
|
||||
#if FEATURE_MULTIREG_RET | ||||
return (regNumber)gtOtherRegs[idx - 1]; | ||||
#else | ||||
return REG_NA; | ||||
#endif | ||||
} | ||||
|
||||
//----------------------------------------------------------- | ||||
|
@@ -8113,18 +8104,11 @@ struct GenTreeCopyOrReload : public GenTreeUnOp | |||
{ | ||||
SetRegNum(reg); | ||||
} | ||||
#if FEATURE_MULTIREG_RET | ||||
else | ||||
{ | ||||
gtOtherRegs[idx - 1] = (regNumberSmall)reg; | ||||
assert(gtOtherRegs[idx - 1] == reg); | ||||
} | ||||
#else | ||||
else | ||||
{ | ||||
unreached(); | ||||
} | ||||
#endif | ||||
} | ||||
|
||||
//---------------------------------------------------------------------------- | ||||
|
@@ -8153,7 +8137,6 @@ struct GenTreeCopyOrReload : public GenTreeUnOp | |||
|
||||
unsigned GetRegCount() const | ||||
{ | ||||
#if FEATURE_MULTIREG_RET | ||||
// We need to return the highest index for which we have a valid register. | ||||
// Note that the gtOtherRegs array is off by one (the 0th register is GetRegNum()). | ||||
// If there's no valid register in gtOtherRegs, GetRegNum() must be valid. | ||||
|
@@ -8168,7 +8151,7 @@ struct GenTreeCopyOrReload : public GenTreeUnOp | |||
return i; | ||||
} | ||||
} | ||||
#endif | ||||
|
||||
// We should never have a COPY or RELOAD with no valid registers. | ||||
assert(GetRegNum() != REG_NA); | ||||
return 1; | ||||
|
@@ -9097,12 +9080,12 @@ inline regNumber GenTree::GetRegByIndex(int regIndex) const | |||
return AsMultiRegOp()->GetRegNumByIdx(regIndex); | ||||
} | ||||
#endif | ||||
#endif // FEATURE_MULTIREG_RET | ||||
|
||||
if (OperIs(GT_COPY, GT_RELOAD)) | ||||
{ | ||||
return AsCopyOrReload()->GetRegNumByIdx(regIndex); | ||||
} | ||||
#endif // FEATURE_MULTIREG_RET | ||||
|
||||
#ifdef FEATURE_HW_INTRINSICS | ||||
if (OperIs(GT_HWINTRINSIC)) | ||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.