Perf: lazy-box native-long unary minus INT_MIN (#36386) - #37060
Merged
Conversation
Hot-path typed int negate stays TYPE_NATIVE_LONG; PHP_INT_MIN stores f64 only and reuses materializeOverflowableNativeLong (peer of ±/×/`/` lazy overflow). php-src: Zend/zend_operators.c zendi_negate_function. Co-authored-by: Cursor <cursoragent@cursor.com>
3 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
-hot path staysTYPE_NATIVE_LONG(noentryAllocaValueBox/__value__writeLong);PHP_INT_MINstores f64 only and reusesmaterializeOverflowableNativeLong— peer of ±/×//lazy overflow (Perf: lazy f64 overflow slot for native-long ±/× (#36386) #37051 / Perf: lazy native-long/hot path (no value-box) (#36386) #37054).: intreturn of-PHP_INT_MINTypeErrors via existing promote-flag check inScalarReturnCheck.php-src:
Zend/zend_operators.czendi_negate_function.Part of #36386.
Test plan
./script/phpunit.sh --filter NativeLongUnaryMinusHeapLazyAotTest→ 3/3./script/aot-smoke.sh→ 9/9 + size gate OKmake north-star5-verify-fast→ OK (spine 8346/8346)script/differential-sweep.sh --aot --repeat 3one25_unary+ arith peers → 5/5 (e27 10/10)Made with Cursor