Ask HN: Do any of these GCC/LLVM features exist?
This is a list of 3 things I would love to see in an optimizing C/C++ compiler. I know how to do none of them, but maybe somebody knows an alternative work-around....
1. Useful pragmas for defining optimization regions. 95% of my code can be relatively portable and acceptably performant with -mtune=generic.
Pragmas would simply classify optimization regions which cross compile multiple targets. Then drops in the correct one at runtime.
(I know this is possible to do, but wouldn't a builtin be better?)
2. Pragmas for linker hints. I have noticed -flto just doesn't do great on larger more complicated projects (perhaps it's the partial templates?). But, usually I have a good idea which ones need to go together.
Like (for a function used in two different tight loops):
```
[[:linker_group="LinearOptimizer"]]
[[:linker_group="Descent"]]
void
Function(...) {}
```
3. And this one is a long long shot. Wouldn't it be cool if every major hardware vendor could support some consistent RISC instructions? So that the compiler could have a universal initializer language capable of extracting the relevant target program. Not sure how it works around ELF/DWARF/...
0 comments
[ 2.6 ms ] story [ 7.1 ms ] threadNo comments yet.