[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 11:18:55 PDT 2024
efriedma-quic wrote:
> IMO it was wrong to provide any math intrinsics to expose the usage of math functions. These intrinsics should be providing the target implementation of the libm functions, not the other way around. If we can't codegen the intrinsic without the libcall, we probably shouldn't have the intrinsic.
I see where you're coming from with this... see also discussion on https://discourse.llvm.org/t/rfc-all-the-math-intrinsics/78294 . If you're willing to push forward something to break apart the current mess, I'd be in favor.
> Alternative to this, I could fix it to preserve libcall->libcall behavior and intrinsic->intrinsic behavior. The main problem I'm trying to solve is gating intrinsic->intrinsic gated on the libcall availability
That still technically breaks -fno-builtin-ldexp... but the way it breaks is much less likely to matter, so I think I'm okay with this.
> > Long-term, we really need a better approach for managing the codesize explosion that comes from expanding everything inline.
>
> We could also undo this optimization in codegen if ldexp isn't available (which in practice just means windows) and call pow
On Windows specifically, we have ldexp; the issue is just that we don't have ldexpf.
https://github.com/llvm/llvm-project/pull/92707
More information about the llvm-commits
mailing list