Re: DMD2 vs LDC2 inliner

2019-02-26 Thread kinke via Digitalmars-d-learn
On Tuesday, 26 February 2019 at 04:36:59 UTC, James Blachly wrote: Sadly, the pragma does not accept enum: Error: pragma `inline` pragma(inline, true or false) expected, not inline_overlaps That's most likely a (trivial) bug and should be fixed. As stated in the docs, the pragma can also be

Re: DMD2 vs LDC2 inliner

2019-02-25 Thread James Blachly via Digitalmars-d-learn
On 2/25/19 2:09 AM, Nicholas Wilson wrote: Leaving aside the issue of why DMD can't handle this, the entire reason pragma(inline, bool) takes a bool is for it to be (potentially) predicated. In this case you want: version(DigitalMars)   private enum inline_overlaps = false; else //

Re: DMD2 vs LDC2 inliner

2019-02-25 Thread James Blachly via Digitalmars-d-learn
On 2/25/19 2:09 AM, Nicholas Wilson wrote: Leaving aside the issue of why DMD can't handle this, the entire reason pragma(inline, bool) takes a bool is for it to be (potentially) predicated. In this case you want: version(DigitalMars) private enum inline_overlaps = false; else // assuming

Re: DMD2 vs LDC2 inliner

2019-02-24 Thread Nicholas Wilson via Digitalmars-d-learn
On Monday, 25 February 2019 at 04:08:38 UTC, Jonathan M Davis wrote: One issue that's commonly brought up about dmd's inliner is that it's in the front-end, which apparently is a poor way to do inlining. One side effect of that though would be that unless the ldc folks go to extra effort to

Re: DMD2 vs LDC2 inliner

2019-02-24 Thread Nicholas Wilson via Digitalmars-d-learn
On Monday, 25 February 2019 at 02:49:36 UTC, James Blachly wrote: Any ideas why DMD2 cannot inline this, but LDC2 has no problem doing so -- or suggestions for what I can do to make DMD2 inline it? Alternatively, I could version(DigitalMars) and version(LDC), but AFAICT this requires me to

Re: DMD2 vs LDC2 inliner

2019-02-24 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, February 24, 2019 7:49:36 PM MST James Blachly via Digitalmars-d- learn wrote: > Any ideas why DMD2 cannot inline this, but LDC2 has no problem doing so > -- or suggestions for what I can do to make DMD2 inline it? The unfortunate reality of the matter is that dmd's inliner is very

DMD2 vs LDC2 inliner

2019-02-24 Thread James Blachly via Digitalmars-d-learn
Any ideas why DMD2 cannot inline this, but LDC2 has no problem doing so -- or suggestions for what I can do to make DMD2 inline it? Alternatively, I could version(DigitalMars) and version(LDC), but AFAICT this requires me to duplicate the entire template, because I cannot figure out how to