* forgotten commit of loop strength reduction patch

git-svn-id: trunk@12174 -
This commit is contained in:
florian 2008-11-19 11:03:20 +00:00
parent 108db3e1db
commit c8fae83c57

View File

@ -105,7 +105,7 @@ implementation
ncgutil,regvars, ncgutil,regvars,
optbase, optbase,
opttail, opttail,
optcse, optcse,optloop,
optutils optutils
{$if defined(arm) or defined(powerpc) or defined(powerpc64)} {$if defined(arm) or defined(powerpc) or defined(powerpc64)}
,aasmcpu ,aasmcpu
@ -696,6 +696,7 @@ implementation
headertai : tai; headertai : tai;
i : integer; i : integer;
varsym : tabstractnormalvarsym; varsym : tabstractnormalvarsym;
RedoDFA : boolean;
begin begin
{ the initialization procedure can be empty, then we { the initialization procedure can be empty, then we
don't need to generate anything. When it was an empty don't need to generate anything. When it was an empty
@ -767,8 +768,7 @@ implementation
if (cs_opt_nodedfa in current_settings.optimizerswitches) and if (cs_opt_nodedfa in current_settings.optimizerswitches) and
{ creating dfa is not always possible } { creating dfa is not always possible }
((flags*[pi_has_assembler_block,pi_uses_exceptions,pi_is_assembler, ((flags*[pi_has_assembler_block,pi_uses_exceptions,pi_is_assembler,
pi_needs_implicit_finally,pi_has_implicit_finally,pi_has_stackparameter, pi_needs_implicit_finally,pi_has_implicit_finally])=[]) then
pi_needs_stackframe])=[]) then
begin begin
dfabuilder:=TDFABuilder.Create; dfabuilder:=TDFABuilder.Create;
dfabuilder.createdfainfo(code); dfabuilder.createdfainfo(code);
@ -799,6 +799,15 @@ implementation
end; end;
end; end;
end; end;
include(flags,pi_dfaavailable);
end;
if (cs_opt_loopstrength in current_settings.optimizerswitches)
{ our induction variable strength reduction doesn't like
for loops with more than one entry }
and not(pi_has_goto in current_procinfo.flags) then
begin
RedoDFA:=OptimizeInductionVariables(code);
end; end;
if cs_opt_nodecse in current_settings.optimizerswitches then if cs_opt_nodecse in current_settings.optimizerswitches then