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: Remove CallArgABIInformation::IsStruct #92635

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion src/coreclr/jit/gentree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1427,7 +1427,7 @@ bool CallArg::IsUserArg() const
void CallArg::CheckIsStruct()
{
GenTree* node = GetNode();
if (AbiInfo.IsStruct)
if (varTypeIsStruct(GetSignatureType()))
{
if (!varTypeIsStruct(node) && !node->OperIs(GT_FIELD_LIST))
{
Expand Down
3 changes: 0 additions & 3 deletions src/coreclr/jit/gentree.h
Original file line number Diff line number Diff line change
Expand Up @@ -4347,7 +4347,6 @@ struct CallArgABIInformation
#endif
, ArgType(TYP_UNDEF)
, IsBackFilled(false)
, IsStruct(false)
, PassedByRef(false)
#if FEATURE_ARG_SPLIT
, m_isSplit(false)
Expand Down Expand Up @@ -4396,8 +4395,6 @@ struct CallArgABIInformation
// True when the argument fills a register slot skipped due to alignment
// requirements of previous arguments.
bool IsBackFilled : 1;
// True if this is a struct arg
bool IsStruct : 1;
// True iff the argument is passed by reference.
bool PassedByRef : 1;

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,7 @@ GenTree* Lowering::NewPutArg(GenTreeCall* call, GenTree* arg, CallArg* callArg,
call, putInIncomingArgArea);

#if defined(DEBUG) && defined(FEATURE_PUT_STRUCT_ARG_STK)
if (callArg->AbiInfo.IsStruct)
if (varTypeIsStruct(callArg->GetSignatureType()))
{
// We use GT_BLK only for non-SIMD struct arguments.
if (arg->OperIs(GT_BLK))
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/lsraxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,7 @@ int LinearScan::BuildCall(GenTreeCall* call)
if (argNode->OperGet() == GT_FIELD_LIST)
{
assert(argNode->isContained());
assert(varTypeIsStruct(argNode) || abiInfo.IsStruct);
assert(varTypeIsStruct(arg.GetSignatureType()));

unsigned regIndex = 0;
for (GenTreeFieldList::Use& use : argNode->AsFieldList()->Uses())
Expand Down
28 changes: 5 additions & 23 deletions src/coreclr/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -827,10 +827,6 @@ void CallArg::Dump(Compiler* comp)
{
printf(", wellKnown[%s]", getWellKnownArgName(m_wellKnownArg));
}
if (AbiInfo.IsStruct)
{
printf(", isStruct");
}
printf("]\n");
}
#endif
Expand Down Expand Up @@ -880,8 +876,6 @@ void CallArgs::SetTemp(CallArg* arg, unsigned tmpNum)
//
void CallArgs::ArgsComplete(Compiler* comp, GenTreeCall* call)
{
bool hasStructRegArg = false;

unsigned argCount = CountArgs();

// Previous argument with GTF_EXCEPT
Expand Down Expand Up @@ -914,17 +908,9 @@ void CallArgs::ArgsComplete(Compiler* comp, GenTreeCall* call)
#if FEATURE_ARG_SPLIT
else if (arg.AbiInfo.IsSplit())
{
hasStructRegArg = true;
assert(m_hasStackArgs);
}
#endif // FEATURE_ARG_SPLIT
else // we have a register argument, next we look for a struct type.
{
if (varTypeIsStruct(argx) UNIX_AMD64_ABI_ONLY(|| arg.AbiInfo.IsStruct))
{
hasStructRegArg = true;
}
}
#endif // FEATURE_ARG_SPLIT

/* If the argument tree contains an assignment (GTF_ASG) then the argument and
and every earlier argument (except constants) must be evaluated into temps
Expand Down Expand Up @@ -2793,9 +2779,8 @@ void CallArgs::AddFinalArgsAndDetermineABIInfo(Compiler* comp, GenTreeCall* call
}
#endif // TARGET_ARM

arg.AbiInfo = CallArgABIInformation();
arg.AbiInfo.ArgType = argx->TypeGet();
arg.AbiInfo.IsStruct = isStructArg;
arg.AbiInfo = CallArgABIInformation();
arg.AbiInfo.ArgType = argx->TypeGet();

if (isRegArg)
{
Expand Down Expand Up @@ -3014,7 +2999,7 @@ void CallArgs::AddFinalArgsAndDetermineABIInfo(Compiler* comp, GenTreeCall* call

arg.AbiInfo.SetMultiRegNums();

if (arg.AbiInfo.IsStruct)
if (varTypeIsStruct(arg.GetSignatureType()))
{
arg.AbiInfo.PassedByRef = passStructByRef;
arg.AbiInfo.ArgType = (structBaseType == TYP_UNKNOWN) ? argx->TypeGet() : structBaseType;
Expand Down Expand Up @@ -3202,10 +3187,7 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call)
argx->gtType = TYP_I_IMPL;
}

// Struct arguments may be morphed into a node that is not a struct type.
// In such case the CallArgABIInformation keeps track of whether the original node (before morphing)
// was a struct and the struct classification.
bool isStructArg = arg.AbiInfo.IsStruct;
bool isStructArg = varTypeIsStruct(arg.GetSignatureType());
GenTree* argObj = argx->gtEffectiveVal(true /*commaOnly*/);
bool makeOutArgCopy = false;

Expand Down