efriedma-quic wrote:

> That's not what I'm requesting, it would be an undefined value. It is not 
> instant undefined behavior, you would get UB on use of that value

You're creating a lot of work by insisting on this.

We don't currently have a definition of what it means to "use" a value in a way 
that would cause undefined behavior with poison.  The standards define 
"indeterminate value"(C++)/"indeterminate representation"(C), but those aren't 
suitable here: they allow constructs that produce undefined behavior with 
poison.

So if we want to allow this usage, we would need to very carefully define what 
it means to "use" a value, in a way that consistent with the way clang 
currently generates LLVM IR, and avoid potential conflicts with future memory 
model improvements.  Which is hard because the LLVM memory model is still 
incomplete.  So we'd need an RFC for defining what an "undefined value" is.

If you have some plan to use this notion of "undefined value" for something 
other than ctlz/cttz, then maybe this work is worth doing, but I don't want do 
do it just for a few obscure builtins.

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

Reply via email to