ahmedbougacha wrote:

> Why do we want a separate builtin, as opposed to just constant-folding calls 
> to __builtin_ptrauth_sign?

That's a good question.  Mechanically, I assumed constant-evaluating 
`__builtin_ptrauth_sign_unauthenticated` would be a challenge, but looking 
around it doesn't seem particularly difficult.

Conceptually though, the distinction does seem useful, because we treat 
`__builtin_ptrauth_sign_unauthenticated` as dangerous (because in general we 
can't guarantee that it won't get lowered to a signing oracle), and only to be 
used carefully, when absolutely necessary (e.g., in a dynamic loader.)
`__builtin_ptrauth_sign_constant` is safe, because we do always have safe ways 
to materialize signed constants (with the constants in IR, and either 
relocations or safe pseudos in the backend.)   (but cc @rjmccall @ahatanak for 
the real clang perspective ;)

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

Reply via email to