Self-host M5: fix M3 emit sidecar LLVM verify for cli_driver/bin/compile (#3023)#3177
Merged
Conversation
Correct parse-and-compile tail phi predecessors and emit diagnostic Runtime spine stubs so bin/compile.php inventory sidecars link cleanly; try/catch dispatch cross-function isolation remains covered by #3012. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep #3023 tail phi fix (compileBb via afterRecord, not direct). Co-authored-by: Cursor <cursoragent@cursor.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BootstrapCompileSmokeM3Emit::emitRuntimeParseAndCompileDefault()— the tail merge block is reached viaafterRecordBb, notcompileBb, which caused LLVM module verify failures duringbin/compile.phpsidecar host-compile.peekLastParseFailure,noteParseCompileNullForScript) so inventory argv sidecars link without undefined symbols.Try/catch cross-function dispatch BB isolation was already fixed in #3012 (
TryCatchState::reset()per queued CFG function +TryCatchHelper::dispatchBbFor()parent check);TryCatchJitCompileTest::testTryCatchModulesVerifycovers the repro.php-src reference
N/A (bootstrap LLVM emit / self-host path).
Test plan
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter TryCatchJitCompileTest'./script/docker-exec.sh -- bash -lc 'make bootstrap-selfhost-driver-smoke'— stages 0–5 green, no sidecar exit 255php bin/compile.php -o build/bin-compile-aot bin/compile.phpwithBOOTSTRAP_M3_USE_INVENTORY_EMIT_DRIVER=1Closes #3023
Made with Cursor