* move more node tree optimizations to tcgprocinfo.OptimizeNodeTree

This commit is contained in:
florian 2021-09-05 18:00:11 +02:00
parent b3bf183fd3
commit d2921dfb55

View File

@ -1274,6 +1274,12 @@ implementation
(procdef.proctypeoption in [potype_operator,potype_procedure,potype_function]) and
(code.nodetype=blockn) and (tblocknode(code).statements=nil) then
procdef.isempty:=true;
if cs_opt_nodecse in current_settings.optimizerswitches then
do_optcse(code);
if cs_opt_use_load_modify_store in current_settings.optimizerswitches then
do_optloadmodifystore(code);
end;
@ -1941,12 +1947,6 @@ implementation
{ add implicit entry and exit code }
add_entry_exit_code;
if cs_opt_nodecse in current_settings.optimizerswitches then
do_optcse(code);
if cs_opt_use_load_modify_store in current_settings.optimizerswitches then
do_optloadmodifystore(code);
{ only do secondpass if there are no errors }
if (ErrorCount<>0) then
begin