mirror of
https://github.com/php/php-src.git
synced 2024-09-23 10:57:26 +00:00
Fix loop identification
When assigning loop headers, we should treat already detected loops as collapsed to their loop header, instead of ignoring them. This fixes the loop header of BB2 in mandel2 if live-range CFG splitting is enabled.
This commit is contained in:
parent
f69c108249
commit
abf16c18c7
@ -855,7 +855,10 @@ int zend_cfg_identify_loops(const zend_op_array *op_array, zend_cfg *cfg, uint32
|
|||||||
}
|
}
|
||||||
while (zend_worklist_len(&work)) {
|
while (zend_worklist_len(&work)) {
|
||||||
j = zend_worklist_pop(&work);
|
j = zend_worklist_pop(&work);
|
||||||
if (blocks[j].loop_header < 0 && j != i) {
|
while (blocks[j].loop_header >= 0) {
|
||||||
|
j = blocks[j].loop_header;
|
||||||
|
}
|
||||||
|
if (j != i) {
|
||||||
blocks[j].loop_header = i;
|
blocks[j].loop_header = i;
|
||||||
for (k = 0; k < blocks[j].predecessors_count; k++) {
|
for (k = 0; k < blocks[j].predecessors_count; k++) {
|
||||||
zend_worklist_push(&work, cfg->predecessors[blocks[j].predecessor_offset + k]);
|
zend_worklist_push(&work, cfg->predecessors[blocks[j].predecessor_offset + k]);
|
||||||
|
Loading…
Reference in New Issue
Block a user