February 11, 2019 Re: fabs not being inlined? | ||||
---|---|---|---|---|
| ||||
Posted in reply to kinke | On Saturday, 9 February 2019 at 15:38:55 UTC, kinke wrote:
> On Saturday, 9 February 2019 at 15:08:22 UTC, NaN wrote:
>> [...]
>
> Both manual versions are ugly and IMO should be avoided at all costs. ;) If LTO/cross-module-inlining is not an option but fabs performance is critical, then use the intrinsic directly:
>
> import ldc.intrinsics;
> alias fabs = llvm_fabs;
>
> The reason std.math doesn't just alias (I had a go at this once) is that there are some tests checking that the std.math functions are real functions (and that their address can be taken).
>
>> [...]
>
> Looks like some linker tricks required for the MinGW-based libs don't work with LTO; I guess it works with the MS toolchain, e.g., when run inside in a Visual Studio command prompt. I'll spare you the dirty details.
IIRC __chkstk is a msvcrt call to dynamically grow the stack.
There might be a hidden dependency introduced by llvm?
|
February 12, 2019 Re: fabs not being inlined? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stefan Koch | On Monday, 11 February 2019 at 23:52:50 UTC, Stefan Koch wrote: > On Saturday, 9 February 2019 at 15:38:55 UTC, kinke wrote: >> [...] > > IIRC __chkstk is a msvcrt call to dynamically grow the stack. > There might be a hidden dependency introduced by llvm? A good explanation on this: https://metricpanda.com/rival-fortress-update-45-dealing-with-__chkstk-__chkstk_ms-when-cross-compiling-for-windows |
February 12, 2019 Re: fabs not being inlined? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Radu | On Tuesday, 12 February 2019 at 07:46:24 UTC, Radu wrote: > On Monday, 11 February 2019 at 23:52:50 UTC, Stefan Koch wrote: >> On Saturday, 9 February 2019 at 15:38:55 UTC, kinke wrote: >>> [...] >> >> IIRC __chkstk is a msvcrt call to dynamically grow the stack. >> There might be a hidden dependency introduced by llvm? > > A good explanation on this: > https://metricpanda.com/rival-fortress-update-45-dealing-with-__chkstk-__chkstk_ms-when-cross-compiling-for-windows I wanted to spare you the details, but that's the workaround which at least works without LTO: https://github.com/ldc-developers/druntime/blob/ldc/src/rt/msvc.c#L93-L99 |
Copyright © 1999-2021 by the D Language Foundation