https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123518
Bug ID: 123518
Summary: gimple_make_forwarder_block should not create
degenerated phis
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P3
Component: tree-optimization
Assignee: pinskia at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
So currently gimple_make_forwarder_block will create degenerated phis nodes in
some cases.
make_forwarder_block happens for a few different reasons.
One is creating a loop pre-header or creating a single latch of the loop
header.
E.g we go from:
# BS_INC_1_45 = PHI <_87(18), 0(4), _87(12)>
# .MEM_46 = PHI <.MEM_36(18), .MEM_30(4), .MEM_27(12)>
to
# BS_INC_1_86 = PHI <_87(22), _87(12)>
This is unlike PR 123417 which is just about loop latches.