From 69129fc29f8104e14d6b130090a585bf6c330e2a Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sun, 13 Sep 2026 23:27:07 +0700 Subject: [PATCH] p2's -O0 build is smaller because nothing unrolled the loop --- spike/x86/COST.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spike/x86/COST.md b/spike/x86/COST.md index 1af2926..1624c34 100644 --- a/spike/x86/COST.md +++ b/spike/x86/COST.md @@ -70,7 +70,7 @@ And the two ends of the distribution, both of which are more interesting than th |---|---|---|---|---|---|---| | `bounds` | 363 | 1,951 | 4,039 | **11.13×** | 2.07× | LLVM at `-O2` proves the indices and deletes the checks | | `array-ctor` | 357 | 1,840 | 3,880 | 10.87× | 2.11× | the same, over a constructor's worth of stores | -| `p2-loop-print` | 283 | 106 | 577 | 2.04× | **5.44×** | a `-O0` build *smaller* than `-O2`: no inlining of the printer | +| `p2-loop-print` | 283 | 106 | 577 | 2.04× | **5.44×** | a `-O0` build *smaller* than `-O2`: LLVM unrolls the five-iteration loop and `-O0` does not | | `pkg-return` | 7,024 | 23,635 | 31,716 | 4.52× | 1.34× | mostly prelude, where `-O0` is already fat | `bounds` is the clearest case in the table of why the `-O0` column had to exist. Eleven times is a shocking @@ -166,7 +166,7 @@ and a useless one about code generation, which is the whole reason the `-O0` col ## `--dev`, which is the one axis both backends pay -`SURVEY_FLAGS=--dev` still reports 97 MATCH, so the comparison is available. The suspected cost was the extra +`SURVEY_FLAGS=--dev` reported 97 MATCH for the lane before this one, so the comparison is available. The suspected cost was the extra load per call site — every cross-function call going through its indirection cell. **It is not measurable.** On `b1-calls`, 20 million calls, x86 release is 104.3ms and x86 `--dev` is 100.9ms: the same number, and the dev build is nominally the *faster* of the two, which is what a difference below the noise floor looks like. The load