[LLVMdev] How to control inlining in llvm?

Das, Dibyendu Dibyendu.Das at amd.com
Mon Jun 30 11:54:04 PDT 2014


I am at similar juncture and plan to tweak -inline-threshold for a start.

-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Yuri
Sent: Tuesday, July 01, 2014 12:00 AM
To: LLVM Developers Mailing List
Subject: [LLVMdev] How to control inlining in llvm?

I asked this question before, but wasn't satisfied with answers.

How can (expert) users control inlining in llvm? gcc has these
parameters: -finline-limit, --param max-inline-insns-single, --param inline-unit-growth, etc. What are the llvm equivalents?

While running large and complex industrial processes, I found that inlining can significantly change the speed of individual processes. 
Usually the more inlining there is, the faster the process runs. In gcc I actually was setting insanely high inlining values because that's what usually gave the fastest code, even though there should be some limit after which speed should theoretically degrade.

Now it looks like there are no llvm equivalents.

Answers given before are these: compiler should know better how to inline, users should trust compiler to "do the right thing", such options might not be stable between versions, compiler should just be faster without any such flags, many users will be tempted to set some values they don't understand and they will be floating in their makefiles forever without meaning.

For someone who is after the wall clock time such answers are naive. 
Compiler can't predict what heuristics the resulting code will exhibit under particular conditions. Maybe I want to inline 2X or 5X more than
-O3 allows, and I am willing to spend this CPU time on compile and see. 
There are customers for which 10% improvement means a lot of difference. 
Why does llvm take away such choice from the users?

This lack of inlining tuning variables is a sticking point for me in switching to clang.

Yuri
_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list