[LLVMdev] Does the gcc frontend do inlining or deadcode elimination ?

Long Fei
Thu, 07 Jul 2005 20:52:42 -0000

I am investigating some inlining issue, so I did

llvm-gcc aaa.c bbb.c ... nnn.c -o output
opt -inline -inline-threshold=xxx < output.bc | llc -march=c >
output_inline.c

1)
I noticed that even if I set xxx to 0 or even a very small negative
number, many functions are eliminated. I am wondering if these functions
are inlined by the frontend, or identified as deadcode.

For instance, SPEC2k bzip2 has 79 functions, after these two steps, only
61 functions are left. no other optimizations are used.

2)
I noticed that the inlining condition (in
Transforms/IPO/InlineSimple.cpp) is tested during llvm-gcc but not
during the opt phase ? Can anybody explain what happens during llvm-gcc
and opt respectively ?


thanks,
--Long