Re: dmd codegen improvements

2015-08-18 Thread Walter Bright via Digitalmars-d
On 8/18/2015 2:33 PM, deadalnix wrote: There is none. There is a ton of 0.5% one that adds up to the 30% difference. I regard a simple pattern that nets 0.5% as quite a worthwhile win. That's only 60 of those to make up the difference. If you've got any that you know of that would net 0.5%

Re: dmd codegen improvements

2015-08-18 Thread H. S. Teoh via Digitalmars-d
On Tue, Aug 18, 2015 at 02:25:34PM -0700, Walter Bright via Digitalmars-d wrote: On 8/18/2015 1:47 PM, deadalnix wrote: Realistically, D does not have the man power required to reach the same level of optimization, and have many higher impact task to spend that manpower on. dmd also does a

Re: dmd codegen improvements

2015-08-18 Thread Walter Bright via Digitalmars-d
On 8/18/2015 2:57 PM, H. S. Teoh via Digitalmars-d wrote: From the little that I've seen of dmd's output, it seems that it's rather weak in the areas of inlining and loop unrolling / refactoring. DMD does not do loop unrolling. I've thought about it many times, but just never did it. In

Re: dmd codegen improvements

2015-08-18 Thread Walter Bright via Digitalmars-d
On 8/18/2015 2:32 PM, Joseph Rushton Wakeling wrote: However true that may be in general, those almost certainly aren't the reasons why ddmd benchmarks 30% slower than dmd. I would suspect that particular speed difference is heavily backend-dependent. That's exactly why I started this thread.

Re: dmd codegen improvements

2015-08-18 Thread rsw0x via Digitalmars-d
On Tuesday, 18 August 2015 at 21:53:43 UTC, Meta wrote: On Tuesday, 18 August 2015 at 21:45:42 UTC, rsw0x wrote: If you want D to have a GC, you have to design the language around having a GC. Right now, D could be likened to using C++ with Boehm. The irony is that most GC-related complaints

Re: dmd codegen improvements

2015-08-18 Thread deadalnix via Digitalmars-d
On Tuesday, 18 August 2015 at 21:55:26 UTC, Walter Bright wrote: On 8/18/2015 2:33 PM, deadalnix wrote: There is none. There is a ton of 0.5% one that adds up to the 30% difference. I regard a simple pattern that nets 0.5% as quite a worthwhile win. That's only 60 of those to make up the

Re: dmd codegen improvements

2015-08-18 Thread Walter Bright via Digitalmars-d
On 8/18/2015 2:57 PM, H. S. Teoh via Digitalmars-d wrote: like eliminating redundant loads Turns out you were right. https://github.com/D-Programming-Language/dmd/pull/4906

Re: dmd codegen improvements

2015-08-18 Thread Meta via Digitalmars-d
On Tuesday, 18 August 2015 at 22:01:16 UTC, rsw0x wrote: On Tuesday, 18 August 2015 at 21:53:43 UTC, Meta wrote: On Tuesday, 18 August 2015 at 21:45:42 UTC, rsw0x wrote: If you want D to have a GC, you have to design the language around having a GC. Right now, D could be likened to using C++

Re: dmd codegen improvements

2015-08-18 Thread rsw0x via Digitalmars-d
On Wednesday, 19 August 2015 at 01:52:56 UTC, Meta wrote: On Tuesday, 18 August 2015 at 22:01:16 UTC, rsw0x wrote: On Tuesday, 18 August 2015 at 21:53:43 UTC, Meta wrote: On Tuesday, 18 August 2015 at 21:45:42 UTC, rsw0x wrote: If you want D to have a GC, you have to design the language

Re: dmd codegen improvements

2015-08-18 Thread Vladimir Panteleev via Digitalmars-d
On Tuesday, 18 August 2015 at 19:02:20 UTC, Walter Bright wrote: On 8/18/2015 5:37 AM, Vladimir Panteleev wrote: IIRC, I have had three releases affected by optimization/inlining DMD bugs (two of Digger and one of RABCDAsm). These do not speak well for D when end-users ask me what the cause of

Re: dmd codegen improvements

2015-08-18 Thread Jacob Carlborg via Digitalmars-d
On 2015-08-18 20:59, Walter Bright wrote: There is some potential there, but since a static compiler doesn't do runtime profiling, some sort of hinting scheme would have to be invented. There's profile guided optimization, which LLVM supports. -- /Jacob Carlborg

Re: dmd codegen improvements

2015-08-18 Thread deadalnix via Digitalmars-d
On Tuesday, 18 August 2015 at 21:25:35 UTC, Walter Bright wrote: On 8/18/2015 1:47 PM, deadalnix wrote: Realistically, D does not have the man power required to reach the same level of optimization, and have many higher impact task to spend that manpower on. dmd also does a sludge of

Re: dmd codegen improvements

2015-08-18 Thread Walter Bright via Digitalmars-d
On 8/18/2015 1:24 PM, Vladimir Panteleev wrote: The specific bugs in question have been fixed, but that doesn't change the general problem. The reason we have regression tests is to make sure things that are fixed stay fixed. Codegen bugs also always had the highest priority. Being

Re: dmd codegen improvements

2015-08-18 Thread Walter Bright via Digitalmars-d
On 8/18/2015 2:25 PM, Vladimir Panteleev wrote: I would like to add that fixing the regression does not make it go away. Even though it's fixed in git, and even after the fix ships with a new DMD release, there is still a D version out there that has the bug, and that will never change until the

Re: dmd codegen improvements

