2
0
Эх сурвалжийг харах

+ apply cse on load parent frame pointer nodes

git-svn-id: trunk@16055 -
florian 15 жил өмнө
parent
commit
7199ac4ad7

+ 1 - 1
compiler/ncgld.pas

@@ -410,7 +410,7 @@ implementation
                 if assigned(left) then
                 if assigned(left) then
                   begin
                   begin
                     secondpass(left);
                     secondpass(left);
-                    if left.location.loc<>LOC_REGISTER then
+                    if not(left.location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
                       internalerror(200309286);
                       internalerror(200309286);
                     if vs.localloc.loc<>LOC_REFERENCE then
                     if vs.localloc.loc<>LOC_REFERENCE then
                       internalerror(200409241);
                       internalerror(200409241);

+ 2 - 0
compiler/nutils.pas

@@ -703,6 +703,8 @@ implementation
                 end;
                 end;
               loadn:
               loadn:
                 begin
                 begin
+                  if assigned(tloadnode(p).left) then
+                    inc(result,node_complexity(tloadnode(p).left));
                   { threadvars need a helper call }
                   { threadvars need a helper call }
                   if (tloadnode(p).symtableentry.typ=staticvarsym) and
                   if (tloadnode(p).symtableentry.typ=staticvarsym) and
                      (vo_is_thread_var in tstaticvarsym(tloadnode(p).symtableentry).varoptions) then
                      (vo_is_thread_var in tstaticvarsym(tloadnode(p).symtableentry).varoptions) then

+ 3 - 2
compiler/optcse.pas

@@ -65,7 +65,7 @@ unit optcse;
       cseinvariant : set of tnodetype = [loadn,addn,muln,subn,divn,slashn,modn,andn,orn,xorn,notn,vecn,
       cseinvariant : set of tnodetype = [loadn,addn,muln,subn,divn,slashn,modn,andn,orn,xorn,notn,vecn,
         derefn,equaln,unequaln,ltn,gtn,lten,gten,typeconvn,subscriptn,
         derefn,equaln,unequaln,ltn,gtn,lten,gten,typeconvn,subscriptn,
         inn,symdifn,shrn,shln,ordconstn,realconstn,unaryminusn,pointerconstn,stringconstn,setconstn,
         inn,symdifn,shrn,shln,ordconstn,realconstn,unaryminusn,pointerconstn,stringconstn,setconstn,
-        isn,asn,starstarn,nothingn,temprefn {,callparan}];
+        isn,asn,starstarn,nothingn,temprefn,loadparentfpn {,callparan}];
 
 
     function searchsubdomain(var n:tnode; arg: pointer) : foreachnoderesult;
     function searchsubdomain(var n:tnode; arg: pointer) : foreachnoderesult;
       begin
       begin
@@ -120,7 +120,8 @@ unit optcse;
         { so far, we can handle only nodes being read }
         { so far, we can handle only nodes being read }
         if (n.flags*[nf_write,nf_modify]=[]) and
         if (n.flags*[nf_write,nf_modify]=[]) and
           { node possible to add? }
           { node possible to add? }
-          assigned(n.resultdef) and (tstoreddef(n.resultdef).is_intregable or tstoreddef(n.resultdef).is_fpuregable) and
+          assigned(n.resultdef) and
+          (tstoreddef(n.resultdef).is_intregable or tstoreddef(n.resultdef).is_fpuregable) and
           { is_int/fpuregable allows arrays and records to be in registers, cse cannot handle this }
           { is_int/fpuregable allows arrays and records to be in registers, cse cannot handle this }
           not(n.resultdef.typ in [arraydef,recorddef]) and
           not(n.resultdef.typ in [arraydef,recorddef]) and
           { same for voiddef }
           { same for voiddef }