blaise/stdlib
Graeme Geldenhuys 17c14b37aa perf(qbe): borrowed-local const-string args + lookup/format tail wins
With the default-argument statement bug fixed, the borrowed-local
elision blocked in 91f44ec is sound and enabled: a const-string argument
that is a plain local or by-value/const parameter variable emits no
caller pin at all — the frame's own reference outlives the call.
Exclusions guard the aliasing edges: address-taken locals (explicit @,
passed to var/out params), locals captured by nested procedures (both
via a per-function blocklist rebuilt in EmitVarAllocs), and calls whose
signature has a var/out string param (F(L, L) lets the callee release
L's buffer through the alias).  Nine IR contract tests cover every
shape, including the new exclusion guards.

Tail wins on the remaining profile:
- QBEMangle: fast path returns the input unchanged when it contains no
  mangled characters (1.3M calls were rebuilding clean names one concat
  per character).
- TStringList.FindSorted: compares the probe slot in place through the
  CompareStr/CompareText builtins instead of copying it into a local
  and dispatching through Compare — several ARC ops per binary-search
  step on the hottest lookup path.
- _StringFormatN: the sizing pass uses a pure DecimalWidth count
  instead of rendering every %d argument twice.

Compiler self-compile: 0.78 s -> 0.60 s wall, 8.60G -> 6.45G
instructions.  Verified through two self-hosted generations, gen-2
native emission, both fixpoints and the full suite (2870 tests).
2026-06-10 23:53:01 +01:00
..
src/main/pascal perf(qbe): borrowed-local const-string args + lookup/format tail wins 2026-06-10 23:53:01 +01:00
project.xml refactor: split rtl/ into runtime/ + stdlib/, rename bcl.testing to blaise.testing 2026-05-16 00:51:18 +01:00