Commit Graph

1 Commits

Author SHA1 Message Date
Roland Paterson-Jones
95541ccfb0 Simple Inner Loop Optimzation
Two simple loop optimizations.

1. Strength reduction of mul[tiplication] by loop induction
variable.

2. Hoisting of (address) base into phi where loop induction
variable is used only as a base (address) offset.

Limited to loops with a single body block, which happily
is always innermost loops. This restriction would not be
very hard to lift - it would require detecting the set of
loop blocks (and ensuring reducibility?)

Limited to loop induction variables with 0 initial value
and increment of 1 (for mul strength reduction). This
limitation is trivial to lift; however all of the
cproc/hare[c]/coremark opportunity is with 0/1 loops for
mul reduction, and 0 initial value for base-offset opt.
2025-03-21 16:02:12 +01:00