Changd all Find*Last*InOpenRange() to return the beginning of the open range.
Fixed FindArgLastUsageInOpenRange().
This commit is contained in:
@@ -3038,13 +3038,13 @@ int FindArgLastUsageInOpenRange (CodeSeg* S, int First, int Last, CodeEntry* E,
|
|||||||
/* Find the last index where the arg of E might be used or changed in the range (First, Last).
|
/* Find the last index where the arg of E might be used or changed in the range (First, Last).
|
||||||
** ReloadY indicates whether Y is supposed to be reloaded.
|
** ReloadY indicates whether Y is supposed to be reloaded.
|
||||||
** The code block in the range must be basic without any jump backwards.
|
** The code block in the range must be basic without any jump backwards.
|
||||||
** Return the index of the found entry, or -1 if not found.
|
** Return the index of the found entry, or First if not found.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
LoadRegInfo LRI;
|
LoadRegInfo LRI;
|
||||||
CodeEntry* X;
|
CodeEntry* X;
|
||||||
unsigned CheckedFlags = LI_SRC_USE | LI_SRC_CHG;
|
unsigned CheckedFlags = LI_SRC_USE | LI_SRC_CHG;
|
||||||
int Found = -1;
|
int Found = First;
|
||||||
|
|
||||||
CHECK (Last <= (int)CollCount (&S->Entries));
|
CHECK (Last <= (int)CollCount (&S->Entries));
|
||||||
|
|
||||||
@@ -3066,8 +3066,8 @@ int FindArgLastUsageInOpenRange (CodeSeg* S, int First, int Last, CodeEntry* E,
|
|||||||
|
|
||||||
/* TODO: We don't currently check for all cases */
|
/* TODO: We don't currently check for all cases */
|
||||||
if ((LRI.Flags & (LI_DIRECT | LI_CHECK_ARG | LI_CHECK_Y | LI_RELOAD_Y)) == 0) {
|
if ((LRI.Flags & (LI_DIRECT | LI_CHECK_ARG | LI_CHECK_Y | LI_RELOAD_Y)) == 0) {
|
||||||
/* Just bail out as if the src would change right away */
|
/* Just bail out as if the src would change everywhere */
|
||||||
return 0;
|
return First < Last ? Last - 1 : First;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((LRI.Flags & LI_CHECK_Y) != 0) {
|
if ((LRI.Flags & LI_CHECK_Y) != 0) {
|
||||||
@@ -3145,11 +3145,11 @@ int FindRegLastChangeInOpenRange (CodeSeg* S, int First, int Last, unsigned what
|
|||||||
/* Find the last possible spot where the queried ZPs, registers and/or processor
|
/* Find the last possible spot where the queried ZPs, registers and/or processor
|
||||||
** states might be changed in the range (First, Last). The code block in the
|
** states might be changed in the range (First, Last). The code block in the
|
||||||
** range must be basic without any jump backwards.
|
** range must be basic without any jump backwards.
|
||||||
** Return the index of the found entry, or -1 if not found.
|
** Return the index of the found entry, or First if not found.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
CodeEntry* X;
|
CodeEntry* X;
|
||||||
int Found = -1;
|
int Found = First;
|
||||||
|
|
||||||
CHECK (Last <= (int)CollCount (&S->Entries));
|
CHECK (Last <= (int)CollCount (&S->Entries));
|
||||||
|
|
||||||
@@ -3169,11 +3169,11 @@ int FindRegLastUseInOpenRange (CodeSeg* S, int First, int Last, unsigned what)
|
|||||||
/* Find the last possible spot where the queried ZPs, registers and/or processor
|
/* Find the last possible spot where the queried ZPs, registers and/or processor
|
||||||
** states might be used in the range (First, Last). The code block in the range
|
** states might be used in the range (First, Last). The code block in the range
|
||||||
** must be basic without any jump backwards.
|
** must be basic without any jump backwards.
|
||||||
** Return the index of the found entry, or -1 if not found.
|
** Return the index of the found entry, or First if not found.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
CodeEntry* X;
|
CodeEntry* X;
|
||||||
int Found = -1;
|
int Found = First;
|
||||||
|
|
||||||
CHECK (Last <= (int)CollCount (&S->Entries));
|
CHECK (Last <= (int)CollCount (&S->Entries));
|
||||||
|
|
||||||
|
|||||||
@@ -433,7 +433,7 @@ int FindArgLastUsageInOpenRange (CodeSeg* S, int First, int Last, CodeEntry* E,
|
|||||||
/* Find the last index where the arg of E might be used or changed in the range (First, Last).
|
/* Find the last index where the arg of E might be used or changed in the range (First, Last).
|
||||||
** ReloadY indicates whether Y is supposed to be reloaded.
|
** ReloadY indicates whether Y is supposed to be reloaded.
|
||||||
** The code block in the range must be basic without any jump backwards.
|
** The code block in the range must be basic without any jump backwards.
|
||||||
** Return the index of the found entry, or -1 if not found.
|
** Return the index of the found entry, or First if not found.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int FindRegFirstChangeInOpenRange (CodeSeg* S, int First, int Last, unsigned what);
|
int FindRegFirstChangeInOpenRange (CodeSeg* S, int First, int Last, unsigned what);
|
||||||
@@ -454,14 +454,14 @@ int FindRegLastChangeInOpenRange (CodeSeg* S, int First, int Last, unsigned what
|
|||||||
/* Find the last possible spot where the queried ZPs, registers and/or processor
|
/* Find the last possible spot where the queried ZPs, registers and/or processor
|
||||||
** states might be changed in the range (First, Last). The code block in the
|
** states might be changed in the range (First, Last). The code block in the
|
||||||
** range must be basic without any jump backwards.
|
** range must be basic without any jump backwards.
|
||||||
** Return the index of the found entry, or -1 if not found.
|
** Return the index of the found entry, or First if not found.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int FindRegLastUseInOpenRange (CodeSeg* S, int First, int Last, unsigned what);
|
int FindRegLastUseInOpenRange (CodeSeg* S, int First, int Last, unsigned what);
|
||||||
/* Find the last possible spot where the queried ZPs, registers and/or processor
|
/* Find the last possible spot where the queried ZPs, registers and/or processor
|
||||||
** states might be used in the range (First, Last). The code block in the range
|
** states might be used in the range (First, Last). The code block in the range
|
||||||
** must be basic without any jump backwards.
|
** must be basic without any jump backwards.
|
||||||
** Return the index of the found entry, or -1 if not found.
|
** Return the index of the found entry, or First if not found.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* End of codeoptutil.h */
|
/* End of codeoptutil.h */
|
||||||
|
|||||||
Reference in New Issue
Block a user