r/cpp • • May 10 '20

Make LLVM fast again

https://nikic.github.io/2020/05/10/Make-LLVM-fast-again.html
150 Upvotes

88 comments sorted by

View all comments

Show parent comments

2

u/pine_ary May 10 '20

That might work on Windows. But keep in mid that LLVM isn't as optimized for Windows as it is for other OSs. Jai is also a specialized language seems to be simple to convert to C. Converting C++ isn't as easy and my suspicion is that C++ -> C -> MSVC would not come out on top of Clang -> LLVM. Additionally you need to consider the optimizations you can apply when converting to IR. Converting to C by itself is not really useful if you don't use the language specific knowledge (for example knowledge of the standard library) to optimize in that step.

2

u/kalmoc May 11 '20

Converting to C by itself is not really useful if you don't use the language specific knowledge (for example knowledge of the standard library) to optimize in that step.

Are c++ compilers doing that? I had the impression that they treat STL code just like any other code.

1

u/Xeverous https://xeverous.github.io May 12 '20

Since a long time all major C++ compilers are compiling C++ directly. Only the fisrt compilers were translating C++ to C (for faster implementaton with then existing C compilers), today it would be a waste of a lot of information.

1

u/kalmoc May 12 '20

And I didn't say any such thing. I was talking about using knowledge about the STL in the compilation process, responding to

(for example knowledge of the standard library)