From 0bec4f557a96e1a40437cf5af20cc78a5eec8a63 Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Wed, 11 Jan 2023 22:29:53 +0000 Subject: getting closer --- compiler_and_linker/unsorted/LoopOptimization.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'compiler_and_linker/unsorted/LoopOptimization.c') diff --git a/compiler_and_linker/unsorted/LoopOptimization.c b/compiler_and_linker/unsorted/LoopOptimization.c index c2a360f..9db7c53 100644 --- a/compiler_and_linker/unsorted/LoopOptimization.c +++ b/compiler_and_linker/unsorted/LoopOptimization.c @@ -175,7 +175,7 @@ static void skiplooptest(Loop *loop) { loop->bodySize--; } - for (instr = instr->nextPCode; instr && !(instr->flags & fPCodeFlag1); instr = instr->nextPCode) + for (instr = instr->nextPCode; instr && !(instr->flags & fIsBranch); instr = instr->nextPCode) insertpcodebefore(loop->preheader->lastPCode, copypcode(instr)); } @@ -206,7 +206,7 @@ static void unrollloop(Loop *loop) { if (firstInstr->op != PC_CMP && firstInstr->op != PC_CMPL && firstInstr->op != PC_CMPI && firstInstr->op != PC_CMPLI) CError_FATAL(450); - for (instr = firstInstr->nextPCode; instr && !(instr->flags & fPCodeFlag1); instr = instr->nextPCode) + for (instr = firstInstr->nextPCode; instr && !(instr->flags & fIsBranch); instr = instr->nextPCode) appendpcode(newBlock, copypcode(instr)); for (block = loop->preheader->successors->block; block != loop->body; block = block->successors->block) { @@ -384,7 +384,7 @@ static void unrollloopconditional(Loop *loop) { for (j = 0; j < inputBlockCount; j++) { for (instr = blocks[j]->firstPCode; instr; instr = instr->nextPCode) { - if (instr->flags & fPCodeFlag1) { + if (instr->flags & fIsBranch) { PCodeArg *op; int opID; instrCopy = copypcode(instr); @@ -425,7 +425,7 @@ static void unrollloopconditional(Loop *loop) { if (firstInstr->op != PC_CMP && firstInstr->op != PC_CMPL && firstInstr->op != PC_CMPI && firstInstr->op != PC_CMPLI) CError_FATAL(764); - for (instr = firstInstr->nextPCode; instr && !(instr->flags & fPCodeFlag1); instr = instr->nextPCode) + for (instr = firstInstr->nextPCode; instr && !(instr->flags & fIsBranch); instr = instr->nextPCode) appendpcode(blocks2[inputBlockCount - 1], copypcode(instr)); for (j = 0; j < inputBlockCount; j++) { @@ -465,7 +465,7 @@ static void unrollloopconditional(Loop *loop) { for (i = 0; i < inputBlockCount; i++) { for (instr = blocks[i]->firstPCode; instr; instr = instr->nextPCode) { - if (instr->flags & fPCodeFlag1) { + if (instr->flags & fIsBranch) { PCodeArg *op; int opID; op = NULL; @@ -1293,7 +1293,7 @@ void changearraytoregisters(void) { if ((arrays = scanforlocalarrays())) { for (block = pcbasicblocks; block; block = block->nextBlock) { for (instr = block->firstPCode; instr; instr = instr->nextPCode) { - if (!(instr->flags & fPCodeFlag1) && instr->argCount) { + if (!(instr->flags & fIsBranch) && instr->argCount) { op = instr->args; i = instr->argCount; while (i--) { @@ -1304,7 +1304,7 @@ void changearraytoregisters(void) { !array->invalid ) { if ( - (instr->flags & (fPCodeFlag2 | fPCodeFlag4)) && + (instr->flags & (fIsRead | fIsWrite)) && (op->data.mem.offset % array->elementSize) == 0 && op->data.mem.offset < array->arraySize ) { @@ -1460,9 +1460,9 @@ void changearraytoregisters(void) { for (block = pcbasicblocks; block; block = block->nextBlock) { for (instr = block->firstPCode; instr; instr = instr->nextPCode) { if ( - !(instr->flags & fPCodeFlag1) && + !(instr->flags & fIsBranch) && instr->argCount && - (instr->flags & (fPCodeFlag2 | fPCodeFlag4)) && + (instr->flags & (fIsRead | fIsWrite)) && instr->args[2].kind == PCOp_MEMORY && (PCOpMemoryArg) instr->args[2].arg == PCOpMemory1 && (array = lookup_array_object(arrays, instr->args[2].data.mem.obj)) && -- cgit v1.2.3