mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 13:19:12 +02:00
* more aggressive cse on thread vars
This commit is contained in:
parent
ce6db34224
commit
84a852bc13
@ -48,6 +48,7 @@ unit optcse;
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
globtype,globals,
|
globtype,globals,
|
||||||
|
systems,
|
||||||
cutils,cclasses,
|
cutils,cclasses,
|
||||||
nutils,compinnr,
|
nutils,compinnr,
|
||||||
nbas,nld,ninl,ncal,nadd,nmem,ncnv,
|
nbas,nld,ninl,ncal,nadd,nmem,ncnv,
|
||||||
@ -645,7 +646,13 @@ unit optcse;
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if found then
|
if found then
|
||||||
inc(consts^[i].weight)
|
begin
|
||||||
|
inc(consts^[i].weight);
|
||||||
|
|
||||||
|
{ non-sectioned threadvars really hurt so do more aggressive cse on them }
|
||||||
|
if not(tf_section_threadvars in target_info.flags) and (n.nodetype=loadn) and (tloadnode(n).symtableentry.typ=staticvarsym) and (vo_is_thread_var in tstaticvarsym(tloadnode(n).symtableentry).varoptions) then
|
||||||
|
inc(consts^[i].weight);
|
||||||
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
SetLength(consts^,length(consts^)+1);
|
SetLength(consts^,length(consts^)+1);
|
||||||
|
Loading…
Reference in New Issue
Block a user