From 27afc13b1211ec1f5f3304850075329e708d7052 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Fri, 28 Jul 2017 11:58:21 +0200 Subject: Optimise: remove needless moves between stacks --- Sil/Compile.icl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sil/Compile.icl b/Sil/Compile.icl index de3f47f..9404b1c 100644 --- a/Sil/Compile.icl +++ b/Sil/Compile.icl @@ -53,6 +53,9 @@ where // Remove unreachable code opt ['ABC'.Rtn:ss] = ['ABC'.Rtn:opt $ skipUntilEntryPoint ss] opt ['ABC'.Jmp l:ss] = ['ABC'.Jmp l:opt $ skipUntilEntryPoint ss] + // Remove needless moves between A and B stacks + opt ['ABC'.PushI_a 0:'ABC'.Pop_a 1:'ABC'.Create:'ABC'.FillI_b 0 0:'ABC'.Pop_b 1:ss] = opt ss + opt ['ABC'.PushB_a 0:'ABC'.Pop_a 1:'ABC'.Create:'ABC'.FillB_b 0 0:'ABC'.Pop_b 1:ss] = opt ss // Base cases opt [s:ss] = [s:opt ss] opt [] = [] -- cgit v1.2.3