On Saturday, 31 May 2014 at 23:30:41 UTC, Walter Bright wrote:
On 5/31/2014 4:06 PM, Nordlöw wrote:
I've looked around in DMD for a suitable place to add checks
for this but
haven't found the spot where range-check is injected. Help
anyone?
There isn't a suitable place. To make it work, data
On 5/31/2014 3:56 AM, bearophile wrote:
Even adding logic to remove 20% of the bound checks in numeric code is going to
help D
https://github.com/D-Programming-Language/dmd/pull/3620
Walter Bright:
https://github.com/D-Programming-Language/dmd/pull/3620
Yes, it's a start point :-)
Bye,
bearophile
Sorry for my slow answering, I'm trying to catch up.
Kagamin:
Shouldn't optimization go a different route?
1. Get annoying performance problem.
2. Diagnose it.
3. Optimize the hot spot.
Do you have 1?
That's a good strategy if you are optimizing user code. But even
when you write library
deadalnix:
I think we should focus on solving problems that modern backend
aren't capable to optimize.
I agree. But those D snippets I have written are not able to show
what the backends are or aren't able to do. Generally if you
compile D code even with LDC2 you see a significant
Dmitry Olshansky:
It would be interesting if you could point to a precedent of
expression-level attribute used for enforcing that compiler
does elide bounds checking
Perhaps that's a little invention of mine :-)
In the last years I've seen that while optimizations are
important, there are
On Thursday, 5 June 2014 at 09:36:53 UTC, bearophile wrote:
deadalnix:
I think we should focus on solving problems that modern backend
aren't capable to optimize.
I agree. But those D snippets I have written are not able to
show what the backends are or aren't able to do. Generally if
you
On Saturday, 31 May 2014 at 10:56:06 UTC, bearophile wrote:
Even adding logic to remove 20% of the bound checks in numeric
code is going to help D because I think more and more people
will not disable bound checks in D.
What speedup those 20% will give? 3%? Shouldn't optimization go a
On Monday, 2 June 2014 at 09:46:03 UTC, bearophile wrote:
There are papers that show a 20-100% improvement in performance
coming from disabling array bound checks in programs that use
arrays a lot, like most scientific programs. And D language
seems fit for some heavy numerical work.
Kagamin:
Scientific programs usually process trusted data (or easily
validated), so they may need correctness checks, but don't need
security checks.
I agree.
If you see the algorithm works with bound checks, you can turn
them off.
Algorithms go in different code paths, so different
deadalnix:
What do GDC or LDC generate for these sample code with
optimizations on ?
This is not an interesting question because those two programs
are meant as parts of larger programs. ldc2 optimizes away both
programs to xorl %eax, %eax.
And I can't test on GDC because GDC compiler
Dmitry Olshansky:
An expression attribute? Why turn language into a mess over
this tiny problem?
It seems to me that you are considering solutions that add
arbitrary amounts of complexity to solve relatively small
problems.
...
That just epithet is remarkable self-destruction.
Please be
On 2 June 2014 10:24, bearophile via Digitalmars-d
digitalmars-d@puremagic.com wrote:
deadalnix:
What do GDC or LDC generate for these sample code with optimizations on ?
This is not an interesting question because those two programs are meant as
parts of larger programs. ldc2 optimizes
Iain Buclaw:
1) Get a newer version of GDC
2) Raise bugs - you do this for DMD. Why not GDC?
I don't know what to report, it just crashes, with no error
messages.
Bye,
bearophile
On 2 June 2014 12:40, bearophile via Digitalmars-d
digitalmars-d@puremagic.com wrote:
Iain Buclaw:
1) Get a newer version of GDC
2) Raise bugs - you do this for DMD. Why not GDC?
I don't know what to report, it just crashes, with no error messages.
Bye,
bearophile
That doesn't sound
On 6/2/2014 4:40 AM, bearophile wrote:
I don't know what to report, it just crashes, with no error messages.
Report the source code you fed to it that caused the crash.
Walter Bright:
Report the source code you fed to it that caused the crash.
Even hello world crashes.
Bye,
bearophile
On 2 June 2014 17:33, bearophile via Digitalmars-d
digitalmars-d@puremagic.com wrote:
Walter Bright:
Report the source code you fed to it that caused the crash.
Even hello world crashes.
Bye,
bearophile
Then that is a start. Post a bug and report clearly what your environment is.
Please be more gentle toward others. Your attitude is poisonous
for creativity, and while I have a thick hide and I can ignore
Yes, please!
Be good to your fellow D coders!
02-Jun-2014 13:46, bearophile пишет:
Dmitry Olshansky:
An expression attribute? Why turn language into a mess over this tiny
problem?
It seems to me that you are considering solutions that add arbitrary
amounts of complexity to solve relatively small problems.
...
That just epithet is
On Monday, 2 June 2014 at 09:24:38 UTC, bearophile wrote:
deadalnix:
What do GDC or LDC generate for these sample code with
optimizations on ?
This is not an interesting question because those two programs
are meant as parts of larger programs. ldc2 optimizes away both
programs to xorl
On 2 Jun 2014 17:49, Iain Buclaw ibuc...@gdcproject.org wrote:
On 2 June 2014 17:33, bearophile via Digitalmars-d
digitalmars-d@puremagic.com wrote:
Walter Bright:
Report the source code you fed to it that caused the crash.
Even hello world crashes.
Bye,
bearophile
Then
Daniel Murphy:
There are cases where it should be able to tell without data
flow analysis but are currently not implemented.
Such cases are not rare:
https://issues.dlang.org/show_bug.cgi?id=10594
https://issues.dlang.org/show_bug.cgi?id=10615
https://issues.dlang.org/show_bug.cgi?id=10749
Dmitry Olshansky:
Who are those people that are not disabling bounds checks in
system language ? :)
If you show D code on Reddit and you show to compile with
-noboundscheck you hear some people growl. I don't remember this
happening much in past. So I think the attitude toward disabling
On 5/31/14, 6:47 PM, Meta wrote:
On Saturday, 31 May 2014 at 23:30:41 UTC, Walter Bright wrote:
There isn't a suitable place. To make it work, data flow analysis
would have to be added to the front end. While doable, this is not a
simple addition. Eventually, we'll have to do it as a lot of
01-Jun-2014 14:21, bearophile пишет:
Dmitry Olshansky:
Who are those people that are not disabling bounds checks in system
language ? :)
If you show D code on Reddit and you show to compile with -noboundscheck
you hear some people growl. I don't remember this happening much in
past. So I
On Saturday, 31 May 2014 at 10:56:06 UTC, bearophile wrote:
void main() {
int[5] data;
foreach (const i; 0 .. 10)
data[i] = 0;
foreach (immutable i; 0 .. 10)
data[i] = 0;
int[10] big;
foreach (const i, x; big)
data[i] = x;
}
But the compiler must
For $/n VRP can't be used because it's geared toward constants,
not relative to variables. So VRP could inform of something
like this number is between 0 and 5, not this number is
between 0 and a.length. -- Andrei
That's what I thought of aswell. Are there any plans to formalize
the
My opinions about D array bound checks are slowly changing. I
still think -boundscheck=off is useful and good to have. But
now I am giving increasing importance to compiler logic that
optimizes away bound checks safely. People more and more want a
safe system language, more and more persons
On 31/05/2014 10:56 p.m., bearophile wrote:
My opinions about D array bound checks are slowly changing. I still
think -boundscheck=off is useful and good to have. But now I am giving
increasing importance to compiler logic that optimizes away bound checks
safely. People more and more want a safe
31-May-2014 14:56, bearophile пишет:
My opinions about D array bound checks are slowly changing. I still
think -boundscheck=off is useful and good to have. But now I am giving
increasing importance to compiler logic that optimizes away bound checks
safely.
Cool, I hope it means you are getting
Rikki Cattermole:
The first two foreach statements assignment statements should
be compile errors.
I'm actually a little bit surprised that we don't already test
for this.
But I spose that would actually be quite hard.
I don't know how hard it is. One purpose of this post is to ask
how
On 1/06/2014 12:04 a.m., bearophile wrote:
Rikki Cattermole:
The first two foreach statements assignment statements should be
compile errors.
I'm actually a little bit surprised that we don't already test for this.
But I spose that would actually be quite hard.
I don't know how hard it is.
void main() {
int[5] data;
foreach (const i; 0 .. 10)
data[i] = 0;
foreach (immutable i; 0 .. 10)
data[i] = 0;
int[10] big;
foreach (const i, x; big)
data[i] = x;
}
I'm not sure if bound checks should be removed here. Before
removal, this code gives
Wanderer:
void main() {
int[5] data;
foreach (const i; 0 .. 10)
data[i] = 0;
foreach (immutable i; 0 .. 10)
data[i] = 0;
int[10] big;
foreach (const i, x; big)
data[i] = x;
}
I'm not sure if bound checks should be removed here. Before
removal, this code
bound tests. This means that optimizing away bound checks is
becoming more and more important in D. And D can't ignore this
Expressions like
x[0 .. $/n]
and
x[$/n .. $]
are important in many divide and conquer (recursive) algorithms
such as quick-sort and shall not need bounds check simply
On 5/31/2014 4:06 PM, Nordlöw wrote:
I've looked around in DMD for a suitable place to add checks for this but
haven't found the spot where range-check is injected. Help anyone?
There isn't a suitable place. To make it work, data flow analysis would have to
be added to the front end. While
On 5/31/2014 5:02 PM, Nordlöw wrote:
Could you elaborate a bit on what data flow optimizations mean?
http://en.wikipedia.org/wiki/Data-flow_analysis
What other kinds of optimizations will become possible?
Escape analysis, for one.
http://en.wikipedia.org/wiki/Escape_analysis
Is this
On Saturday, 31 May 2014 at 23:30:41 UTC, Walter Bright wrote:
There isn't a suitable place. To make it work, data flow
analysis would have to be added to the front end. While doable,
this is not a simple addition. Eventually, we'll have to do it
as a lot of things become possible better with
Meta wrote in message news:pogogtdjyetukenny...@forum.dlang.org...
I've always wondered if VRP can be leveraged in certain situations. I
can't remember exactly how it's supposed to work, but very basically,
isn't it just numeric variables (and expressions?) having an associated
range that
40 matches
Mail list logo