[llvm] Add new llvm.cbrt intrinsic (PR #178396)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 28 05:12:45 PST 2026


david-arm wrote:

> These are huge problems, and I think they should probably be removed. However these are more tolerable in practice, since optimizations are not going to synthesize them out of something else. The current analog to cbrt is the pow->sqrt transform, but we have a way to expand that in terms of fdiv and fma. If cbrt is to be similarly introduced, it needs similar handling

I see. However, since the libm interface on most systems seems to have a cbrt function similar to sqrt, I was also thinking it would also be useful to add this as a clang builtin and lower to the new intrinsic when appropriate. Of course, a new builtin could still be lowered to an actual cbrt call with any additional flags.

https://github.com/llvm/llvm-project/pull/178396


More information about the llvm-commits mailing list