diff options
author | Vladimir Azarov <avm@intermediate-node.net> | 2025-08-07 01:14:26 +0200 |
---|---|---|
committer | Vladimir Azarov <avm@intermediate-node.net> | 2025-08-07 01:14:26 +0200 |
commit | 0c40c8d8844bbb71999c7b5bd0bee24d24a972e0 (patch) | |
tree | ac1d65e602f7f8ebc244303bc1200d4afe0ea0f0 /common.sml | |
parent | 3a3220a049b9fef67ca0f85542654ab0a9de0914 (diff) |
Constant propagation
Diffstat (limited to 'common.sml')
-rw-r--r-- | common.sml | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -26,6 +26,7 @@ structure FRU = struct fun f7 z = next f6 z fun f8 z = next f7 z fun f9 z = next f8 z + fun f10 z = next f9 z fun c0 from = from fun c1 from = c0 from f1 @@ -37,6 +38,7 @@ structure FRU = struct fun c7 from = c6 from f7 fun c8 from = c7 from f8 fun c9 from = c8 from f9 + fun c10 from = c9 from f10 fun makeUpdate cX (from, from', to) record = let @@ -55,6 +57,7 @@ structure FRU = struct fun makeUpdate7 z = makeUpdate c7 z fun makeUpdate8 z = makeUpdate c8 z fun makeUpdate9 z = makeUpdate c9 z + fun makeUpdate10 z = makeUpdate c10 z fun upd z = Fold.step2 (fn (s, f, (vars, ops)) => @@ -147,6 +150,8 @@ fun bindWith2str to = bind A1 (fn v => fn (output, _) => output $ to v) fun F z = bind A0 (fn (_, mf) => mf ()) z val I = fn z => bindWith2str Int.toString z +fun i v out = Printf out I v % + val C = fn z => bindWith2str str z val B = fn z => bindWith2str Bool.toString z val W = fn z => bindWith2str (Word.fmt StringCvt.DEC) z |