[clang] [llvm] [HLSL] Use hlsl_device address space for getpointer. (PR #127675)
Chris B via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 18 11:01:50 PST 2025
================
@@ -94,6 +94,11 @@ bool Qualifiers::isTargetAddressSpaceSupersetOf(LangAS A, LangAS B,
(A == LangAS::Default &&
(B == LangAS::cuda_constant || B == LangAS::cuda_device ||
B == LangAS::cuda_shared)) ||
+ // In HLSL, the this pointer for member functions is in the default
+ // address space. This causes problem if the structure is in
+ // hlsl_device. We want to allow casting from hlsl_device to default
+ // until a proper solution for that issue is found.
+ (A == LangAS::Default && B == LangAS::hlsl_device) ||
----------------
llvm-beanz wrote:
Can we make any member function that has an addressspace cast on the implicit object also `alwaysinline` at the call site? That would allow us to side-step any issues with `noinline`.
To avoid the language being completely unwieldy I think we're going to need to support some mechanism for allowing implicit objects in different address spaces.
https://github.com/llvm/llvm-project/pull/127675
More information about the cfe-commits
mailing list