Fix AOT examples smoke LLVM verify regressions (#11206)#11213
Conversation
|
Maintainer review (2026-06-24): Verified bootstrap gates green on |
Update (lane-B continuation)Pushed nested-helper ABI coercion:
Verification./script/docker-exec.sh -- bash -lc './vendor/bin/phpunit test/unit/HttpResponseCodeRuntimeShrinkTest.php'
# OK (5 tests, 17 assertions)
./script/docker-exec.sh -- bash -lc './phpc build -o /tmp/hw /compiler/examples/000-HelloWorld/example.php'
# LLVM verify still fails (down from ~50+ mismatches to 3 classes):
# - parentless @__compiler_get_include_path call
# - ret i64 vs i32 in nested helper bodies
# - try_merge_* terminator mid-block (InfoJitHelper nested compile)
|
#11206). Reposition C main wrapper emissions via standalone_main BB, avoid re-entering HttpResponseRuntime::implement during reset, and add nested helper ABI coercion (JitNestedHelperCoerce, JitVmHelperLink bridges). Smoke still blocked on try_merge terminator + SessionEncode helper ABI; handoff on issue #11206. Co-authored-by: Cursor <cursoragent@cursor.com>
d3505f8 to
0548944
Compare
). Extend JitNestedHelperCoerce for bridge callHelper/scalar coercion, route StringInfo and ReadonlyRaise bridges through it, align merge-block returns, and split try_merge header/body with open insert-block for TYPE_TRY. Smoke still fails LLVM verify (try_merge / nested-helper returns); handoff on #11206. Co-authored-by: Cursor <cursoragent@cursor.com>
Update (lane C continuation)Pushed Changes
Verification./script/docker-exec.sh -- bash -lc './vendor/bin/phpunit test/unit/HttpResponseCodeRuntimeShrinkTest.php'
# OK (5 tests, 17 assertions)
./script/docker-exec.sh -- bash -lc './script/examples-aot-smoke.sh'
# Still fails LLVM verify — try_merge / nested-helper i32/i64 returns / phi-not-in-block in ProgressNoteJitHelper compileNext steps
|
|
Maintainer triage (local verify): not merging — smoke still red per PR verification block. Re-ran mandatory bootstrap gates on
|
Route getdate/localtime/gmgetdate, session encode/create-id, and include-path bridges through JitNestedHelperCoerce; restore LLVM insert blocks after ensureLinked; harden JitVmHelperLink and alignRetval fallbacks for i8/i64 and pointer returns. Co-authored-by: Cursor <cursoragent@cursor.com>
Lane B continuation (
|
Update — LLVM verify + link green (runtime handoff)Pushed commit Verification./script/docker-exec.sh -- bash -lc './script/examples-aot-smoke.sh'
# 000-HelloWorld: phpc build OK (LLVM verify + link pass)
# binary exit 139 — segfault after `c:main_before_init`./script/docker-exec.sh -- bash -lc 'php bin/vm.php examples/000-HelloWorld/example.php'
# Hello WorldNot merging — issue acceptance requires |
Route php-in-PHP JIT bridges through JitNestedHelperCoerce for hashtable/string/scalar mismatches; guard try-branch terminators; define phpc_fn_static_init_table with zeroinit. LLVM verify + link green for examples/000-HelloWorld; runtime still segfaults at c:main_before_init. Co-authored-by: Cursor <cursoragent@cursor.com>
#11206). Try/catch merge lowering pins header/body LLVM blocks; MetaTags and stream-filter bridges coerce nested helper returns; function-static init table gets a zeroinit global; Ini include-path bridges restore insert block after ensureLinked. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
Closes #11206 (partial — parentless standalone-main IR fixed; merge-block blocker remains).
#10854routedhttp_response_codethroughHttpResponseRuntimephp-in-PHP JIT;emitResetForStandaloneMain()re-enteredimplement()during Cmainwrapper emit, clearing the LLVM insert block → parentless globals (__phpc_session_module_storage,__phpc_progress_note, …).Context::compileToFile()repositions builder for every standalone-main emission via dedicatedstandalone_mainBB;HttpResponseRuntime::implement()saves/restores insert block and early-returns when bridges exist;emitResetForStandaloneMain()no longer callsensureLinked().JitNestedHelperCoerce+JitVmHelperLinkbridge arg/return coercion;alignRetvalToLlvmFnReturnfor typed static/pending-return paths;ListUnpackRuntime/StreamSyncJit/SessionEncodeRuntimebridge fixes.Verification
Baseline:
examples-aot-smoke.shgreen at1d13db7ba; red on currentmaster(parentless globals).Remaining (handoff)
try_merge_*BB gets terminator mid-block during InfoJitHelper nested compile (TryCatchHelper::compileIncludedAtEntrymerge path).SessionEncodeJitHelper::encodeWire— bridge passes__hashtable__*, compiled helper expects__object__*; similar__value__*/__string__*mismatches on session create-id helpers.1d13db7bafor the same insert-block / ABI pattern.