[UBSan] Consider zero input to __builtin_clz/ctz to be undefined independent of the target.
Previously we checked isCLZForZeroUndef and only added UBSan checks if it returned true. The builtin should be considered undefined for 0 regardless of the target so that code using it is portable. The isCLZForZeroUndef was only intended to disable optimizations in the middle end and backend. See https://discourse.llvm.org/t/should-ubsan-detect-0-input-to-builtin-clz-ctz-regardless-of-target/71060 Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D152023
Loading
Please sign in to comment