I am using GCC's -finline-limit=N compiler option. I am compiling my code and profiling it to check for reduction of CPU cycles. When I increase N, ideally, I should see a decrease in the number of cycles as larger functions get inlined. But I am seeing increase in the CPU cycles. Why is this happening?
Exact behavior of the -finline-limit GCC compiler option
2.2k Views Asked by Vinay At
1
There are 1 best solutions below
Related Questions in C
- Passing arguments to main in C using Eclipse
- kernel module does not print packet info
- error C2016 (C requires that a struct or union has at least one member) and structs typedefs
- Drawing with ncurses, sockets and fork
- How to catch delay-import dll errors (missing dll or symbol) in MinGW(-w64)?
- Configured TTL for A record(s) backing CNAME records
- Allocating memory for pointers inside structures in functions
- Finding articulation point of undirected graph by DFS
- C first fgets() is being skipped while the second runs
- C std library don't appear to be linked in object file
- gcc static library compilation
- How to do a case-insensitive string comparison?
- C programming: Create and write 2D array of files as function
- How to read a file then store to array and then print?
- Function timeouts in C and thread
Related Questions in PERFORMANCE
- Slow performance on ipad erasing image
- Can Apache Ant be told to cache its XML files?
- What are the pros and cons of the picture element?
- DB candidate as CouchDB/Schema replacement
- python member str performance too slow
- Split a large query (2 days) into pieces to increase the speed in Postgres
- Use GUI displayed results of SQL query vs new queries?
- fastest way to map a large number of longs
- Bash regular expression execution hangs on long expressions
- Why is calling a function so slow in Javascript?
- Performance of element-compare in java collections
- "Capture GPU Frame" in XCode -- iOS only?
- Efficiency penalty of initializing a struct/class within a loop
- Change the rotating speed of the circle when the mouse moves using javascript
- Replace foreach to make loop into queryable
Related Questions in INLINE-FUNCTIONS
- Code Coverage Inline Function
- Keil ARM C compiler: troubles with inline functions
- Can codeigniter support Inline functions.?
- Header-only and static-inline-only library in C
- Should we use macros, inline functions or just normal functions and trust the compiler?
- Are the "inline" keyword and "inlining" optimization separate concepts?
- Trying to understand an inline function
- const parameter with inline functions
- C++: What to recompile when an inline function in a dynamic library changes?
- Why do inline functions have to be defined in a header file?
- Can gcc inline an indirect function call through a constant array of function pointers?
- Crash when running application due to existence of unexecuted code in source file - c++
- Avoid calling T-SQL function multiple times
- C: Pointer to inline function
- C++ function used to work, now returning 0xfdfdfdfd
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
There are multiple parameters (--param) for inlining in gcc. finline-limit uses some of them.
You can find the parameters here:
gcc optimize-options (search for max-inline-insns-single)
You can get some information on GCCs inline-heuristik from the sourcecode: ipa-inline-analysis.c (the comment at the top)
Note: Reducing function calls, branching etc. via inlining does not always reduce CPU cycles. Setting finline-limit to a large number can make things worse. Using
__attribute__ ((flatten))on functions can produce better results. All optimizing parameters can produce different results depending on your instruction sets and compiler version.