Browse Source

* fixed some bugs in the previous improvements: in some cases, esi was
still being replaced before a conditional jump (the code that
detected conditional jumps sometimes skipped over them)

Jonas Maebe 25 years ago
parent
commit
9eaa410ca7
1 changed files with 12 additions and 3 deletions
  1. 12 3
      compiler/csopt386.pas

+ 12 - 3
compiler/csopt386.pas

@@ -135,9 +135,13 @@ var
   hp, prevFound: pai;
   hp, prevFound: pai;
   tmpResult: tregister;
   tmpResult: tregister;
 begin
 begin
- getPrevSequence := R_NO;
- { no memory writes (could be refined further) }
+  getPrevSequence := R_NO;
+  { no memory writes (could be refined further) }
+    passedJump := passedJump or
+      ((current^.typ = ait_instruction) and
+       (paicpu(current)^.is_jmp));
   if modifiesMemLocation(current) or
   if modifiesMemLocation(current) or
+     (passedJump and not(reg in (usableregs+[R_EDI]))) or
      not getLastInstruction(current,hp) then
      not getLastInstruction(current,hp) then
     exit;
     exit;
   tmpResult := R_NO;
   tmpResult := R_NO;
@@ -1493,7 +1497,12 @@ End.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.8  2000-09-20 15:00:58  jonas
+  Revision 1.9  2000-09-22 15:01:59  jonas
+    * fixed some bugs in the previous improvements: in some cases, esi was
+      still being replaced before a conditional jump (the code that
+      detected conditional jumps sometimes skipped over them)
+
+  Revision 1.8  2000/09/20 15:00:58  jonas
     + much improved CSE: the CSE now searches further back for sequences it
     + much improved CSE: the CSE now searches further back for sequences it
       can reuse. After I've also implemented register renaming, the effect
       can reuse. After I've also implemented register renaming, the effect
       should be even better (afaik web bug 1088 will then even be optimized
       should be even better (afaik web bug 1088 will then even be optimized