|
@@ -753,22 +753,22 @@ implementation
|
|
dummy : byte;
|
|
dummy : byte;
|
|
{$endif ARM}
|
|
{$endif ARM}
|
|
begin
|
|
begin
|
|
- cv := 0;
|
|
|
|
- result := NODE_COMPLEXITY_INF; { For early exits by default. }
|
|
|
|
|
|
+ cv:=0;
|
|
|
|
+ result:=NODE_COMPLEXITY_INF; { For early exits by default. }
|
|
while assigned(p) and (cv<NODE_COMPLEXITY_INF) do { break = return cv, exit = return NODE_COMPLEXITY_INF. }
|
|
while assigned(p) and (cv<NODE_COMPLEXITY_INF) do { break = return cv, exit = return NODE_COMPLEXITY_INF. }
|
|
begin
|
|
begin
|
|
case p.nodetype of
|
|
case p.nodetype of
|
|
{ floating point constants usually need loading from memory }
|
|
{ floating point constants usually need loading from memory }
|
|
realconstn:
|
|
realconstn:
|
|
begin
|
|
begin
|
|
- cv:=2;
|
|
|
|
|
|
+ inc(cv,2);
|
|
break;
|
|
break;
|
|
end;
|
|
end;
|
|
temprefn:
|
|
temprefn:
|
|
begin
|
|
begin
|
|
if (ttemprefnode(p).tempinfo^.typedef.needs_inittable) or
|
|
if (ttemprefnode(p).tempinfo^.typedef.needs_inittable) or
|
|
not(ti_may_be_in_reg in ttemprefnode(p).tempflags) then
|
|
not(ti_may_be_in_reg in ttemprefnode(p).tempflags) then
|
|
- cv := 1;
|
|
|
|
|
|
+ inc(cv);
|
|
break;
|
|
break;
|
|
end;
|
|
end;
|
|
rttin,
|
|
rttin,
|
|
@@ -782,7 +782,7 @@ implementation
|
|
{ still works with nodeinlining (JM) }
|
|
{ still works with nodeinlining (JM) }
|
|
loadparentfpn:
|
|
loadparentfpn:
|
|
begin
|
|
begin
|
|
- cv := 1;
|
|
|
|
|
|
+ inc(cv);
|
|
break;
|
|
break;
|
|
end;
|
|
end;
|
|
loadn:
|
|
loadn:
|
|
@@ -800,7 +800,7 @@ implementation
|
|
not(tabstractvarsym(tloadnode(p).symtableentry).varregable=vr_addr) and
|
|
not(tabstractvarsym(tloadnode(p).symtableentry).varregable=vr_addr) and
|
|
tloadnode(p).is_addr_param_load then
|
|
tloadnode(p).is_addr_param_load then
|
|
inc(cv);
|
|
inc(cv);
|
|
- p := nil; { Check for NODE_COMPLEXITY_INF and return cv. }
|
|
|
|
|
|
+ p:=nil; { Check for NODE_COMPLEXITY_INF and return cv. }
|
|
end;
|
|
end;
|
|
subscriptn:
|
|
subscriptn:
|
|
begin
|
|
begin
|
|
@@ -811,10 +811,10 @@ implementation
|
|
overhead no overhead if the fields are aligned to register boundaries }
|
|
overhead no overhead if the fields are aligned to register boundaries }
|
|
else if tstoreddef(p.resultdef).is_intregable and (tsubscriptnode(p).vs.fieldoffset mod sizeof(aint)<>0) then
|
|
else if tstoreddef(p.resultdef).is_intregable and (tsubscriptnode(p).vs.fieldoffset mod sizeof(aint)<>0) then
|
|
inc(cv,1);
|
|
inc(cv,1);
|
|
- p := tunarynode(p).left;
|
|
|
|
|
|
+ p:=tunarynode(p).left;
|
|
end;
|
|
end;
|
|
blockn:
|
|
blockn:
|
|
- p := tunarynode(p).left;
|
|
|
|
|
|
+ p:=tunarynode(p).left;
|
|
callparan:
|
|
callparan:
|
|
begin
|
|
begin
|
|
{ call to decr? }
|
|
{ call to decr? }
|
|
@@ -822,14 +822,14 @@ implementation
|
|
assigned(tcallparanode(p).parasym) and (tcallparanode(p).parasym.varspez=vs_out) then
|
|
assigned(tcallparanode(p).parasym) and (tcallparanode(p).parasym.varspez=vs_out) then
|
|
exit;
|
|
exit;
|
|
inc(cv);
|
|
inc(cv);
|
|
- p := tunarynode(p).left;
|
|
|
|
|
|
+ p:=tunarynode(p).left;
|
|
end;
|
|
end;
|
|
notn,
|
|
notn,
|
|
derefn,
|
|
derefn,
|
|
addrn :
|
|
addrn :
|
|
begin
|
|
begin
|
|
inc(cv);
|
|
inc(cv);
|
|
- p := tunarynode(p).left;
|
|
|
|
|
|
+ p:=tunarynode(p).left;
|
|
end;
|
|
end;
|
|
typeconvn:
|
|
typeconvn:
|
|
begin
|
|
begin
|
|
@@ -837,12 +837,12 @@ implementation
|
|
if not(ttypeconvnode(p).retains_value_location) and
|
|
if not(ttypeconvnode(p).retains_value_location) and
|
|
not((ttypeconvnode(p).convtype=tc_pointer_2_array) and (ttypeconvnode(p).left.expectloc in [LOC_CREGISTER,LOC_REGISTER,LOC_CONSTANT])) then
|
|
not((ttypeconvnode(p).convtype=tc_pointer_2_array) and (ttypeconvnode(p).left.expectloc in [LOC_CREGISTER,LOC_REGISTER,LOC_CONSTANT])) then
|
|
inc(cv);
|
|
inc(cv);
|
|
- p := tunarynode(p).left;
|
|
|
|
|
|
+ p:=tunarynode(p).left;
|
|
end;
|
|
end;
|
|
statementn:
|
|
statementn:
|
|
begin
|
|
begin
|
|
inc(cv,node_complexity(tbinarynode(p).left));
|
|
inc(cv,node_complexity(tbinarynode(p).left));
|
|
- p := tbinarynode(p).right;
|
|
|
|
|
|
+ p:=tbinarynode(p).right;
|
|
end;
|
|
end;
|
|
addn,subn,orn,andn,xorn,symdifn,
|
|
addn,subn,orn,andn,xorn,symdifn,
|
|
shln,shrn,
|
|
shln,shrn,
|
|
@@ -850,17 +850,17 @@ implementation
|
|
assignn,vecn:
|
|
assignn,vecn:
|
|
begin
|
|
begin
|
|
inc(cv,node_complexity(tbinarynode(p).left)+1);
|
|
inc(cv,node_complexity(tbinarynode(p).left)+1);
|
|
- p := tbinarynode(p).right;
|
|
|
|
|
|
+ p:=tbinarynode(p).right;
|
|
end;
|
|
end;
|
|
muln:
|
|
muln:
|
|
begin
|
|
begin
|
|
inc(cv,node_complexity(tbinarynode(p).left)+{$ifdef CPU64BITALU}4{$else}8{$endif});
|
|
inc(cv,node_complexity(tbinarynode(p).left)+{$ifdef CPU64BITALU}4{$else}8{$endif});
|
|
- p := tbinarynode(p).right;
|
|
|
|
|
|
+ p:=tbinarynode(p).right;
|
|
end;
|
|
end;
|
|
divn,modn,slashn:
|
|
divn,modn,slashn:
|
|
begin
|
|
begin
|
|
inc(cv,node_complexity(tbinarynode(p).left)+{$ifdef CPU64BITALU}10{$else}20{$endif});
|
|
inc(cv,node_complexity(tbinarynode(p).left)+{$ifdef CPU64BITALU}10{$else}20{$endif});
|
|
- p := tbinarynode(p).right;
|
|
|
|
|
|
+ p:=tbinarynode(p).right;
|
|
end;
|
|
end;
|
|
inn:
|
|
inn:
|
|
begin
|
|
begin
|
|
@@ -873,17 +873,17 @@ implementation
|
|
end;
|
|
end;
|
|
{$endif in_const_set_complexity}
|
|
{$endif in_const_set_complexity}
|
|
inc(cv,3);
|
|
inc(cv,3);
|
|
- p := tbinarynode(p).right;
|
|
|
|
|
|
+ p:=tbinarynode(p).right;
|
|
end;
|
|
end;
|
|
ordconstn:
|
|
ordconstn:
|
|
begin
|
|
begin
|
|
{$ifdef ARM}
|
|
{$ifdef ARM}
|
|
if not(is_shifter_const(aint(tordconstnode(p).value.svalue),dummy)) then
|
|
if not(is_shifter_const(aint(tordconstnode(p).value.svalue),dummy)) then
|
|
- cv:=2;
|
|
|
|
|
|
+ inc(cv,2);
|
|
{$endif ARM}
|
|
{$endif ARM}
|
|
{$ifdef RISCV}
|
|
{$ifdef RISCV}
|
|
if not(is_imm12(aint(tordconstnode(p).value.svalue))) then
|
|
if not(is_imm12(aint(tordconstnode(p).value.svalue))) then
|
|
- cv:=2;
|
|
|
|
|
|
+ inc(cv,2);
|
|
{$endif RISCV}
|
|
{$endif RISCV}
|
|
break;
|
|
break;
|
|
end;
|
|
end;
|