[clang] [llvm] [clang][IR] Overload @llvm.thread.pointer to support non-AS0 targets (PR #132489)
Jessica Clarke via cfe-commits
cfe-commits at lists.llvm.org
Wed May 14 10:54:26 PDT 2025
jrtc27 wrote:
> I'm mostly concerned about the case where the lowered node has the wrong type. For example, AArch64TargetLowering::LowerINTRINSIC_WO_CHAIN always creates a value with the pointer width of addrspace 0, but address spaces exist which don't have the native pointer width (arm64_32 exists, __ptr32 exists). And I suspect that inconsistency causes a crash. Even if it doesn't actually end up crashing in some cases, I'd prefer an explicit check to be on the safe side.
I've opted for a verifier check as it gives earlier failure, and by the time you get to SDAG you've lost the address space so would only be able to check the resulting VT is expected. It also avoids having to touch every backend. Of course, someone may in future have some target that wants a different AS for this, but I'll leave that to them to figure out how best to support their use case. For the CHERI use case it'll always match the globals AS, and that's all Clang is using in this PR.
https://github.com/llvm/llvm-project/pull/132489
More information about the cfe-commits
mailing list