Expressions simplification statistic
Hi all, i'm looking for a statistic of how many expressions simplification may be possible on source code, for example in some linux project. Otherwise how can i produce a statistic like that? tnx, Dino
Expressions simplification statistic
2006/10/17, Mike Stump <[EMAIL PROTECTED]>: On Oct 17, 2006, at 8:05 AM, Dino Puller wrote: > i'm looking for a statistic of how many expressions simplification > may be possible on source code One way would be: http://www.cs.fit.edu/~mmahoney/compression/text.html But it´s a benchmark about compression. though, this assumes a particular definition of simplification. For other definitions, gcc doesn't just tell you an answer, you'd have to define what you think a simplification is and then instrument gcc to provide that answer. This would be lots of hard work at best. For expressions simplification i mean simply mathematical simplificacions like: x/x=1 0*x=1 1*x=x and so on. bye, Dino
-fdump-tree explanation
Hi all, i want to make a statistic(i haven't found one) over linux source code, and i want to know how many times expressions are simplified by gcc. I've found that "-O -ftree-dominator-opts -fdump-tree-optimized" writes a file optimized, now if i can compare it with a not optimized one i win, "unfortunally" there are a lot of options for tree dumping, witch one shoud i use? tnx, Dino
fdump-tree explanation
Hi all, i want to make a statistic(i haven't found one) over linux source code, and i want to know how many times expressions are simplified by gcc. I've found that "-O -ftree-dominator-opts -fdump-tree-optimized" writes a file optimized, now if i can compare it with a not optimized one i win, "unfortunally" there are a lot of options for tree dumping, witch one shoud i use? tnx, Dino
fdump-tree explanation
From: Dino Puller <[EMAIL PROTECTED]> Date: 26-ott-2006 15.45 Subject: Re: fdump-tree explanation To: Ian Lance Taylor <[EMAIL PROTECTED]> 25 Oct 2006 09:55:30 -0700, Ian Lance Taylor <[EMAIL PROTECTED]>: "Dino Puller" <[EMAIL PROTECTED]> writes: > i want to make a statistic(i haven't found one) over linux source > code, and i want to know how many times expressions are simplified by > gcc. I don't think any of us know what you mean by "how many times expressions are simplified." Can you be more specific? Can you provide an example of what you want to look for, and an example of what you do not want to look for? How many times gcc simplify expressions like: x/x, 0*x, 1*y, a+0, x*x/x and so on Ian Dino
Re: fdump-tree explanation
2006/10/26, Diego Novillo <[EMAIL PROTECTED]>: Dino Puller wrote on 10/26/06 10:11: > How many times gcc simplify expressions like: x/x, 0*x, 1*y, a+0, > x*x/x and so on > You are probably looking at folding then. An initial idea might be to put some code in fold-const.c:fold that compares the input tree expression with the output, if they are different, increment your counter. The idea is a bit complex. Anyway the fold function has no one only return so i can't compare input tree with output one, and it's called from a lot of others functions of others files. Ian said to create a counter and increment it every time a role is triggered, it's seems better but it's not easy to find the right place to add my counter into a function of 3230 lines! Even if i find the right places to put my code, how can i output collected infos? tnx, Dino