[llvm] SimplifyLibCalls: Don't require ldexp to emit intrinsic in exp2 combine (PR #92707)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Mon May 20 09:53:36 PDT 2024


efriedma-quic wrote:

If we reserve the right to call ldexp anywhere, under any set of flags, how is anyone supposed to implement a C library?  I guess this particular combine is unlikely to cause issues, but if you're planning to rip out all checks for whether a functions exists, it seems like something we need to address.

For memcpy/memmove/memset specifically, we currently have a special-case rule: in no-builtins mode: existing calls to the intrinsics lower to the corresponding calls, but optimizations don't generate any new calls to those functions.  This is sort of hard to formally justify, but in practice, it works pretty well for people doing stuff with -ffreestanding.  The special case doesn't really extend beyond those specific functions.

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


More information about the llvm-commits mailing list