all optimizer functions can rely on it.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5733
b7a2c559-68d2-44c3-8de9-
860c34a00d81
12 files changed:
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
unsigned I;
- /* Generate register info */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free the register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
unsigned I;
- /* Generate register info */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free the register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
unsigned I;
- /* Generate register info */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free the register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
unsigned I;
- /* Generate register info */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free the register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
unsigned I;
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
- /* Generate register info */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free the register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
unsigned I;
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
- /* Generate register info */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free the register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
unsigned I;
- /* Generate register info for the following step */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
unsigned I;
- /* Generate register info for the following step */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
fprintf (F,
"%-20s %10lu %10lu %10lu %10lu\n",
O->Name,
fprintf (F,
"%-20s %10lu %10lu %10lu %10lu\n",
O->Name,
- O->TotalChanges,
- O->LastChanges);
+ O->TotalChanges,
+ O->LastChanges);
}
/* Close the file, ignore errors here. */
}
/* Close the file, ignore errors here. */
C = F->Func (S);
if (Debug && C > 0) {
printf ("Applied %s: %u changes\n", F->Name, C);
C = F->Func (S);
if (Debug && C > 0) {
printf ("Applied %s: %u changes\n", F->Name, C);
F->TotalChanges += C;
F->LastChanges += C;
F->TotalChanges += C;
F->LastChanges += C;
+ /* If we had changes, regenerate register info */
+ if (C) {
+ CS_GenRegInfo (S);
+ }
+
} while (--Max && C > 0);
/* Return the number of changes */
} while (--Max && C > 0);
/* Return the number of changes */
Print (stdout, 1, "Running optimizer for global code segment\n");
}
Print (stdout, 1, "Running optimizer for global code segment\n");
}
+ /* Generate register info for all instructions */
+ CS_GenRegInfo (S);
+
/* Run groups of optimizations */
RunOptGroup1 (S);
RunOptGroup2 (S);
/* Run groups of optimizations */
RunOptGroup1 (S);
RunOptGroup2 (S);
RunOptGroup6 (S);
RunOptGroup7 (S);
RunOptGroup6 (S);
RunOptGroup7 (S);
+ /* Free register info */
+ CS_FreeRegInfo (S);
+
/* Write statistics */
if (StatFileName) {
WriteOptStats (StatFileName);
/* Write statistics */
if (StatFileName) {
WriteOptStats (StatFileName);
-/* (C) 2001-2005, Ullrich von Bassewitz */
-/* Römerstrasse 52 */
+/* (C) 2001-2012, Ullrich von Bassewitz */
+/* Roeerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
unsigned I;
- /* Generate register info for this step */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
unsigned I;
- /* Generate register info for this step */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
unsigned I;
- /* Generate register info for this step */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
-/* (C) 2001-2009, Ullrich von Bassewitz */
+/* (C) 2001-2012, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
unsigned I;
- /* Generate register info for this step */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
unsigned I;
- /* Generate register info for this step */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
unsigned I;
- /* Generate register info for this step */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
unsigned I;
- /* Generate register info for this step */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
unsigned I;
- /* Generate register info for this step */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
unsigned I;
- /* Generate register info for this step */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
unsigned I;
- /* Generate register info for this step */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
unsigned I;
- /* Generate register info for this step */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
unsigned I;
- /* Generate register info for this step */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
unsigned I;
- /* Generate register info for this step */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
unsigned I;
- /* Generate register info */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free the register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
unsigned I;
- /* Generate register info */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free the register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
unsigned I;
- /* Generate register info */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free the register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
unsigned I;
- /* Generate register info */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free the register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
-/* (C) 2001-2002 Ullrich von Bassewitz */
-/* Wacholderweg 14 */
-/* D-70597 Stuttgart */
-/* EMail: uz@cc65.org */
+/* (C) 2001-2012, Ullrich von Bassewitz */
+/* Roemerstrasse 52 */
+/* D-70794 Filderstadt */
+/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
unsigned I;
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
- /* Generate register info */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free the register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
unsigned I;
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
- /* Generate register info */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free the register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
-/* (C) 2002-2009, Ullrich von Bassewitz */
+/* (C) 2002-2012, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* Are we optimizing for size */
int OptForSize = (S->CodeSizeFactor < 100);
/* Are we optimizing for size */
int OptForSize = (S->CodeSizeFactor < 100);
- /* Generate register info for the following step */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
unsigned I;
- /* Generate register info for the following step */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
- /* Generate register info */
- CS_GenRegInfo (S);
-
/* Remember the code segment in the info struct */
Data.Code = S;
/* Remember the code segment in the info struct */
Data.Code = S;
- /* Free the register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
-/* (C) 2002-2006, Ullrich von Bassewitz */
-/* Römerstrasse 52 */
+/* (C) 2002-2012, Ullrich von Bassewitz */
+/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
unsigned I;
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
- /* Generate register info */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free the register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
unsigned I;
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
- /* Generate register info */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free the register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}
-/* (C) 2001-2009, Ullrich von Bassewitz */
+/* (C) 2001-2012, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
unsigned Changes = 0;
unsigned I;
unsigned Changes = 0;
unsigned I;
- /* Generate register info for this step */
- CS_GenRegInfo (S);
-
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
/* Walk over the entries */
I = 0;
while (I < CS_GetEntryCount (S)) {
- /* Free register info */
- CS_FreeRegInfo (S);
-
/* Return the number of changes made */
return Changes;
}
/* Return the number of changes made */
return Changes;
}