Retired probe: IR_PARAMHOME
Removed from the 80cc back end on branch 80cc-simplify, 2026-09-13.
A census whose question is answered or superseded. Kept so it can be re-run
without re-deriving it.

--- ir_lower.c lines 4599..4667 ---
        /* [IR_PARAMHOME, INERT] Sizing probe for the param register-home lever. */
        if (getenv("IR_PARAMHOME")) {
            int verbose = getenv("IR_PARAMHOME")[0] == '2';
            /* Bytes per counted read event. The two modes count DIFFERENT
               things, so the cost has to follow suit or fp reads score double:
                 sp — one event is a whole operand. `ld hl,N / add hl,sp` (4B)
                      forms the address once, then the load: +4B for a word
                      (ld a,(hl) / inc hl / ld h,(hl) / ld l,a), +1B for a byte.
                 fp — one event is a single (ix+d) byte access, 3B, no setup;
                      a word operand therefore counts twice and costs 3B twice.
               Cross-check on ItemCheck: 10 sp events and 20 fp events describe
               the same ten word loads, and 10*8 vs 20*3 put the two modes in
               the same range instead of an artificial 2x apart. */
            int fp = fp_active(f) && !L.cur_frameless;
            int cost_w = fp ? 3 : 8;      /* per read event, width-2 operand */
            int cost_b = fp ? 3 : 5;      /* per read event, width-1 operand */
            int fn_cands = 0, fn_reads = 0, fn_save = 0;
            for (int v = 0; v < rec_nv && v < f->n_vregs; v++) {
                const VReg *vr = &f->vregs[v];
                if (!(vr->flags & IR_VREG_PARAM)) continue;
                if (f->vreg_to_phys && f->vreg_to_phys[v] != IR_PR_SPILL) continue;
                if (vr->flags & (IR_VREG_ADDR_TAKEN | IR_VREG_VOLATILE)) continue;
                int reads  = rec_slotuse[v] - (rec_slotwrite ? rec_slotwrite[v] : 0);
                int writes = rec_slotwrite ? rec_slotwrite[v] : 0;
                if (reads < 2) continue;
                /* Walk the function once: linear op index, first/last reference
                   to v, calls between them, and any use as a deref base. */
                int idx = 0, first = -1, last = -1, deref = 0;
                int ncall_before_first = 0, ncall_before_last = 0, ncall = 0;
                for (int b = 0; b < f->n_bbs; b++)
                    for (int j = 0; j < f->bbs[b].n_ops; j++, idx++) {
                        const Op *o = &f->bbs[b].ops[j];
                        if (o->kind == IR_CALL || o->kind == IR_HCALL) ncall++;
                        int u[16];
                        int nu = ir_op_uses(o, u, 16);
                        int refs = (o->dst == v);
                        for (int k = 0; k < nu && !refs; k++) refs = (u[k] == v);
                        if (!refs) continue;
                        if ((o->kind == IR_LD_MEM || o->kind == IR_ST_MEM)
                            && o->mem.kind == IR_MEM_VREG && o->mem.base == v)
                            deref = 1;
                        if (first < 0) { first = idx; ncall_before_first = ncall; }
                        last = idx; ncall_before_last = ncall;
                    }
                int calls = (first < 0) ? 0
                          : ncall_before_last - ncall_before_first;
                int save = 0;
                if (vr->width >= 1 && vr->width <= 2) {
                    int rc = (vr->width == 1) ? cost_b : cost_w;
                    save = (reads - 1) * rc - 2 * calls;
                    if (save < 0) save = 0;
                }
                fn_cands++; fn_reads += reads; fn_save += save;
                /* span = ops between first and last reference: a long span is
                   more likely to lose the register to pressure, so it tempers
                   `save` without changing it. */
                fprintf(stderr,
                        "PARAMHOME %s v%d w=%d reads=%d writes=%d calls=%d "
                        "span=%d deref=%d save=%d\n",
                        f->fn ? ir_sym_name(f->fn) : "?", v, vr->width,
                        reads, writes, calls, (first < 0) ? 0 : last - first,
                        deref, save);
            }
            if (fn_cands || verbose)
                fprintf(stderr, "PARAMHOME-FN %s mode=%s cands=%d reads=%d "
                        "save=%d\n",
                        f->fn ? ir_sym_name(f->fn) : "?", fp ? "fp" : "sp",
                        fn_cands, fn_reads, fn_save);
        }
