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][Dialect] Add minimal definitions of unified address space offload_* cases #738

Merged
merged 2 commits into from
Jul 15, 2024

Conversation

seven-mile
Copy link
Collaborator

This PR adds definitions of unified address space cases offload_* discussed in this RFC thread.

It also refactors the getValueFromLangAS method in tablegen to a hand-written method, because it should be a non-trivial map for unified AS.

@seven-mile
Copy link
Collaborator Author

Our current focus is on the offload_* cases. The CIRGen and LLVMLowering for these cases are planned to be implemented in the next PR, #724. Other cases should be added as needed in the future.

@seven-mile seven-mile changed the title [CIR][Dialect] Add minimal definitions of unified AS offload_* cases [CIR][Dialect] Add minimal definitions of unified address space offload_* cases Jul 13, 2024
Copy link
Contributor

@jopperm jopperm left a comment

Choose a reason for hiding this comment

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

It also refactors the getValueFromLangAS method in tablegen to a hand-written method, because it should be a non-trivial map for unified AS.

👍

Comment on lines 715 to 718
/// Convert CIRGen-processed LangAS to CIR AS storage value.
/// For offloading languages like CUDA/SYCL, the actual LangAS like generic
/// or private should be passed, rather than Default.
/// Such "actual LangAS" should be figured out in CIRGen instead.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion to make this comment a bit clearer:

Suggested change
/// Convert CIRGen-processed LangAS to CIR AS storage value.
/// For offloading languages like CUDA/SYCL, the actual LangAS like generic
/// or private should be passed, rather than Default.
/// Such "actual LangAS" should be figured out in CIRGen instead.
/// Convert a clang LangAS to its corresponding CIR AS storage value. This
/// helper does not perform any language-specific mappings (e.g. determining
/// the default AS for offloading languages), so these must be handled in
/// the caller.

Co-authored-by: Julian Oppermann <[email protected]>
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.

Awesome, LGTM

@bcardosolopes bcardosolopes merged commit dafb6eb into llvm:main Jul 15, 2024
6 checks passed
Hugobros3 pushed a commit to shady-gang/clangir that referenced this pull request Oct 2, 2024
…oad_*` cases (llvm#738)

This PR adds definitions of unified address space cases `offload_*`
discussed in [this RFC
thread](https://discourse.llvm.org/t/rfc-clangir-unified-address-space-design-in-clangir/79728).

It also refactors the `getValueFromLangAS` method in tablegen to a
hand-written method, because it should be a non-trivial map for unified
AS.

---------

Co-authored-by: Julian Oppermann <[email protected]>
smeenai pushed a commit to smeenai/clangir that referenced this pull request Oct 9, 2024
…oad_*` cases (llvm#738)

This PR adds definitions of unified address space cases `offload_*`
discussed in [this RFC
thread](https://discourse.llvm.org/t/rfc-clangir-unified-address-space-design-in-clangir/79728).

It also refactors the `getValueFromLangAS` method in tablegen to a
hand-written method, because it should be a non-trivial map for unified
AS.

---------

Co-authored-by: Julian Oppermann <[email protected]>
smeenai pushed a commit to smeenai/clangir that referenced this pull request Oct 9, 2024
…oad_*` cases (llvm#738)

This PR adds definitions of unified address space cases `offload_*`
discussed in [this RFC
thread](https://discourse.llvm.org/t/rfc-clangir-unified-address-space-design-in-clangir/79728).

It also refactors the `getValueFromLangAS` method in tablegen to a
hand-written method, because it should be a non-trivial map for unified
AS.

---------

Co-authored-by: Julian Oppermann <[email protected]>
keryell pushed a commit to keryell/clangir that referenced this pull request Oct 19, 2024
…oad_*` cases (llvm#738)

This PR adds definitions of unified address space cases `offload_*`
discussed in [this RFC
thread](https://discourse.llvm.org/t/rfc-clangir-unified-address-space-design-in-clangir/79728).

It also refactors the `getValueFromLangAS` method in tablegen to a
hand-written method, because it should be a non-trivial map for unified
AS.

---------

Co-authored-by: Julian Oppermann <[email protected]>
lanza pushed a commit that referenced this pull request Nov 5, 2024
…oad_*` cases (#738)

This PR adds definitions of unified address space cases `offload_*`
discussed in [this RFC
thread](https://discourse.llvm.org/t/rfc-clangir-unified-address-space-design-in-clangir/79728).

It also refactors the `getValueFromLangAS` method in tablegen to a
hand-written method, because it should be a non-trivial map for unified
AS.

---------

Co-authored-by: Julian Oppermann <[email protected]>
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.

3 participants