2015-08-18 Thread Joseph Rushton Wakeling via Digitalmars-d
On Tuesday, 18 August 2015 at 21:26:43 UTC, rsw0x wrote: On Tuesday, 18 August 2015 at 21:18:34 UTC, rsw0x wrote: D has far, far bigger performance problems that dmd's backend. However true that may be in general, those almost certainly aren't the reasons why ddmd benchmarks 30% slower than

Re: dmd codegen improvements

2015-08-18 Thread deadalnix via Digitalmars-d
On Tuesday, 18 August 2015 at 21:26:43 UTC, rsw0x wrote: On Tuesday, 18 August 2015 at 21:18:34 UTC, rsw0x wrote: On Tuesday, 18 August 2015 at 10:45:49 UTC, Walter Bright wrote: Martin ran some benchmarks recently that showed that ddmd compiled with dmd was about 30% slower than when compiled

Re: dmd codegen improvements

2015-08-18 Thread via Digitalmars-d
On Tuesday, 18 August 2015 at 21:48:13 UTC, rsw0x wrote: D's current GC could see improvements, but it will never ever catch up to the GC of any other major language without changes to the language itself. There's been lots and lots and lots of forum discussions in the past few years of how

Re: dmd codegen improvements

2015-08-18 Thread Walter Bright via Digitalmars-d
On 8/18/2015 5:27 PM, Walter Bright wrote: On 8/18/2015 5:07 PM, Ivan Kazmenko wrote: Sorry to repeat myself, but isn't https://issues.dlang.org/show_bug.cgi?id=11821 such an example? Yes, absolutely. I remarked it as an enhancement request.

Re: dmd codegen improvements

2015-08-18 Thread H. S. Teoh via Digitalmars-d
On Tue, Aug 18, 2015 at 03:25:38PM -0700, Walter Bright via Digitalmars-d wrote: On 8/18/2015 2:57 PM, H. S. Teoh via Digitalmars-d wrote: From the little that I've seen of dmd's output, it seems that it's rather weak in the areas of inlining and loop unrolling / refactoring. DMD does not

Re: dmd codegen improvements

2015-08-18 Thread Walter Bright via Digitalmars-d
On 8/18/2015 4:05 PM, H. S. Teoh via Digitalmars-d wrote: Maybe when I get some free time this week, I could look at the disassembly of one of my programs again to give some specific examples. Please do.

Re: dmd codegen improvements

2015-08-18 Thread Walter Bright via Digitalmars-d
On 8/18/2015 3:07 PM, Joseph Rushton Wakeling wrote: I was backing up your rationale, even if I disagree with your prioritizing these concerns at this stage of the dmd = ddmd transition. I want to move to ddmd right now, and I mean right now. But it's stalled, awaiting Daniel and Martin.

Re: dmd codegen improvements

2015-08-18 Thread Walter Bright via Digitalmars-d
On 8/18/2015 3:17 PM, welkam wrote: People are lazy and if it takes more than one click people wont use it. Just like unitesting everyone agrees that its good to write them but nobody does that. When you put unitesting in compiler more people are writing tests. PGO is awesome, but it needs to be

Re: dmd codegen improvements

2015-08-18 Thread Ivan Kazmenko via Digitalmars-d
On Tuesday, 18 August 2015 at 23:30:26 UTC, Walter Bright wrote: On 8/18/2015 4:05 PM, H. S. Teoh via Digitalmars-d wrote: Maybe when I get some free time this week, I could look at the disassembly of one of my programs again to give some specific examples. Please do. Sorry to repeat

Re: dmd codegen improvements

2015-08-18 Thread Walter Bright via Digitalmars-d
On 8/18/2015 5:07 PM, Ivan Kazmenko wrote: Sorry to repeat myself, but isn't https://issues.dlang.org/show_bug.cgi?id=11821 such an example? Yes, absolutely.

Re: dmd codegen improvements

2015-08-18 Thread Ivan Kazmenko via Digitalmars-d
On Tuesday, 18 August 2015 at 10:45:49 UTC, Walter Bright wrote: ... 3. data flow analysis optimizations like constant propagation, dead code elimination, register allocation, loop invariants, etc. Modern compilers (including dmd) do all three. So if you're comparing code generated by

Re: dmd codegen improvements

2015-08-18 Thread Walter Bright via Digitalmars-d
On 8/18/2015 6:01 AM, ponce wrote: One thing that was striking to me is that it by and large it doesn't use PUSH, POP, and SETcc. Actually I don't remember such an instruction being emitted by it. And indeed using PUSH/POP/SETcc in assembly were often slower than the alternative. Which is

Re: dmd codegen improvements

2015-08-18 Thread Joakim via Digitalmars-d
On Tuesday, 18 August 2015 at 15:45:25 UTC, anonymous wrote: On Tuesday, 18 August 2015 at 15:22:15 UTC, Joakim wrote: Also, soon the dmd compiler backend will be the only one written in D. :) Soon the front end will be written in D. And the front end is shared among dmd, gdc, ldc. Walter

Re: dmd codegen improvements

2015-08-18 Thread anonymous via Digitalmars-d
On Tuesday, 18 August 2015 at 15:22:15 UTC, Joakim wrote: Also, soon the dmd compiler backend will be the only one written in D. :) Soon the front end will be written in D. And the front end is shared among dmd, gdc, ldc. Walter has expressed a desire to port the back end to D, too [1]. But

Re: dmd codegen improvements

2015-08-18 Thread Joakim via Digitalmars-d
On Tuesday, 18 August 2015 at 12:37:37 UTC, Vladimir Panteleev wrote: I think stability of the DMD backend is a goal of much higher value than the performance of the code it emits. DMD is never going to match the code generation quality of LLVM and GCC, which have had many, many man-years

<    1   2   3   4