You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Perry 0.5.78 emits a dangling LLVM metadata reference in the IR for some modules, causing clang to fail:
error: use of undefined metadata '!201'
store i8 %r35, ptr %r34, !alias.scope !201, !noalias !301
The metadata !201 is referenced in the IR but never defined. Happens specifically in src/types/codecs/scalars.ts (the @perry/postgres codec file) but likely affects any module where the new alias-scope metadata from the escape-analysis / scalar-replacement passes (#66, v0.5.76) is emitted without a matching definition.
Repro
perry compile bench/bench-this.ts -o /tmp/bench-this
Error compiling module 'src/types/codecs/scalars.ts':
.ll:2789:42: error: use of undefined metadata '!201'
store i8 %r35, ptr %r34, !alias.scope !201, !noalias !301
The failing IR is left at the temp path shown in the error. All other modules in the project compile fine — only scalars.ts triggers it.
Likely cause
The !alias.scope / !noalias metadata was added by the escape-analysis scalar-replacement pass (v0.5.73 / v0.5.76). The metadata numbering is probably emitted assuming a contiguous !0 through !N sequence, but some intermediate pass (dead-code elimination? function inlining?) drops a metadata definition while leaving a reference.
The IR file at the temp path has the full context if needed.
Impact
Blocks compilation of @perry/postgres (and any project whose codegen hits the same path) on 0.5.78. Single-file programs that don't trigger the scalar-replacement pass compile fine.
Environment
Perry 0.5.78
macOS 26 / Apple Silicon
Repro: perry compile bench/bench-this.ts in @perry/postgres repo
Activity
fix: module-wide buffer alias-scope counter (v0.5.80, closes #71)