ack/util/ego/sr
George Koehler e841adf970 Fix END pseudo in util/ego/sr; closes #203
The strength reduction (SR) phase mishandled the END pseudo when SR
found at least 2 different expressions in the same loop, and SR made a
new header for the loop.

Since 1987 (commit 159b84e), SR appended the new header to the end of
the procedure.  Later, SR fixed the header by adding a BRA branch to
the loop's entry, and moving the END pseudo from the previous basic
block to the header.  If SR found multiple expressions, it called
fix_header() multiple times, and tried to move the END again.  The
extra move failed assert(INSTR(e) == ps_end), or moved another line
after the END, so opt2 (the peephole optimizer) would crash.

Fix by removing fix_header() and moving the code to make_header(), so
SR adds the BRA and moves the END when it makes the header, and does
so only once for each header.

Adjust init_code(), which inserts code into a header.  Stop checking
for an empty header, because make_header() now adds BRA.  After
inserting code before BRA, don't move LP_INSTR, because later
insertions should go before BRA, not after END.
2019-11-15 11:50:05 -05:00
..
sr.c More void, fewer clang warnings in util/ego 2019-11-01 15:27:16 -04:00
sr.h First milestone of replacing the build system. 2013-05-12 20:45:55 +01:00
sr_aux.c More void, fewer clang warnings in util/ego 2019-11-01 15:27:16 -04:00
sr_aux.h More void, fewer clang warnings in util/ego 2019-11-01 15:27:16 -04:00
sr_cand.c More void, fewer clang warnings in util/ego 2019-11-01 15:27:16 -04:00
sr_cand.h More void, fewer clang warnings in util/ego 2019-11-01 15:27:16 -04:00
sr_expr.c More void, fewer clang warnings in util/ego 2019-11-01 15:27:16 -04:00
sr_expr.h More void, fewer clang warnings in util/ego 2019-11-01 15:27:16 -04:00
sr_iv.c More void, fewer clang warnings in util/ego 2019-11-01 15:27:16 -04:00
sr_iv.h More void, fewer clang warnings in util/ego 2019-11-01 15:27:16 -04:00
sr_reduce.c Fix END pseudo in util/ego/sr; closes #203 2019-11-15 11:50:05 -05:00
sr_reduce.h More void, fewer clang warnings in util/ego 2019-11-01 15:27:16 -04:00
sr_xform.c Fix END pseudo in util/ego/sr; closes #203 2019-11-15 11:50:05 -05:00
sr_xform.h More void, fewer clang warnings in util/ego 2019-11-01 15:27:16 -04:00