aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/include/powerpc64le-linux-gnu
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2025-05-26 22:59:01 +0100
committerMatthew Lugg <mlugg@mlugg.co.uk>2025-05-27 19:23:11 +0100
commit92c63126e8a58235625cceaf0ea9e3d4eacfe513 (patch)
treeab36da0c91e39622bdd8a9c49e2f636ee341878d /lib/libc/include/powerpc64le-linux-gnu
parent3ed9155f10b725e6d24c01f5ecbebf359f3599a7 (diff)
downloadzig-92c63126e8a58235625cceaf0ea9e3d4eacfe513.tar.gz
zig-92c63126e8a58235625cceaf0ea9e3d4eacfe513.zip
compiler: tlv pointers are not comptime-known
Pointers to thread-local variables do not have their addresses known until runtime, so it is nonsensical for them to be comptime-known. There was logic in the compiler which was essentially attempting to treat them as not being comptime-known despite the pointer being an interned value. This was a bit of a mess, the check was frequent enough to actually show up in compiler profiles, and it was very awkward for backends to deal with, because they had to grapple with the fact that a "constant" they were lowering might actually require runtime operations. So, instead, do not consider these pointers to be comptime-known in *any* way. Never intern such a pointer; instead, when the address of a threadlocal is taken, emit an AIR instruction which computes the pointer at runtime. This avoids lots of special handling for TLVs across basically all codegen backends; of all somewhat-functional backends, the only one which wasn't improved by this change was the LLVM backend, because LLVM pretends this complexity around threadlocals doesn't exist. This change simplifies Sema and codegen, avoids a potential source of bugs, and potentially improves Sema performance very slightly by avoiding a non-trivial check on a hot path.
Diffstat (limited to 'lib/libc/include/powerpc64le-linux-gnu')
0 files changed, 0 insertions, 0 deletions