* improve is_loop_invariant for load nodes

git-svn-id: trunk@44252 -
This commit is contained in:
florian 2020-02-29 21:15:15 +00:00
parent 507fc9c1ff
commit ac974c9ab7

View File

@ -262,9 +262,10 @@ unit optloop;
begin
if (pi_dfaavailable in current_procinfo.flags) and
assigned(loop.optinfo) and
assigned(expr.optinfo) then
assigned(expr.optinfo) and
not(expr.isequal(tfornode(loop).left)) then
{ no aliasing? }
result:=not(tabstractvarsym(tloadnode(expr).symtableentry).addr_taken) and
result:=(([nf_write,nf_modify]*expr.flags)=[]) and not(tabstractvarsym(tloadnode(expr).symtableentry).addr_taken) and
{ no definition in the loop? }
not(DFASetIn(tfornode(loop).t2.optinfo^.defsum,expr.optinfo^.index));
end;