Questions tagged [link-time-optimization]
25 questions
1
vote
0 answers
Proper way of using link time opimization with source and assembly files?
I'm currently playing around with LTO for an embedded system (to see if it could reduce the size) and was having some issues getting everything to link properly using ld directly and was wondering what I was doing wrong. This is mostly playing with…

Adam A.
- 502
- 1
- 4
- 12
1
vote
1 answer
Does monolithic link-time optimization work with static libraries?
This article discusses how object files can contain LLVM IR that is used for link-time optimization. But what if the linker is compiling a project that includes a static library, do static libraries have the information as well? If so, under which…

meisel
- 2,151
- 2
- 21
- 38
1
vote
1 answer
Link-time optimization (lto) for mixed C++/C programs
I wonder if it would be possible to effectively use link-time optimization (lto) for programms consisting of a TU with C++ code calling some function in a TU with C code. So, is there a way to get the C function inlined into the resulting…

wimalopaan
- 4,838
- 1
- 21
- 39
1
vote
1 answer
always inline functions in different .so
In Linux, using gcc if I declare a function in a dynamic library as __attribute__((always_inline)) and then I dynamically load that library, will the function be inlined by the dynamic linker?
I am compiling dynamic libraries, in -O3 and not passing…

dau_sama
- 4,247
- 2
- 23
- 30
1
vote
0 answers
Link-time optimization: What is "type merging"
On this page GCC 5 lists the following under Link-time optimization improvements:
One Definition Rule based merging of C++ types has been implemented. Type merging enables better devirtualization and alias analysis.
What is C++ type merging and…

ThomasMcLeod
- 7,603
- 4
- 42
- 80
0
votes
1 answer
Python time optimization for finding distinct sets of elements
I've got a python HW that looks like this:
find the number of clothes sets that each clothing has a different color.
The input = n (number of costumes)
For the next n line the input will be number of clothe (hat = 1, t_shirt = 2, pants = 3) and the…

Mansour_hz
- 3
- 4
0
votes
0 answers
What are use cases for GCC's `-fuse-linker-plugin`?
I am trying to better understand link-time optimization in GCC and -fuse-linker-plugin seems to matter in that context. However, I do not exactly understand how.
Suppose my compilation with link-time optimization looks like this:
gcc a.c -c -o a.o…

shuhalo
- 5,732
- 12
- 43
- 60
0
votes
0 answers
Can gfortran perform link time optimization that would result in inlining a pure function from different translation unit?
We have a Fortran code base, that consists of large (over 5K lines) module files. The files grew so much, because of the fear, that the compiler would not be able to consider inlining cross-module function calls.
Is it still a concern with gcc >=…

Adam Ryczkowski
- 7,592
- 13
- 42
- 68
0
votes
1 answer
Can nvlink inline device functions from separate compilation units?
If the separate compilation units that are fed as input to nvlink contain cuda kernels and device functions that invoke device functions marked as __forceinline__, will these functions be inlined? Assume they would be inlined if one put all the…

user1823664
- 1,071
- 9
- 16
-1
votes
2 answers
Are two std::string_views refering to equal-comparing string literal always also equal?
I have an unordered_map which is supposed to mimic a filter, taking key and value as std::string_view respectively. Now say I want to compare two filters that have the same key-value-pairs: Will they always compare equal?
My thought is the…

glades
- 3,778
- 1
- 12
- 34