Optimizations
VectorC has all the normal optimizations you would expect of a highly optimizing compiler as well as a few unusual ones:
- Common sub-expression elimination.
- Strength reduction.
- Loop unrolling.
- Loop induction variable.
- Automatic prefetching.
- Instruction scheduling.
- Code hoisting.
- Memory read/write elimination.
- Conditional moves.
- Dead code elimination.
- Loop-invariant calculations are moved out of loops.
- Advanced data-flow analysis.
Programs that operate on large amounts of data benefit from memory optimizations like prefetching and uncached stores.
It is often better to not cache the data as it is written, when writing out a large memory block. VectorC allows this form of optimization to be performed easily.
Also, many programs make heavy use of memory when registers can do the job faster. VectorC's advanced optimizer can transform structures and arrays into local variables allocated to registers.
Although today's processors can execute more than one instruction at a time, there are restrictions on when this can be achieved so the compiler needs to understand these rules and be good at re-ordering code. With vectorC, instructions that take a long time to execute are ordered early, and their results are used late.
VectorC's instruction scheduler knows how to order your operations to take advantage of each processor it supports.
|