add intrinsic for CLZ
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
These were intentionally not added because llvm has generic leading and trailing zero builtins. builtin_clz and builtin_ctz
Rethinking that. Since builtin_clz is undefined for 0, I think we should have clang builtins, but we should use llvm.ctlz with false for the second argument as their implementation. See X86::BIbuiltin_ia32_lzcnt_u32 for example.
[RISCV]CLZ instruction try use llvm.ctlz with false for the second argument to implement clz
LGTM though I think the title needs to be updated. Should be something like "[RISCV] Add clang builtins for CLZ instruction."
clang-format not found in user’s local PATH; not linting file.