Skip to content

Conversation

@MrSidims
Copy link
Contributor

@MrSidims MrSidims commented Oct 4, 2025

It's deduced from a pointer's address space.
Resolves:
#3371

@MrSidims
Copy link
Contributor Author

MrSidims commented Oct 4, 2025

@svenvh @bashbaug Tests are currently failing, but if we are good with the approach - I'll investigate and fix the failures.

@svenvh
Copy link
Member

svenvh commented Oct 6, 2025

@svenvh @bashbaug Tests are currently failing, but if we are good with the approach - I'll investigate and fix the failures.

The approach looks reasonable to me; it would be nice to have some comments on the various functions though (explaining for which cases we need getAddressSpaceFromValue for example).

Copy link
Contributor

@bashbaug bashbaug left a comment

Choose a reason for hiding this comment

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

The overall approach LGTM, thanks!

GenericAS = MaybeAS;
}

if (auto *Op = dyn_cast<Operator>(Current)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

For my own understanding, is this kind of a "light" form of generic addresss space inference?

Is this primarily needed because explicit address space overloads don't exist, or because explicit address space overloads aren't being used, or something else?

To be clear, I think this is fine and a good idea to include, just trying to understand why it is needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's light version of Infer Address Space pass. It's created because different front ends can pick different default address spaces for pointers. AFAIK even for upstream OpenCL there will be different LLVM IR produced by clang for SPIR and AMDGPU (through SPIR(V) tool chain(s) targets).

I'm actually missing one assumption. If worklist ends up on generic alloca - it should be assumed as private alloca.

It's deduced from a pointer's address space.
Resolves:
KhronosGroup#3371

Signed-off-by: Sidorov, Dmitry <[email protected]>
@MrSidims MrSidims force-pushed the atomic-semantic branch 4 times, most recently from 868d6bd to a4215cb Compare October 24, 2025 14:46
Signed-off-by: Sidorov, Dmitry <[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