Good project: stride() with constant stride value
John Colvin via Digitalmars-d
digitalmars-d at puremagic.com
Fri Mar 4 18:50:46 PST 2016
On Friday, 4 March 2016 at 23:33:40 UTC, Andrei Alexandrescu
wrote:
> On 03/04/2016 04:19 PM, H. S. Teoh via Digitalmars-d wrote:
>> Why not rather improve dmd optimization, so that such manual
>> optimizations are no longer necessary?
>
> As I mentioned, optimizing the use of stride in large
> (non-inlined) functions is a tall order. -- Andrei
It seems to me that if the stride is available in the calling
scope as usable for a stride template parameter (i.e. as a
compile-time value ) then it would also be just as available to
the optimiser after the trivial inlining of stride (note not any
arbitrarily complex code that contains stride, just stride).
Sure, if you nest it away in un-inlineable constructs then it
won't be easily optimised, but you wouldn't be able to use it as
a template parameter then anyway.
Do you have a concrete example where the optimisation(s) you want
to occur cannot be done with `stride` as it is?
More information about the Digitalmars-d
mailing list