Displaying 2 results from an estimated 2 matches for "probably_inlined".
2020 Jan 28
3
Where does LTO remove unused functions?
...s there were some configuration that was not compiled). Is this
reasonable?
I started to play around with some toy examples and got stuck on the very
beginning not being able to figure out where the unused functions are
actually getting removed.
Here is what I did:
tu1.cpp:
int unused(int a);
int probably_inlined(int a);
int main(int argc, const char *argv[]) {
return probably_inlined(argc);
}
tu2.cpp:
int unused(int a) {
return a + 1;
}
int probably_inlined(int a) {
return a + 2;
}
I produced two object files with bitcode:
clang -c -flto tu1.cpp -o tu1.o
And I run LTO and attempted to dump the IR...
2020 Jan 28
2
Where does LTO remove unused functions?
...;>
>> I started to play around with some toy examples and got stuck on the very
>> beginning not being able to figure out where the unused functions are
>> actually getting removed.
>>
>> Here is what I did:
>> tu1.cpp:
>> int unused(int a);
>> int probably_inlined(int a);
>> int main(int argc, const char *argv[]) {
>> return probably_inlined(argc);
>> }
>>
>> tu2.cpp:
>> int unused(int a) {
>> return a + 1;
>> }
>> int probably_inlined(int a) {
>> return a + 2;
>> }
>>
>> I p...