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

Henrik/mlir linkage b and c #19

Merged
merged 2 commits into from
Feb 18, 2025
Merged

Henrik/mlir linkage b and c #19

merged 2 commits into from
Feb 18, 2025

Conversation

hbrodin
Copy link
Collaborator

@hbrodin hbrodin commented Feb 14, 2025

This allows both linkage-b.mlir and linkage-c.mlir to pass.

This ensures that the linkage-b test pass. There is still some work to be done
with respect to DataLayout. The current approach uses attributes directly.
Moving forward, this should probably use either the DataLayout interfaces or a
custom DataLayout structure.
@hbrodin hbrodin requested a review from xlauko February 14, 2025 12:36
@hbrodin hbrodin changed the title Henrik/mlir linkage b Henrik/mlir linkage b and c Feb 14, 2025
/*methodName=*/ "setLinkage",
/*args=*/(ins "::mlir::link::Linkage":$linkage),
/*methodBody=*/"",
/*defaultImplementation=*/[{ }]
Copy link
Member

Choose a reason for hiding this comment

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

I would like this not to stay empty. As it might be source of bugs if you forget to implement it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch! That's an oversight of me. I'll fix it.

Copy link
Collaborator Author

@hbrodin hbrodin Feb 14, 2025

Choose a reason for hiding this comment

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

I'm struggling a bit to get this working. To clarify, did you intend for me to implement either of these scenarios?

  1. /*defaultImplementation=*/""
  2. /*defaultImplementation=*/[{ actual default implementation }]

Right now, no matter how I do this (seemingly) I get redeclaration errors. I think this might have something to do:

def LLVM_GlobalOp : LLVM_Op<"mlir.global",
    [IsolatedFromAbove, SingleBlockImplicitTerminator<"ReturnOp">, Symbol,
    GlobalVariableLinkageOpInterface,
    DeclareOpInterfaceMethods<GlobalValueLinkageOpInterface>,
    DeclareOpInterfaceMethods<GlobalVariableLinkageOpInterface>]> {

Any hints?

Copy link
Member

Choose a reason for hiding this comment

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

I wanted you to drop

/*methodBody=*/"",
      /*defaultImplementation=*/[{ }]

and only add definition on missing classes

@xlauko xlauko merged commit 59eb726 into mlir-link Feb 18, 2025
4 checks passed
@xlauko xlauko deleted the henrik/mlir-linkage-b branch February 18, 2025 14:53
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.

2 participants