[PATCH] D151867: [Clang][RISCV] Make generic clz/ctz builtins defined for zero on RISCV targets.

Craig Topper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 6 10:39:54 PDT 2023


craig.topper added a comment.

>From the C language perspective with this change, __builtin_clz/ctz is still considered undefined for 0 and code that uses it is ill-formed. `isCLZForZeroUndef` is only intended to prevent the middle end from optimizing based on the undefinedness and creating surprises. See also https://discourse.llvm.org/t/should-ubsan-detect-0-input-to-builtin-clz-ctz-regardless-of-target/71060


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151867/new/

https://reviews.llvm.org/D151867



More information about the cfe-commits mailing list