Install any skill in seconds. Free to start, no credit card required.
Get Started Free →athola/loop-optimization
Decides hand-vs-compiler for loop transforms (unrolling, SIMD, fusion, hoisting).
Passed 22 of 22 test cases with the skill, and 21 of 22 without it.
1 fixed21 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
A test case the skill fixed. Same model, same prompt, with and without the skill.
I profiled our image processing service and found a hot loop that isn't being auto-vectorized by the compiler. Before I jump straight to writing hand-crafted AVX intrinsics, can you provide a step-by-step optimization strategy explaining how to address potential compiler obstacles first, when manual SIMD or loop fusion is actually justified, and what traps could invalidate my micro-benchmark results?
| Checked | Without skill | With skill |
|---|---|---|
| Advises fixing aliasing with restrict qualifiers or adjusting loop shape before writing intrinsics | Passed | Passed |
| Warns against manual loop unrolling because it routinely defeats auto-vectorization | Missed | Passed |
| Warns that synthetic micro-benchmarks fail to capture production data distributions and branch behavior | Passed | Passed |
The instructions your model reads when the skill loads.
A decision rule for the five common loop transformations. Its value is knowing when manual application is redundant (the compiler already does it) or harmful (it defeats the vectorizer or fools your benchmark).
Skill(pensive:architecture-review).Skill(pensive:performance-review).-O2/-O3, so the manual form is redundant. Leave
unrolling to the compiler as well. Unlike the other two it is not on
by default (GCC needs -funroll-loops), but the compiler owns the
profitability decision and manual unrolling routinely defeats the
auto-vectorizer.restrict /
__restrict__) and loop shape first. Confirm with an optimization
report (-fopt-info-vec-missed, -Rpass-missed=loop-vectorize).
Reach for intrinsics last and accept the portability cost.test cases passed, vs 21 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.