[llvm-branch-commits] [llvm] [AllocToken, Clang] Implement __builtin_infer_alloc_token() and llvm.alloc.token.id (PR #156842)
Hans Wennborg via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Sep 24 04:59:39 PDT 2025
zmodem wrote:
> for `__builtin_infer_allocation_token` that won't work, because then we have to pull out all the token calculation logic in a way that Clang can access it. And some of that depends on configuration specific to the LLVM IR pass, that is not yet known. Not sure if there's a clean way other than somehow creating an API that can be used to do the token calculation that can be shared between Clang and IR pass.
Separating the instrumentation pass and the token generation might be a good idea though? The pass could focus on IR manipulation, and there could be a separate utility for token generation.
I agree that it would make sense if this were constant evaluate-able since it is a compile time constant in the end, but I don't know whether there are actually important use cases for this.
https://github.com/llvm/llvm-project/pull/156842
More information about the llvm-branch-commits
mailing list