ack/util/ego
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
..
bo More void, fewer clang warnings in util/ego 2019-11-01 15:27:16 -04:00
ca More void, fewer clang warnings in util/ego 2019-11-01 15:27:16 -04:00
cf More void, fewer clang warnings in util/ego 2019-11-01 15:27:16 -04:00
cj More void, fewer clang warnings in util/ego 2019-11-01 15:27:16 -04:00
cs More void, fewer clang warnings in util/ego 2019-11-01 15:27:16 -04:00
descr Optimize procedures that do both a / b and a % b. 2018-03-05 13:32:06 -05:00
em_ego Cut down some clang warnings 2019-10-30 18:36:38 -04:00
ic More void, fewer clang warnings in util/ego 2019-11-01 15:27:16 -04:00
il More void, fewer clang warnings in util/ego 2019-11-01 15:27:16 -04:00
lv More void, fewer clang warnings in util/ego 2019-11-01 15:27:16 -04:00
ra More void, fewer clang warnings in util/ego 2019-11-01 15:27:16 -04:00
share Add -DDEBUG to enable assertions in util/ego 2019-11-14 17:17:24 -05:00
sp Rename all files called 'aux.*' to something else; Windows can't handle them. 2019-02-09 00:02:41 +01:00
sr Fix END pseudo in util/ego/sr; closes #203 2019-11-15 11:50:05 -05:00
ud More void, fewer clang warnings in util/ego 2019-11-01 15:27:16 -04:00
Action Initial revision 1987-01-13 11:31:24 +00:00
build.lua Add -DDEBUG to enable assertions in util/ego 2019-11-14 17:17:24 -05:00