I am compiling code with clang
with -O4 optimization. However, I want to disable inlining of functions. I have my own LLVM pass that injects some code to the generated code. After my pass, I want to enable the inlining of functions. How can I do that.
The -fno-inline-functions will disable this optimization. Inline functions which are explicitly or implicitly marked inline.
DESCRIPTION. The opt command is the modular LLVM optimizer and analyzer. It takes LLVM source files as input, runs the specified optimizations or analyses on it, and then outputs the optimized file.
LLVM currently does not optimize well loads and stores of large aggregate types (i.e. structs and arrays). As an alternative, consider loading individual fields from memory. Aggregates that are smaller than the largest (performant) load or store instruction supported by the targeted hardware are well supported.
Use the command-line option -O0 (-[capital o][zero]) to disable optimization, and -S to get assembly file.
You can use opt which says it can run passes in any order.
clang -c main.cpp -O0 -emit-llvm | opt -load yourplugin -yourpass -inline
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With