intermediate · simd

When Does SIMD Actually Help?

When does SIMD help, and what stops a loop from being vectorized?

Practical scenario

A numerical loop is expected to be four times faster after a rewrite and is not. Someone suggests the CPU "must not support SIMD", but the report shows the loop was never vectorized.

What it tests

  • Understanding of the independence requirement
  • Knowledge of what blocks the compiler in practice
  • Whether the candidate verifies vectorization rather than assuming it

Lessons behind this question