Inlining problem

Inlining problem

Hi,

I'm trying to take advantage of the optimization reports to improve performance.

However, I've got some issues with the use of the "-opt-report" options.

I think these issues are related to the directory structure of my source files.

Source files are stored in an nested directory tree, each directory having its own Makefile, as in the sample code attached to this post.

In order to compile the attached code, you first have to change the "DIR_HOME" variable in the "Make.inc" file to the path where the code is stored.

The creation of a library using the command

xiar -qopt-report -qopt-report-phase=ipo -qopt-report=3 

generates the optimization report file "ipo_out.optrpt" in the directory "dir_1":

    Report from: Interprocedural optimizations [ipo]

	IPO OPTIMIZATION REPORT:
  WHOLE PROGRAM (SAFE) [EITHER METHOD]: false

	  WHOLE PROGRAM (SEEN) [TABLE METHOD]: false

	  WHOLE PROGRAM (READ) [OBJECT READER METHOD]: false
INLINING OPTION VALUES:

	  -inline-factor: 100

	  -inline-min-size: 30

	  -inline-max-size: 230

	  -inline-max-total-size: 2000

	  -inline-max-per-routine: disabled

	  -inline-max-per-compile: disabled

	Begin optimization report for: dir_1_file_2_module._
    Report from: Interprocedural optimizations [ipo]
INLINE REPORT: (dir_1_file_2_module._) [1/2=50.0%]
===========================================================================
Begin optimization report for: dir_1_file_2_module_mp_sub_5b_
    Report from: Interprocedural optimizations [ipo]
INLINE REPORT: (dir_1_file_2_module_mp_sub_5b_) [2/2=100.0%]

	  -> dir_1_2_file_2_module_mp_sub_4_(EXTERN)

	  -> dir_1_2_file_1_module_mp_sub_3_(EXTERN)

	  -> dir_1_1_file_2_module_mp_sub_2_(EXTERN)

	  -> dir_1_1_file_1_module_mp_sub_1_(EXTERN)
===========================================================================

 

My first problem is that the optimization report only contains the info related to the last object file added to the lib, as if the report was overwritten.

The second problem is that none of the procedure are inlined, although they are "pure" procedures.

I guess that this is related to the fact that these procedures are found to be "EXTERN", which might be connected to the fact that the "WHOLE PROGRAM" indicator are all false.

What am I doing wrong ?

Thanks for your answer.

AttachmentSize
Download Optimization_report.tar.gz1.92 KB
3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I've attached a second version of the code in which all source files are stored in the same directory.

I'm still:

  1. not having whole program optimization
  2. not having any inlining
  3. overwriting the optimization report with the object file added to the lib.

 

 

Attachments: 

AttachmentSize
Download opt_rpt_v2.tar.gz1.1 KB

I managed to have the "whole program" optimization, which in turn, activated inlining across different source files.

For those who are interesed, the (rather simple) Makefiles for doing so are attached.

Attachments: 

AttachmentSize
Download version_3.tar.gz1.37 KB

Leave a Comment

Please sign in to add a comment. Not a member? Join today