← all workloads

control_flow_ssa

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

Phase composition across releases

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.

control_flow_ssa — full phase breakdown across releases (median ms) control_flow_ssa 1.01× 0.0 161 323 daily → 25.14 25.15 25.16 25.17 25.18 25.19 25.20 25.21 25.22 25.23 25.24 26.1 26.2 26.3 26.4 26.5 26.7 26.8 26.9 26.10 26.11 06-25 06-26 control_flow_ssa — parseTranslationUnit control_flow_ssa — SemanticChecking control_flow_ssa — generateIR control_flow_ssa — frontEndExecute (self) control_flow_ssa — specializeModule control_flow_ssa — simplifyIR control_flow_ssa — linkIR control_flow_ssa — unrollLoopsInModule control_flow_ssa — legalizeResourceTypes control_flow_ssa — legalizeExistentialTypeLayout control_flow_ssa — performMandatoryEarlyInlining control_flow_ssa — performForceInlining control_flow_ssa — linkAndOptimizeIR (self) control_flow_ssa — generateOutput (self) control_flow_ssa — compileInner (self) phase buckets parseTranslationUnit SemanticChecking generateIR frontEndExecute (self) specializeModule simplifyIR linkIR unrollLoopsInModule legalizeResourceTypes legalizeExistentialTypeLayout performMandatoryEarlyInlining performForceInlining linkAndOptimizeIR (self) emitEntryPointsSourceFromIR generateOutput (self) compileInner (self)

Compiled Slang source

exact compiled source (N = 120); long files show the first 40 lines, the area around computeMain (±40), and the last 40 lines (gaps elided)

control_flow_ssa.slang

// 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;
}