On 06/20/2018 07:23 PM, Hrishikesh Kulkarni wrote:
> Hi,
> 
> Please find the diff file for dumping tree type stats attached here with.
> 
> example:
> 
> $ ../stage1-build/gcc/lto1 test_hello.o -fdump-lto-tree-type-stats
> Reading object files: test_hello.o
>     integer_type    3
>     pointer_type    3
>     array_type    1
>     function_type    4
> 
> I have pushed the changes on Github repo.

Hi.

Good progress here. I would also dump statistics for GIMPLE statements.
If you configure gcc with  --enable-gather-detailed-mem-stats, you should
see:

./xgcc -B. /tmp/main.c -fmem-report -O2
...
GIMPLE statements
Kind                   Stmts      Bytes
---------------------------------------
assignments                6        480
phi nodes                  0          0
conditionals               8        640
everything else           21       1368
---------------------------------------
Total                     35       2488
...

Take a look at dump_gimple_statistics,   gimple_alloc_counts,
gimple_alloc_sizes.

We do the same for trees:

static uint64_t tree_code_counts[MAX_TREE_CODES];
uint64_t tree_node_counts[(int) all_kinds];
uint64_t tree_node_sizes[(int) all_kinds];

I believe the infrastructure should be shared.

Martin


> 
> Regards,
> 
> Hrishikesh
> 
> On Mon, Jun 18, 2018 at 2:15 PM, Martin Jambor <mjam...@suse.cz> wrote:
>> Hi,
>>
>> On Sun, Jun 17 2018, Hrishikesh Kulkarni wrote:
>>> Hi,
>>>
>>> I am trying to isolate the dump tool into real lto-dump tool. I have
>>> started with the copy&paste of lto.c into lto-dump.c and done the
>>> changes to Make-lang.in and config-lang.in suggested by Martin (patch
>>> attached). However when I try to build, I get the following error:
>>>
>>> In file included from ../../gcc/gcc/lto/lto-dump.c:24:0:
>>>
>>> ../../gcc/gcc/coretypes.h:397:24: fatal error: insn-modes.h: No such
>>>
>>> file or directory
>>>
>>> compilation terminated.
>>>
>>>
>>> I am unable to find the missing dependencies and would be grateful for
>>> suggestions on how to resolve the issue.
>>
>> insn-modes.h is one of header files which are generated at build time,
>> you will find it in the gcc subdirectory of your build directory (as
>> opposed to the source directory).
>>
>> Martin

Reply via email to