diff options
| author | Robin Voetter <robin@voetter.nl> | 2022-08-21 01:32:19 +0200 |
|---|---|---|
| committer | Robin Voetter <robin@voetter.nl> | 2022-10-12 20:34:42 +0200 |
| commit | 5f3b91437f5cd23bcae66227932555b7abe32669 (patch) | |
| tree | 3d1db6c0e791e7b206ea4eb88abdad252f3901bd /src/Module.zig | |
| parent | 3392de87dcf516ed2e3fd1904372195bdc75c0eb (diff) | |
| download | zig-5f3b91437f5cd23bcae66227932555b7abe32669.tar.gz zig-5f3b91437f5cd23bcae66227932555b7abe32669.zip | |
stage2: improve addrspace handling
This commit changes the way Zig is intended to deal with variable
declaration for exotic targets. Where previously the idea was to
enfore local/global variables to be placed into their respective
address spaces, depending on the target, this is now fixed to the
generic address space.
To facilitate this for targets where local variables _must_ be
generated into a specific address space (ex. amdgcn where locals
must be generated into the private address space), the variable
allocations (alloca) are generated into the right address space
and then addrspace-casted back to the generic address space. While this
could be less efficient in theory, LLVM will hopefull deal with figuring
out the actual correct address space for a pointer for us. HIP seems to
do the same thing in this regard.
Global variables are handled in a similar way.
Diffstat (limited to 'src/Module.zig')
0 files changed, 0 insertions, 0 deletions
