From: frief Date: Fri, 5 Mar 2004 11:42:32 +0000 (+0000) Subject: added 251.b and 253.x. 253.x are applied more than 500 times in the regression tests X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=fb2c3010b4f1f520543329141f6b553f56ce8e2f;p=fw%2Fsdcc added 251.b and 253.x. 253.x are applied more than 500 times in the regression tests git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3246 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/mcs51/peeph.def b/src/mcs51/peeph.def index 083d8fe5..a4117ac1 100644 --- a/src/mcs51/peeph.def +++ b/src/mcs51/peeph.def @@ -157,7 +157,7 @@ replace { clr c mov a,%1 } by { - ; Peephole 106 removed redundant mov + ; Peephole 106 removed redundant mov mov %1,a clr c } if notVolatile %1 @@ -3147,7 +3147,15 @@ replace { replace { ljmp %5 } by { - ; Peephole 251 replaced ljmp to ret with ret + ; Peephole 251.a replaced ljmp to ret with ret + ret +} if labelIsReturnOnly + +// not before peephole 250.b +replace { + sjmp %5 +} by { + ; Peephole 251.b replaced sjmp to ret with ret ret } if labelIsReturnOnly @@ -3170,3 +3178,34 @@ replace { rlc a mov r%3,a } + +// applies to: void test( char c ) { if( c ) func1(); else func2(); } +replace { + lcall %1 + ret +} by { + ; Peephole 253.a replaced lcall/ret with ljmp + ljmp %1 +} + +// applies to: void test( char c ) { if( c ) func1(); else func2(); } +replace { + lcall %1 +%2: + ret +} by { + ; Peephole 253.b replaced lcall/ret with ljmp + ljmp %1 +} if labelRefCount %2 0 + +// applies to f.e. scott-bool1.c +replace { + lcall %1 +%2: + ret +} by { + ; Peephole 253.c replaced lcall with ljmp + ljmp %1 +%2: + ret +}