https://github.com/llvm-beanz commented:

We talked about this yesterday in a call with @Keenuts and @s-perron.

I think one of the problems we have with HLSL is that we haven't had explicit 
address space annotations except for `groupshared` in the past. We do need to 
do that in the future, but I'm not sure this was the right slicing.

In HLSL `static` variables are stored in thread-local addresses, but have 
thread lifetime, whereas function local variables are stored in thread-local 
addresses but have function lifetime.

In both cases the storage is thread-local, and they can be used interchangeably 
as addresses so we should have them in the same address space, but with 
different storage classes and lifetimes.

There are cases (specifically around the implicit `this` object) where we'll 
need to follow the OpenCL approach and insert addrspacecasts that we can clean 
up later in the compiler. I don't think we have a good way around that until we 
can evolve the language to express address spaces more comprehensively.

Those issues will need to be addressed in the language, and we have a few 
different related proposals:
* 
https://github.com/microsoft/hlsl-specs/blob/main/proposals/0006-reference-types.md
* https://github.com/microsoft/hlsl-specs/pull/325

I've also filed an issue to track specifying this further: 
https://github.com/microsoft/hlsl-specs/issues/364

https://github.com/llvm/llvm-project/pull/122103
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to