Browse Source

+ AAarch64: TCpuAsmOptimizer.OptPass1Shift makes use of RemoveSuperfluousMove

git-svn-id: trunk@42971 -
florian 6 years ago
parent
commit
58eef0a5aa
1 changed files with 6 additions and 2 deletions
  1. 6 2
      compiler/aarch64/aoptcpu.pas

+ 6 - 2
compiler/aarch64/aoptcpu.pas

@@ -379,7 +379,7 @@ Implementation
          MatchOpType(taicpu(p),top_reg,top_reg,top_const) and
          MatchOpType(taicpu(p),top_reg,top_reg,top_const) and
          GetNextInstructionUsingReg(p, hp1, taicpu(p).oper[0]^.reg) and
          GetNextInstructionUsingReg(p, hp1, taicpu(p).oper[0]^.reg) and
          MatchInstruction(hp1, [A_ADD, A_AND, A_BIC, A_CMP, A_CMN,
          MatchInstruction(hp1, [A_ADD, A_AND, A_BIC, A_CMP, A_CMN,
-                                A_EON, A_EOR, A_MOV, A_NEG, A_ORN, A_ORR,
+                                A_EON, A_EOR, A_NEG, A_ORN, A_ORR,
                                 A_SUB, A_TST], [PF_None]) and
                                 A_SUB, A_TST], [PF_None]) and
          RegEndOfLife(taicpu(p).oper[0]^.reg, taicpu(hp1)) and
          RegEndOfLife(taicpu(p).oper[0]^.reg, taicpu(hp1)) and
          (taicpu(hp1).ops >= 2) and
          (taicpu(hp1).ops >= 2) and
@@ -459,7 +459,11 @@ Implementation
                 Result:=true;
                 Result:=true;
                 break;
                 break;
               end;
               end;
-        end;
+        end
+      else if MatchInstruction(p,[A_LSL, A_LSR, A_ASR,A_ROR],[PF_None]) and
+        GetNextInstructionUsingReg(p, hp1, taicpu(p).oper[0]^.reg) and
+        RemoveSuperfluousMove(p, hp1, 'ShiftMov2Shift') then
+        Result:=true;
     end;
     end;