Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Inlining report

Sjoerd_Meijer
Beginner
407 Views

Hi,

I am using icpc version 13.1.0 and I am puzzled why my function is not inlined. The function is a overloaded  + operator, with only a few additions inside. I tried to put the definition inside the class (implicit inlining?), but also the keywords __inline and __forceinline when the definition was not put in the class. In addition, I also tried the compiler options -inline-forceinline and -no-inline-factor, but all without luck. To understand why this function is not inlined, I am using option -opt-report. Find below a report snippet of what I think is the relevant part:

    <test.cpp;81:94;IPO INLINING;main;0>
    INLINING REPORT: (main) [1/2=50.0%]

    -> printf(EXTERN)
    -> _ZN6md_vecaSERKS_(EXTERN)
    -> (NOFORCE): _ZN6md_vecplERKS_(1) (isz = 13) (sz = 22 (7+15))
    <test.cpp;57:76;IPO INLINING;_ZN6md_vecplERKS_;0>

    INLINING REPORT: (_ZN6md_vecplERKS_) [2/2=100.0%]

The problem is that I don't know how to read this. So here are my questions:

- can the verbosity be increased, or can it be printed in a more human readable form?

- is there any documentation on this?

- I also tried option -diag-dump and do see some 

  "forceinline could not be honored due to safety/correctness checks"

  and 

  "__inline and __forceinline are not allowed here"

  but I am not sure to what it applies, so it doesn't give me more clues either.

Any idea is more than welcome.

Thanks in advance,

Sjoerd.

0 Kudos
5 Replies
Sjoerd_Meijer
Beginner
407 Views

By the way, GCC has no problem inlining the function.

0 Kudos
Sukruth_H_Intel
Employee
407 Views

Hi Sjoerd,

                  Could you please forward me the source file for which there is no inlining happening? Also provide me with the icpc -V output and the compiler options that you have used.

Regards,

Sukruth H V

       

0 Kudos
SergeyKostrov
Valued Contributor II
407 Views
Could you also upload test.s file generated by the compiler?
0 Kudos
Sjoerd_Meijer
Beginner
407 Views

I am sorry for the noise, but I can't reproduce things at the moment. That is, I see things being inlined now. I have to figure out what has changed. Thanks already for the quick responses.

0 Kudos
SergeyKostrov
Valued Contributor II
407 Views
>>... I can't reproduce things at the moment. That is, I see things being inlined now... That's OK and thank you for the update!
0 Kudos
Reply