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

[CIR][ABI] Add unsigned int CC lowering for x86_64 #701

Merged

Conversation

sitio-couto
Copy link
Collaborator

Adds the necessary bits to lower arguments and return values of type unsigned int for the x86_64 target. This includes adding logic for extend and direct argument-passing kinds.

Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

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

Few minor comments and you still need to fix a failing test, other than that should be good.

How does this fits with the plan we discussed about incremental support already as part of the oficial pipeline? Can you please outline the plan?

@@ -150,6 +162,17 @@ class ABIArgInfo {
AI.setSignExt(false);
return AI;
}
static ABIArgInfo getZeroExtend(mlir::Type Ty, mlir::Type T = nullptr) {
// NOTE(cir): Enumerations are IntTypes in CIR.
Copy link
Member

Choose a reason for hiding this comment

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

IntTypes or BoolTy?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

IntTypes

clang/lib/CIR/CodeGen/CIRGenFunction.h Show resolved Hide resolved
Adds the necessary bits to lower arguments and return values of type
unsigned int for the x86_64 target. This includes adding logic for
extend and direct argument-passing types.
@sitio-couto sitio-couto force-pushed the vinicius/add-x86-zeroextend-cc-lowering branch from 92b5444 to af736d1 Compare June 29, 2024 23:15
@sitio-couto sitio-couto force-pushed the vinicius/add-x86-zeroextend-cc-lowering branch from af736d1 to 84a0fe2 Compare June 29, 2024 23:29
Copy link
Collaborator Author

@sitio-couto sitio-couto left a comment

Choose a reason for hiding this comment

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

@bcardosolopes applied.

How does this fits with the plan we discussed about incremental support already as part of the oficial pipeline? Can you please outline the plan?

I backtracked to the original plan: implement the basics CC lowering bits first, then flip the -fclangir-call-conv-lowering flag.

Moving this pass into the official pipeline in its current state requires too many logical changes just for the code to work, changes that would later have to be reverted.

@@ -150,6 +162,17 @@ class ABIArgInfo {
AI.setSignExt(false);
return AI;
}
static ABIArgInfo getZeroExtend(mlir::Type Ty, mlir::Type T = nullptr) {
// NOTE(cir): Enumerations are IntTypes in CIR.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

IntTypes

@sitio-couto sitio-couto merged commit b41d427 into llvm:main Jun 30, 2024
6 checks passed
@sitio-couto sitio-couto deleted the vinicius/add-x86-zeroextend-cc-lowering branch June 30, 2024 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants