Refuse to split phi-like vregs (defined in multiple blocks); remove env gates
Linearscan's live intervals are linear-position [start, end] ranges,
which can't represent the true CFG-aware live set for vregs that
receive values via parallel-copy at every predecessor (block params,
post-phi placeholders). When a call block is lexically wedged
between a phi-vreg's def edge and its use block, the position-based
range straddles the call point but no actual control-flow path
through the vreg traverses it. The splitter then thought the vreg
crossed a call, picked a pre/post split, and assigned the post-half
a different physreg — every predecessor's parallel-copy landed in
pre_phys but every use inside the loop read post_phys.
Track each vreg's set of defining blocks while building
vreg_actual_range; if it has more than one, force real_crosses
false (no splitting). The unit test exercising splitting still
fires because its synthetic vregs have single defs.
Removes:
- ARMFORTAS_SPLIT_INTERVALS env gate (no longer needed)
- detect_partial_unroll_loop's acc_param + store guard (the
underlying regalloc bug it worked around is now fixed)
Verified at all opt levels:
- realworld_seed_overwrite.f90: 4 19 23 (was infinite loop at -O2+)
- realworld_affine_shift.f90: 14 16 (was 14 7 at -O2+)
which can't represent the true CFG-aware live set for vregs that
receive values via parallel-copy at every predecessor (block params,
post-phi placeholders). When a call block is lexically wedged
between a phi-vreg's def edge and its use block, the position-based
range straddles the call point but no actual control-flow path
through the vreg traverses it. The splitter then thought the vreg
crossed a call, picked a pre/post split, and assigned the post-half
a different physreg — every predecessor's parallel-copy landed in
pre_phys but every use inside the loop read post_phys.
Track each vreg's set of defining blocks while building
vreg_actual_range; if it has more than one, force real_crosses
false (no splitting). The unit test exercising splitting still
fires because its synthetic vregs have single defs.
Removes:
- ARMFORTAS_SPLIT_INTERVALS env gate (no longer needed)
- detect_partial_unroll_loop's acc_param + store guard (the
underlying regalloc bug it worked around is now fixed)
Verified at all opt levels:
- realworld_seed_overwrite.f90: 4 19 23 (was infinite loop at -O2+)
- realworld_affine_shift.f90: 14 16 (was 14 7 at -O2+)
Authored by
mfwolffe <wolffemf@dukes.jmu.edu>
- SHA
77677e8ce07ba75e97685183c6e2473cc3e7ca9a- Parents
-
f2e4e02 - Tree
520cf8f