Re: Does the compiler inline the predicate functions to std.algorithm.sort?

2018-03-19 Thread Johan Engelen via Digitalmars-d-learn
On Monday, 19 March 2018 at 12:45:58 UTC, tipdbmp wrote: the LLVM IR obtained with -output-ll might be easier to read than assembly.) I only seem to get assembly on d.godbolt.org, even with the -output-ll option. On d.godbolt.org, you can get LLVM IR with a trick: use `-output-s=false -outp

Re: Does the compiler inline the predicate functions to std.algorithm.sort?

2018-03-19 Thread Seb via Digitalmars-d-learn
On Monday, 19 March 2018 at 12:45:58 UTC, tipdbmp wrote: (@tipdbmp: The string gets turned into the function _D3std10functional__T9binaryFunVAyaa5_61203c2062VQra1_61VQza1_62Z__TQBvTiTiZQCdFNaNbNiNfKiKiZb. No references to it remain with -O3; the LLVM IR obtained with -output-ll might be easier to

Re: Does the compiler inline the predicate functions to std.algorithm.sort?

2018-03-19 Thread tipdbmp via Digitalmars-d-learn
(@tipdbmp: The string gets turned into the function _D3std10functional__T9binaryFunVAyaa5_61203c2062VQra1_61VQza1_62Z__TQBvTiTiZQCdFNaNbNiNfKiKiZb. No references to it remain with -O3; the LLVM IR obtained with -output-ll might be easier to read than assembly.) I see. It seems that ldc 1.8.0 wit

Re: Does the compiler inline the predicate functions to std.algorithm.sort?

2018-03-18 Thread David Nadlinger via Digitalmars-d-learn
On Sunday, 18 March 2018 at 14:15:37 UTC, Stefan Koch wrote: On Sunday, 18 March 2018 at 12:59:06 UTC, tipdbmp wrote: I can't read assembly but it seems to me that it doesn't: https://godbolt.org/g/PCsnPT I think C++'s sort can take a "function object" that can get inlined. Correct it does no

Re: Does the compiler inline the predicate functions to std.algorithm.sort?

2018-03-18 Thread Stefan Koch via Digitalmars-d-learn
On Sunday, 18 March 2018 at 12:59:06 UTC, tipdbmp wrote: I can't read assembly but it seems to me that it doesn't: https://godbolt.org/g/PCsnPT I think C++'s sort can take a "function object" that can get inlined. Correct it does not get in-lined. Even with -O3 it does not. The reason is that

Re: Does the compiler inline the predicate functions to std.algorithm.sort?

2018-03-18 Thread Radu via Digitalmars-d-learn
On Sunday, 18 March 2018 at 12:59:06 UTC, tipdbmp wrote: I can't read assembly but it seems to me that it doesn't: https://godbolt.org/g/PCsnPT I think C++'s sort can take a "function object" that can get inlined. add "-O3" also to the compiler switches.

Does the compiler inline the predicate functions to std.algorithm.sort?

2018-03-18 Thread tipdbmp via Digitalmars-d-learn
I can't read assembly but it seems to me that it doesn't: https://godbolt.org/g/PCsnPT I think C++'s sort can take a "function object" that can get inlined.