All posts

compilers

5 posts
COMPILERS

How a Compiler Turns Your Loop Into SIMD

Modern CPUs can add eight numbers in one instruction, and your compiler will rewrite plain loops to use them — but only if you don't accidentally forbid it. Here's what auto-vectorization needs to fire.

COMPILERS

What -O2 Actually Does: A Tour of Compiler Optimizations

The gap between -O0 and -O2 is often 10x, and it's not magic — it's a pipeline of individually simple transformations over an intermediate representation. SSA, inlining, the passes that matter, and why your careful micro-optimization was already done for you.

SYSTEMS

What the Linker Actually Does

Half of all confusing C build errors — undefined reference, multiple definition, static initialization order — are linker concepts wearing compiler costumes. Symbols, relocations, and the archive rule that surprises everyone.

SYSTEMS

Undefined Behavior: The Compiler Is Not Your Friend Here

UB doesn't mean 'returns garbage' — it means the optimizer may assume it never happens and reason backwards from that. How signed overflow checks get deleted, why time-travel is real, and the sanitizer workflow that catches it.