AOT: restore module verify for pow, base_convert, property_exists, function-static (#31966) - #32005
Merged
Merged
Conversation
…nction-static (#31966) LLVM verify aborted these four probes after the #31989 strtol rewrite stole call results (parse error in HashTableWriteLlvm). Restore strtol Values, load __string__** before writeString, and keep NestedJIT helper results in the dest box Zend reads. Co-authored-by: Cursor <cursoragent@cursor.com>
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
2 ** 10,base_convert(255,10,2),property_existson a static property, function-static string write) so they compile and match Zend.LibcExtern::ensureStrtolDecl()'s void return to thestrtol()result (HashTableWriteLlvm.phpeven failed to parse), which aborted every AOT compile; restore thestrtol()Value and guard it.__string__**passed towriteString; NestedJITret i64into i1property_exists; pow result box not assigned into thevar_dumpoperand; echo ofstatic $sread$GLOBALSinstead of the function-static module box.php-src:
Zend/zend_operators.c(pow_function),ext/standard/math.c(base_convert),ext/standard/class.c(property_exists). PHP implementation inlib/JIT/,ext/standard/JitPow.php,ext/standard/base_convert_.php,ext/standard/JitPropertyExists.php.Closes #31966
Test plan
./script/phpunit.sh --filter 'StrtolRuntimeShrinkTest|FunctionStaticRuntimeShrinkTest|PowIntRuntimeShrinkTest|MathBaseConvertRuntimeShrinkTest|PropertyExistsRuntimeShrinkTest|pow_operator_int_31966|base_convert_255_31966|property_exists_static_31966|function_static_string_write_31966'→OK (33 tests, 204 assertions)./script/docker-exec.sh -- bash -lc 'php bin/compile.php -o /compiler/build/X test/repro/issue_31966_*.php && /compiler/build/X'Verifier messages recorded (pre-fix):
2 ** 10: parentless__phpc_pow_intcall; thencompute(i64,i64)vs__value__helper ABIbase_convert: basic block in another function (mbc_invalid_radix_*)property_exists:ret i64 0into i1 function__value__writeString(%__value__*, %__string__**)Post-fix AOT run (this branch):
Not run:
./script/ci-fast.sh,make north-star5-verify-fast, compliance suites (red on master; not a pass/fail signal).Made with Cursor