aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorRoland Paterson-Jones <[email protected]>2024-12-07 10:22:30 +0200
committerQuentin Carbonneaux <[email protected]>2025-03-21 16:02:12 +0100
commit95541ccfb0a63a1737e9d6e5c4ed9dae4530b9e8 (patch)
tree6c28211b4ba244104f3fec89463f0f21e78aa8e4 /main.c
parent348f2eac90ffc0f3f8fa35e8a211ef8048589cb8 (diff)
Simple Inner Loop Optimzationloopopt
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.
Diffstat (limited to 'main.c')
-rw-r--r--main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/main.c b/main.c
index 7a97f8a..ae73ba1 100644
--- a/main.c
+++ b/main.c
@@ -81,6 +81,8 @@ func(Fn *fn)
gcm(fn);
filluse(fn);
ssacheck(fn);
+ loopopt(fn);
+ filluse(fn);
T.abi1(fn);
simpl(fn);
fillcfg(fn);