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

Use void (ptr) on LLVM::GlobalOp when available in LLVM dialect to represent aliased functions #1083

Open
bcardosolopes opened this issue Nov 7, 2024 · 1 comment
Labels
blocked-by-mlir-support IR difference A difference in ClangIR-generated LLVM IR that could complicate reusing original CodeGen tests

Comments

@bcardosolopes
Copy link
Member

Similar issue from #1065, we cannot use globals at all (even if we ignore the absence of alias) to start representing aliases. llvm.mlir.globals don't seem to accept anything besides !llvm.ptr as it's types and there are no existing casts to use in its initializers that can allows us to map from llvm.mlir.addressof.

To be more concrete, I want to generate this following LLVM IR code:

@_ZN1BD1Ev = dso_local unnamed_addr alias void (ptr), ptr @_ZN1BD2Ev
@_ZN1CD2Ev = dso_local unnamed_addr alias void (ptr), ptr @_ZN1BD2Ev
@_ZN1CD1Ev = dso_local unnamed_addr alias void (ptr), ptr @_ZN1BD2Ev

define dso_local void @_ZN1BD2Ev(ptr noundef nonnull align 8 dereferenceable(9) %this) unnamed_addr #0 {
...

This also needs to be filed against upstream MLIR.

@bcardosolopes
Copy link
Member Author

Filed upstream: llvm/llvm-project#115392

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked-by-mlir-support IR difference A difference in ClangIR-generated LLVM IR that could complicate reusing original CodeGen tests
Projects
None yet
Development

No branches or pull requests

1 participant