فهرست منبع

* honour -Oonopeephole

git-svn-id: trunk@27106 -
Jonas Maebe 11 سال پیش
والد
کامیت
92fa75838e
1فایلهای تغییر یافته به همراه16 افزوده شده و 10 حذف شده
  1. 16 10
      compiler/aopt.pas

+ 16 - 10
compiler/aopt.pas

@@ -267,13 +267,16 @@ Unit aopt;
         pass_1;
         pass_1;
         While Assigned(BlockStart) Do
         While Assigned(BlockStart) Do
           Begin
           Begin
-             if pass = 0 then
-               PrePeepHoleOpts;
-            { Peephole optimizations }
-             PeepHoleOptPass1;
-            { Only perform them twice in the first pass }
-             if pass = 0 then
-               PeepHoleOptPass1;
+            if (cs_opt_peephole in current_settings.optimizerswitches) then
+              begin
+                if pass = 0 then
+                  PrePeepHoleOpts;
+                { Peephole optimizations }
+                PeepHoleOptPass1;
+                { Only perform them twice in the first pass }
+                if pass = 0 then
+                  PeepHoleOptPass1;
+              end;
             If (cs_opt_asmcse in current_settings.optimizerswitches) Then
             If (cs_opt_asmcse in current_settings.optimizerswitches) Then
               Begin
               Begin
 //                DFA:=TAOptDFACpu.Create(AsmL,BlockStart,BlockEnd,LabelInfo);
 //                DFA:=TAOptDFACpu.Create(AsmL,BlockStart,BlockEnd,LabelInfo);
@@ -283,9 +286,12 @@ Unit aopt;
       {          CSE;}
       {          CSE;}
               End;
               End;
             { more peephole optimizations }
             { more peephole optimizations }
-            PeepHoleOptPass2;
-            { if pass = last_pass then }
-            PostPeepHoleOpts;
+            if (cs_opt_peephole in current_settings.optimizerswitches) then
+              begin
+                PeepHoleOptPass2;
+                { if pass = last_pass then }
+                PostPeepHoleOpts;
+              end;
             { free memory }
             { free memory }
             clear;
             clear;
             { continue where we left off, BlockEnd is either the start of an }
             { continue where we left off, BlockEnd is either the start of an }