May 2015
Intermediate to advanced
296 pages
5h 10m
English
As we know, by inlining we mean expanding the function body of the function called at the call site, as it may prove useful through faster execution of code. The compiler takes the decision whether to inline a function or not. In this recipe, you will learn to how to write a simple function-inlining pass that makes use of the implementation in LLVM for inlining. We will write a pass that will handle the functions marked with the alwaysinline attribute.
Let's write a test code that we will run our pass on. Make the necessary changes in the lib/Transforms/IPO/IPO.cpp and include/llvm/InitializePasses.h files, the include/llvm/Transforms/IPO.h file, and the /include/llvm-c/Transforms/IPO.h file ...
Read now
Unlock full access