Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29235 討論

Where are more details on the -ipo option? And other inline optimization related questions.

plediii
初學者
1,667 檢視
Hello,

I notice an intersting inline optimization option in the ifort manual: -ipo enable multi-file IP optimizations (between files)

I'm not sure what is the difference between IP optimizations and inlining. Is it possible this optimization allows inlining functions from separate object files? What is the range of the argument?

Whether or not it is possible to do inline optimization between object files, is it possible to do inline optimization between functions in the same file, but separate modules? For the sake of compilation speed, I like to split my projects into separate objects. But for the final version, I guess it would be useful to concatenate all the files together so that ifort can most effectively optimize the code; is that correct?

Paul
0 積分
5 回應
Mike_Rezny
新手
1,667 檢視
Quoting - plediii
Hello,

I notice an intersting inline optimization option in the ifort manual: -ipo enable multi-file IP optimizations (between files)

I'm not sure what is the difference between IP optimizations and inlining. Is it possible this optimization allows inlining functions from separate object files? What is the range of the argument?

Whether or not it is possible to do inline optimization between object files, is it possible to do inline optimization between functions in the same file, but separate modules? For the sake of compilation speed, I like to split my projects into separate objects. But for the final version, I guess it would be useful to concatenate all the files together so that ifort can most effectively optimize the code; is that correct?

Paul

-ip (from memory, this is on by default for -O2, -O3) inlines code on a single file
-ipo does multifile optimization

Documentation sources:
The Fortran compiler manual:
Compiler Options: Alphabetical Compiler Options
Optimising Applications: Using Interprocedural Optimization

will tell you almost all you need to know.

-opt-report -opt-report-phase=ipo
will give reports on what the compiler has done.

regards
MIke

TimP
榮譽貢獻者 III
1,667 檢視
Quoting - Mike Rezny

-ip (from memory, this is on by default for -O2, -O3) inlines code on a single file
-ipo does multifile optimization

Documentation sources:
The Fortran compiler manual:
Compiler Options: Alphabetical Compiler Options
Optimising Applications: Using Interprocedural Optimization


-ip is only partially enabled by default in ifort 11.1, as full -ip was found too aggressive. So you may see differences when you set either -no-ip to remove it entirely or -ip to set the limits higher. Several of those limits may be adjusted individually, as described in the documentation.
plediii
初學者
1,667 檢視
Thank you. The opt-report output in particular looks useful. Is there is more information on the opt-report output? Specifically, I wonder why some functions are not being inlined. And also, why do I only get inlining reports if I do *not* use the -ipo option?

Specifically, I see lines like this in the INLINE REPORT for each function:
-> types_mp_for_non_bond_pairs_(11) (isz = 177) (sz = 184 (63+121))

I have tried to decipher it using the "Intel Fortran Compiler User and Reference Guides." I didn't see any details about the profile report in the other sources you pointed to.

In the Reference Guides it says "If a function is inlined, the function line has the prefix "-> INLINE: _" Since that function does not have that prefix (and some others do) I assume the function wasn't inlined, but since there is no (EXTERN) or (ARGS_IN_REGS), I don't know why it was not inlined. Nor do I know what the meaning of the optimized size, isz, is for. In what way was it optimized if not inlined?

Quoting - Mike Rezny

-ip (from memory, this is on by default for -O2, -O3) inlines code on a single file
-ipo does multifile optimization

Documentation sources:
The Fortran compiler manual:
Compiler Options: Alphabetical Compiler Options
Optimising Applications: Using Interprocedural Optimization

will tell you almost all you need to know.

-opt-report -opt-report-phase=ipo
will give reports on what the compiler has done.

regards
MIke


Steven_L_Intel1
1,667 檢視
See Mike's pointer to the documentation. There is a lot of detail there.
Mike_Rezny
新手
1,667 檢視
Quoting - plediii


Hi,
The compiler uses some heuristics to determine whether it is effective to perform inlining.
Inlining does not always improve the performance of an application.

You might want to read the Fortran Compiler Documentation:
Optimizing Applications: Using Interprocedural Optimization (IPO): Inline Expansion of Functions

Also, look at the documentation for all the -inline type compiler options, there are nine of them.

Also look at the documentation for the compiler directive to force inlining:
CDEC$ ATTRIBUTE FORCEINLINE

in A to Z Reference: A to B: ATTRIBUTES

regards
Mike

回覆