efriedma-quic wrote: > > 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. > > Which means stating it produces undefined behavior less accurate?
We have to document semantics that describe the behavior with all possible usage, with current and future compilers. If we say "undefined behavior", we don't have to come up with a narrower definition. > > If you have some plan to use this notion of "undefined value" for something > > other than ctlz/cttz, > > There are a handful of other intrinsics which are documented as returning > `freeze poison` We generally refer to `freeze poison` as "unspecified value". The compiler can pick whatever value is most convenient, but optimizations have to be consistent with that value. This is consistent with the way C/C++ standards use "unspecified". We could possibly mess with the LangRef definition of ctlz/cttz so the "zero_is_poison" bit actually returns `freeze poison`. But I think we'd need to adjust some optimizations to be consistent with that. 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