Top "Compiler-optimization" questions

Compiler optimization involves adapting a compiler to reduce run-time or object size or both.

Clang optimization levels

On gcc, the manual explains what -O3, -Os, etc. translate to in terms of specific optimisation arguments (-funswitch-loops, -fcompare-elim, etc.) …

clang compiler-optimization user-manual
Optimize in CMake by default

I have a C++ project which uses CMake as its build system. I'd like the following behavior: If cmake is …

c++ cmake compiler-optimization
Double question marks ('??') vs if when assigning same var

Referring to the following SE answer. When writing A = A ?? B; it is the same as if( null != A ) A = …

c# compiler-optimization null-coalescing-operator
G++ optimization beyond -O3/-Ofast

The Problem We have a mid-sized program for a simulation task, that we need to optimize. We have already done …

c++ g++ compiler-optimization
Why does the Rust compiler not optimize code assuming that two mutable references cannot alias?

As far as I know, reference/pointer aliasing can hinder the compiler's ability to generate optimized code, since they must …

rust compiler-optimization llvm-codegen
Why does GCC generate such radically different assembly for nearly the same C code?

While writing an optimized ftol function I found some very odd behaviour in GCC 4.6.1. Let me show you the code …

c gcc assembly x86 compiler-optimization
Benefits of 'Optimize code' option in Visual Studio build

Much of our C# release code is built with the 'Optimize code' option turned off. I believe this is to …

c# visual-studio compiler-construction build compiler-optimization
How to vectorize with gcc?

The v4 series of the gcc compiler can automatically vectorize loops using the SIMD processor on some modern CPUs, such …

gcc compiler-optimization simd auto-vectorization vector-processing
How to check if given number is divisible of 15 in fastest way?

Division in processor takes much time, so I want to ask how to check in fastest way if number is …

c++ c performance compiler-optimization integer-division
GCC SSE code optimization

This post is closely related to another one I posted some days ago. This time, I wrote a simple code …

c optimization sse compiler-optimization hpc