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: Clean up and optimize call arg lowering #112639

Merged
merged 3 commits into from
Feb 18, 2025
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
4 changes: 2 additions & 2 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -3118,7 +3118,7 @@ class Compiler
Statement* gtNewStmt(GenTree* expr, const DebugInfo& di);

// For unary opers.
GenTree* gtNewOperNode(genTreeOps oper, var_types type, GenTree* op1);
GenTreeUnOp* gtNewOperNode(genTreeOps oper, var_types type, GenTree* op1);

// For binary opers.
GenTreeOp* gtNewOperNode(genTreeOps oper, var_types type, GenTree* op1, GenTree* op2);
Expand Down Expand Up @@ -3207,7 +3207,7 @@ class Compiler

GenTree* gtNewPutArgReg(var_types type, GenTree* arg, regNumber argReg);

GenTree* gtNewBitCastNode(var_types type, GenTree* arg);
GenTreeUnOp* gtNewBitCastNode(var_types type, GenTree* arg);

public:
GenTreeCall* gtNewCallNode(gtCallTypes callType,
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/jit/compiler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1411,14 +1411,14 @@ inline Statement* Compiler::gtNewStmt(GenTree* expr, const DebugInfo& di)
return stmt;
}

inline GenTree* Compiler::gtNewOperNode(genTreeOps oper, var_types type, GenTree* op1)
inline GenTreeUnOp* Compiler::gtNewOperNode(genTreeOps oper, var_types type, GenTree* op1)
{
assert((GenTree::OperKind(oper) & (GTK_UNOP | GTK_BINOP)) != 0);
assert((GenTree::OperKind(oper) & GTK_EXOP) == 0); // Can't use this to construct any types that extend unary/binary
// operator.
assert(op1 != nullptr || oper == GT_RETFILT || (oper == GT_RETURN && type == TYP_VOID));

GenTree* node = new (this, oper) GenTreeOp(oper, type, op1, nullptr);
GenTreeUnOp* node = new (this, oper) GenTreeOp(oper, type, op1, nullptr);

return node;
}
Expand Down
12 changes: 2 additions & 10 deletions src/coreclr/jit/gentree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9148,20 +9148,12 @@ GenTree* Compiler::gtNewPutArgReg(var_types type, GenTree* arg, regNumber argReg
// Notes:
// The node is generated as GenTreeMultiRegOp on RyuJIT/arm, as GenTreeOp on all the other archs.
//
GenTree* Compiler::gtNewBitCastNode(var_types type, GenTree* arg)
GenTreeUnOp* Compiler::gtNewBitCastNode(var_types type, GenTree* arg)
{
assert(arg != nullptr);
assert(type != TYP_STRUCT);

GenTree* node = nullptr;
#if defined(TARGET_ARM)
// A BITCAST could be a MultiRegOp on arm since we could move a double register to two int registers.
node = new (this, GT_BITCAST) GenTreeMultiRegOp(GT_BITCAST, type, arg, nullptr);
#else
node = gtNewOperNode(GT_BITCAST, type, arg);
#endif

return node;
return gtNewOperNode(GT_BITCAST, type, arg);
Copy link
Member Author

Choose a reason for hiding this comment

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

I missed simplifying this in #103869.

}

//------------------------------------------------------------------------
Expand Down
Loading
Loading