[llvm] MathExtras: rewrite some methods to never overflow (PR #95556)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 17 03:04:30 PDT 2024


jayfoad wrote:

> It looks like this does have some overhead in practice

It would be good to know which functions are hot, and with what kind of arguments.

Do we have a good way to specialize these functions when Y is known to be a power of 2, e.g. with something like `if (__builtin_constant_p(Y) && isPowerOf2(Y))`?

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


More information about the llvm-commits mailing list