[php-src] PR #25578: Optimizer: skip leading NOP-free blocks in zend_ssa_remove_nops

From: Date: Thu, 19 Nov 2026 07:50:09 +0000
Subject: [php-src] PR #25578: Optimizer: skip leading NOP-free blocks in zend_ssa_remove_nops
Groups: php.git-pulls 
Request: Send a blank email to git-pulls+get-40799@lists.php.net to get a copy of this message
Pull Request: https://github.com/php/php-src/pull/25578 Author: marc-mabe Nothing moves before the first NOP: the opcodes stay in place and their shift is 0. Skip the leading reachable blocks without a NOP instead of copying them onto themselves one by one. The scan stops at the first block that is unreachable, keeps only a FREE, or does not start where the previous one ended, so the regular loop handles everything that can move. If the scan reaches the end, nothing moves at all (remove_nops is also set by passes that change an opcode without leaving a NOP), so return before allocating and clearing the shift list. The output is unchanged. Measured on arm64 Linux VM (via Mac) | workload | reps | cold master | cold head | cold Δ | cold Δ % | cold Δ per rep | warm master | warm head | warm Δ | warm Δ % | warm Δ per rep | |---|--:|--:|--:|--:|--:|--:|--:|--:|--:|--:|--:| | zend-bench | 3 | 2,452,566,939 | 2,452,565,473 | -1,466 | -0.0001% | -1,381, -1,466, -1,518 | - | - | - | - | - | | symfony-demo | 3 | 857,864,284 | 857,765,845 | -98,439 | -0.0115% | -1,574,087, -98,427, -98,435 | 31,155,486 | 31,155,554 | +68 | +0.0002% | +68, +92, -388 | | wordpress | 3 | 1,340,814,768 | 1,340,610,658 | -204,110 | -0.0152% | -204,110, -204,401, -203,678 | 125,075,130 | 125,074,869 | -261 | -0.0002% | +18, +252, -355 |

« previous php.git-pulls (#40799) next »