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

Improve impPopCallArgs #68736

Merged
merged 6 commits into from
May 6, 2022
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
9 changes: 5 additions & 4 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -3543,8 +3543,9 @@ class Compiler
void impResolveToken(const BYTE* addr, CORINFO_RESOLVED_TOKEN* pResolvedToken, CorInfoTokenKind kind);

void impPushOnStack(GenTree* tree, typeInfo ti);
void impPushNullObjRefOnStack();
StackEntry impPopStack();
void impPushNullObjRefOnStack();
StackEntry impPopStack();
void impPopStack(unsigned n);
StackEntry& impStackTop(unsigned n = 0);
unsigned impStackHeight();

Expand Down Expand Up @@ -3901,11 +3902,11 @@ class Compiler
((opcode >= CEE_STLOC_0) && (opcode <= CEE_STLOC_3)));
}

void impPopCallArgs(unsigned count, CORINFO_SIG_INFO* sig, GenTreeCall* call);
void impPopCallArgs(CORINFO_SIG_INFO* sig, GenTreeCall* call);

bool impCheckImplicitArgumentCoercion(var_types sigType, var_types nodeType) const;

void impPopReverseCallArgs(unsigned count, CORINFO_SIG_INFO* sig, GenTreeCall* call, unsigned skipReverseCount = 0);
void impPopReverseCallArgs(CORINFO_SIG_INFO* sig, GenTreeCall* call, unsigned skipReverseCount);

//---------------- Spilling the importer stack ----------------------------

Expand Down
17 changes: 17 additions & 0 deletions src/coreclr/jit/gentree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1675,6 +1675,23 @@ CallArg* CallArgs::InsertAfter(Compiler* comp, CallArg* after, GenTree* node, We
assert(found && "Could not find arg to insert after in argument list");
#endif

return InsertAfterUnchecked(comp, after, node, wellKnownArg);
}

//---------------------------------------------------------------
// InsertAfterUnchecked: Create a new argument after another argument, without debug checks.
//
// Parameters:
// comp - The compiler.
// after - The existing argument to insert the new argument after.
// node - The IR node for the argument.
// wellKnownArg - The kind of argument, if special.
//
// Returns:
// The created representative for the argument.
//
CallArg* CallArgs::InsertAfterUnchecked(Compiler* comp, CallArg* after, GenTree* node, WellKnownArg wellKnownArg)
{
CallArg* newArg = new (comp, CMK_CallArgs) CallArg(wellKnownArg);
newArg->SetEarlyNode(node);
newArg->SetNext(after->GetNext());
Expand Down
4 changes: 4 additions & 0 deletions src/coreclr/jit/gentree.h
Original file line number Diff line number Diff line change
Expand Up @@ -4332,6 +4332,10 @@ class CallArgs
CallArg* PushFront(Compiler* comp, GenTree* node, WellKnownArg wellKnownArg = WellKnownArg::None);
CallArg* PushBack(Compiler* comp, GenTree* node, WellKnownArg wellKnownArg = WellKnownArg::None);
CallArg* InsertAfter(Compiler* comp, CallArg* after, GenTree* node, WellKnownArg wellKnownArg = WellKnownArg::None);
CallArg* InsertAfterUnchecked(Compiler* comp,
CallArg* after,
GenTree* node,
WellKnownArg wellKnownArg = WellKnownArg::None);
CallArg* InsertInstParam(Compiler* comp, GenTree* node);
CallArg* InsertAfterThisOrFirst(Compiler* comp, GenTree* node, WellKnownArg wellKnownArg = WellKnownArg::None);
void PushLateBack(CallArg* arg);
Expand Down
Loading