Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

c

Name: Anonymous 2015-02-07 6:44

The C language converts to ASM in a very straight forward way. It is ridiculous
to optimize subexprressions and similar stupid things when a competent C
programmer can do it by hand.

Don't make the compiler a clusterfuck because of retard-programmers.

Name: Anonymous 2016-10-24 19:45

>>13

It doesn't need to indeed. But especially for CISC instruction sets, the performance will be complete garbage. With a simple RISC, you can get away with it.

Anyway, any modern compiler should use the LLVM framework as backend. So this is a non problem these days. It can vectorize loops for you, recognize if you are doing a bitscan or whatever. But the problem here is that they use a pattern matching approach. They match an expression to a pattern and then apply a transform if applicable. Patterns are powerful, but it is not possible to always recognize translatable units.

Therefore most compilers have many optimizing steps and repeat certain steps multiple times to make the expressions as simple as possible.

The obvious solution here for the programmer would be: Write simple code, don't micro optimize yourself or you fuck up the pattern matching. If you want to optimize, optimize algorithms instead.

Examine lib/Transforms/Scalar/LoopIdiomRecognize.cpp. It does exactly that: Classify loops to their applications.

It indeed doesn't make sense to not include a bitscan into the language, because if a processor does not have a single instruction for bitscan the compiler can translate it to a efficient implementation for you.

Also if you write your own language, LLVM is your friend. The framework is really easy to extend with new Transforms.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List