A single entry point with n stacked control-flow blocks — nested if/else, a bounded inner loop with break/continue, and a switch — all mutating a small set of carried locals (a, b, c, d). Re-assigning the same locals across many branches and loop back-edges is what forces SSA construction to insert phi nodes and what the CFG simplifier (constructSSA, inside simplifyIR) must chew through. Isolates the SSA/CFG axis that complexity_ladder only touches as one of several mixed dimensions; nothing else stresses it alone. Scales by breadth = number of control-flow blocks, so basic-block and phi counts grow with n.
bucket: control_flow · compile mode: target · flags: -target spirv -emit-spirv-directly · default N: 120
Full sub-counter decomposition of compileInner — named leaf timers plus (self) residuals (a parent's time not covered by a named child, e.g. the autodiff transform in linkAndOptimizeIR (self)). Topmost band traces compileInner; hover a band for its phase.
exact compiled source (N = 120); long files show the first 40 lines, the area around computeMain (±40), and the last 40 lines (gaps elided)
// AUTO-GENERATED by perf-suite/workloads.py — do not edit by hand.
RWStructuredBuffer<float> outBuf;
StructuredBuffer<float> inBuf;
[shader("compute")]
[numthreads(64,1,1)]
void computeMain(uint3 tid : SV_DispatchThreadID)
{
int idx = int(tid.x);
float a = inBuf[idx], b = inBuf[idx + 1], c = 0.0, d = 1.0;
if ((idx + 0) % 2 == 0)
{
a = a * 1.1 + b;
[MaxIters(4)] for (int k = 0; k < 1; ++k)
{
c += a - b * 0.5;
if (c > 0.0) { b = c; break; }
else { d = d * 0.99 + a; continue; }
}
}
else
{
switch ((idx + 0) % 4)
{
case 0: a -= d; break;
case 1: b += c; break;
case 2: c *= 1.01; break;
default: d -= a * 0.1;
}
}
if ((idx + 1) % 3 == 0)
{
a = a * 1.1 + b;
[MaxIters(4)] for (int k = 0; k < 2; ++k)
{
c += a - b * 0.5;
if (c > 1.0) { b = c; break; }
else { d = d * 0.99 + a; continue; }
}
}
else
{
switch ((idx + 1) % 4)
{
case 0: a -= d; break;
case 1: b += c; break;
case 2: c *= 1.01; break;
// … 2325 lines omitted …
a = a * 1.1 + b;
[MaxIters(4)] for (int k = 0; k < 3; ++k)
{
c += a - b * 0.5;
if (c > 1.0) { b = c; break; }
else { d = d * 0.99 + a; continue; }
}
}
else
{
switch ((idx + 118) % 4)
{
case 0: a -= d; break;
case 1: b += c; break;
case 2: c *= 1.01; break;
default: d -= a * 0.1;
}
}
if ((idx + 119) % 6 == 0)
{
a = a * 1.1 + b;
[MaxIters(4)] for (int k = 0; k < 4; ++k)
{
c += a - b * 0.5;
if (c > 2.0) { b = c; break; }
else { d = d * 0.99 + a; continue; }
}
}
else
{
switch ((idx + 119) % 4)
{
case 0: a -= d; break;
case 1: b += c; break;
case 2: c *= 1.01; break;
default: d -= a * 0.1;
}
}
outBuf[idx] = a + b + c + d;
}