digitalmars.D.learn - LDC cross-module-inlining
- Per =?UTF-8?B?Tm9yZGzDtnc=?= (10/10) Aug 09 2020 Is cross-module-inlining enabled by default in LDC when compiling
- claptrap (9/19) Aug 09 2020 If you enable link time optimisation you get cross module
- Per =?UTF-8?B?Tm9yZGzDtnc=?= (2/7) Aug 09 2020 Yes, I do. Thanks.
- Daniel Kozak (7/17) Aug 09 2020 I am not sure but last time I checked ldc does not do cross module
- Per =?UTF-8?B?Tm9yZGzDtnc=?= (2/7) Aug 10 2020 Are the official LDC-releases builtin with or without LTO?
- Daniel Kozak (5/13) Aug 10 2020 3
- kinke (11/17) Aug 10 2020 Most of them are, but not sure why that matters here (the gain is
- Daniel Kozak (22/31) Aug 09 2020 ldc2 --help-hidden | grep cross
Is cross-module-inlining enabled by default in LDC when compiling in release mode or do I have to use explicitly flag for it? I can't find any such flag from the output of neither ldc2 -h nor ldmd2 -h . Johan Engelen mentioned this, then experimental, flag in his DConf talk from 2017 [1] [1] https://www.youtube.com/watch?v=IZY67TBZ0V4
Aug 09 2020
On Sunday, 9 August 2020 at 22:18:13 UTC, Per Nordlöw wrote:Is cross-module-inlining enabled by default in LDC when compiling in release mode or do I have to use explicitly flag for it? I can't find any such flag from the output of neither ldc2 -h nor ldmd2 -h . Johan Engelen mentioned this, then experimental, flag in his DConf talk from 2017 [1] [1] https://www.youtube.com/watch?v=IZY67TBZ0V4If you enable link time optimisation you get cross module inlining, -flto=full I'm not 100% sure but I think LDC did cross module inlining by default at some point, then I updated the compiler and had to add the LTO thing. I think there is an option to enable just cross module inlining, but if you want speed you'll probably want to have LTO enabled anyway?
Aug 09 2020
On Sunday, 9 August 2020 at 22:45:16 UTC, claptrap wrote:I'm not 100% sure but I think LDC did cross module inlining by default at some point, then I updated the compiler and had to add the LTO thing. I think there is an option to enable just cross module inlining, but if you want speed you'll probably want to have LTO enabled anyway?Yes, I do. Thanks.
Aug 09 2020
On Mon, Aug 10, 2020 at 12:50 AM claptrap via Digitalmars-d-learn < digitalmars-d-learn puremagic.com> wrote:On Sunday, 9 August 2020 at 22:18:13 UTC, Per Nordl=C3=B6w wrote:I am not sure but last time I checked ldc does not do cross module inlinig by default, and LTO only help if your ldc(druntime+phobos) are built with enabled LTO[1] [1] https://github.com/ldc-developers/ldc/issues/2182#issuecomment-34316663= 3...If you enable link time optimisation you get cross module inlining, -flto=3Dfull I'm not 100% sure but I think LDC did cross module inlining by default at some point, then I updated the compiler and had to add the LTO thing. I think there is an option to enable just cross module inlining, but if you want speed you'll probably want to have LTO enabled anyway?
Aug 09 2020
On Monday, 10 August 2020 at 05:54:14 UTC, Daniel Kozak wrote:I am not sure but last time I checked ldc does not do cross module inlinig by default, and LTO only help if your ldc(druntime+phobos) are built with enabled LTO[1] [1] https://github.com/ldc-developers/ldc/issues/2182#issuecomment-343166633Are the official LDC-releases builtin with or without LTO?
Aug 10 2020
On Mon, Aug 10, 2020 at 1:15 PM Per Nordl=C3=B6w via Digitalmars-d-learn < digitalmars-d-learn puremagic.com> wrote:On Monday, 10 August 2020 at 05:54:14 UTC, Daniel Kozak wrote:3I am not sure but last time I checked ldc does not do cross module inlinig by default, and LTO only help if your ldc(druntime+phobos) are built with enabled LTO[1] [1] https://github.com/ldc-developers/ldc/issues/2182#issuecomment-34316663=Are the official LDC-releases builtin with or without LTO?AFAIK only for OSX, but Arch linux ldc package is now build with LTO enabled
Aug 10 2020
On Monday, 10 August 2020 at 11:11:57 UTC, Per Nordlöw wrote:Are the official LDC-releases builtin with or without LTO?Most of them are, but not sure why that matters here (the gain is almost negligible and mainly interesting for the C++ parts - as all D files are compiled to a single object file anyway).On Monday, 10 August 2020 at 05:54:14 UTC, Daniel Kozak wrote:Right, it's still experimental and has issues.I am not sure but last time I checked ldc does not do cross module inlinig by default,That's only true if (mostly non-templated) functions in druntime/Phobos are to be cross-module inlined, just like any other library. In that case, you can simply use `-flto=<thin|full> -defaultlib=phobos2-ldc-lto,druntime-ldc-lto` with LDC builds shipping with LTO druntime/Phobos and don't have to recompile druntime/Phobos manually anymore.and LTO only help if your ldc(druntime+phobos) are built with enabled LTO
Aug 10 2020
On Mon, Aug 10, 2020 at 12:20 AM Per Nordl=C3=B6w via Digitalmars-d-learn < digitalmars-d-learn puremagic.com> wrote:Is cross-module-inlining enabled by default in LDC when compiling in release mode or do I have to use explicitly flag for it? I can't find any such flag from the output of neither ldc2 -h nor ldmd2 -h Johan Engelen mentioned this, then experimental, flag in his DConf talk from 2017 [1] [1] https://www.youtube.com/watch?v=3DIZY67TBZ0V4ldc2 --help-hidden | grep cross --disable-demotion - Clone multicolor basic blocks but do not demote cross scopes * --enable-cross-module-inlining=3D<value> - (*) Enable cross-module function inlining (default disabled)* --iterative-counter-promotion - Allow counter promotion across the whole loop nest. --jump-threading-across-loop-headers - Allow JumpThreading to thread across loop headers, for testing --licm-n2-threshold=3D<int> - How many instruction to cross product using AA --lsr-backedge-indexing - Enable the generation of cross iteration indexed memops =3Dcross-dso-cfi - Cross-DSO CFI =3Dcross-dso-cfi - Cross-DSO CFI --split-dwarf-cross-cu-references - Enable cross-cu references in DWO files --x86-align-branch-boundary=3D<uint
Aug 09 2020