PGI not inlining function across files

Questions on using the PGI Compilers and Tools
yboetzel
Posts: 7
Joined: Nov 26 2019

PGI not inlining function across files

Post by yboetzel » Wed Nov 27, 2019 2:11 am

Hi

I'm trying to get inlining to work with PGI. I use the

Code: Select all

-Mextract=lib:lib.il,reshape,name:...
option to create an inline library and then want to inline using

Code: Select all

-Minline=lib:lib.il,reshape
This works for all function except for one that I cannot get to inline at all. I tried all other options, e.g. setting totalsize=10000, but it just doesn't want to inline this specific function, even though it is extracted correctly during the extract phase. This function is in a different file than from where it is called, so when I copy the function definition to the same file it actually inlines it correctly!

I'm not able to reproduce this at the moment, but are there any other options I can set during compilation to get more information about why it does or doesn't inline a function? Or are there any limitations on inlining across files?

Thanks
Yannick

mkcolg
Posts: 8137
Joined: Jun 30 2004

Re: PGI not inlining function across files

Post by mkcolg » Wed Nov 27, 2019 8:49 am

Hi Yannick,

This is the correct process for cross file inlining, so it's unclear what's wrong. Maybe it's a level issue, which by default is 2 levels? Try adding "-Minline=lib:lib.il,reshape,levels:10" to increase the call depth to 10 levels.

-Mat

yboetzel
Posts: 7
Joined: Nov 26 2019

Re: PGI not inlining function across files

Post by yboetzel » Wed Nov 27, 2019 9:35 am

Hi Mat

I thought so as well, but I tried all the options of the -Minline flag I think (totalsize, maxsize, smallsize, levels). But as the function is correctly inlined when it is in the same file it shouldn't be one of those. It's a bit inconvenient that I cannot provide you a reproducible example atm... Is there any option I can set (besides Minfo=inline) to get more info on why the function was ignored for inlining?

mkcolg
Posts: 8137
Joined: Jun 30 2004

Re: PGI not inlining function across files

Post by mkcolg » Wed Nov 27, 2019 10:35 am

No sorry.

yboetzel
Posts: 7
Joined: Nov 26 2019

Re: PGI not inlining function across files

Post by yboetzel » Wed Dec 04, 2019 7:32 am

Hi Mat

I found out that this is only a problem with the llvm code generator. If I compile the code with the

Code: Select all

-Mnollvm
flag then the functions are inlined correctly across files. Is this the expected behaviour? Are there any other options I need to set to get inlining to work with the llvm code generator? Or is inlining (across files) just not supported anymore with llvm?

Thanks
Yannick

Post Reply