mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-03-06 21:30:27 +00:00
Avoid lifting indirect loads out of loops where the value may be modified.
The code was not accounting for the possibility that the loaded-from location aliases with the destination of an indirect store in the loop, or for the possibility that it may be written by a function called in the loop. Since we don't have sophisticated alias analysis, we now conservatively assume there may be aliasing in all such cases. This fixes #20 (compca20.c) and #21 (compca21.c).
This commit is contained in:
parent
780c639112
commit
1e8413138e
9
DAG.pas
9
DAG.pas
@ -4040,7 +4040,7 @@ var
|
|||||||
[pc_adi,pc_adl,pc_adr,pc_and,pc_lnd,pc_bnd,pc_bal,
|
[pc_adi,pc_adl,pc_adr,pc_and,pc_lnd,pc_bnd,pc_bal,
|
||||||
pc_bnt,pc_bnl,pc_bor,pc_blr,pc_bxr,pc_blx,pc_bno,
|
pc_bnt,pc_bnl,pc_bor,pc_blr,pc_bxr,pc_blx,pc_bno,
|
||||||
pc_dec,pc_dvi,pc_udi,pc_dvl,pc_udl,pc_dvr,pc_equ,pc_neq,
|
pc_dec,pc_dvi,pc_udi,pc_dvl,pc_udl,pc_dvr,pc_equ,pc_neq,
|
||||||
pc_grt,pc_les,pc_geq,pc_leq,pc_inc,pc_ind,pc_ior,pc_lor,
|
pc_grt,pc_les,pc_geq,pc_leq,pc_inc,pc_ior,pc_lor,
|
||||||
pc_ixa,pc_lad,pc_lao,pc_lca,pc_lda,pc_ldc,pc_mod,pc_uim,
|
pc_ixa,pc_lad,pc_lao,pc_lca,pc_lda,pc_ldc,pc_mod,pc_uim,
|
||||||
pc_mdl,pc_ulm,pc_mpi,pc_umi,pc_mpl,pc_uml,pc_mpr,pc_ngi,
|
pc_mdl,pc_ulm,pc_mpi,pc_umi,pc_mpl,pc_uml,pc_mpr,pc_ngi,
|
||||||
pc_ngl,pc_ngr,pc_not,pc_pop,pc_sbf,pc_sbi,pc_sbl,pc_sbr,
|
pc_ngl,pc_ngr,pc_not,pc_pop,pc_sbf,pc_sbi,pc_sbl,pc_sbr,
|
||||||
@ -4049,6 +4049,13 @@ var
|
|||||||
op^.parents := icount;
|
op^.parents := icount;
|
||||||
icount := icount+1;
|
icount := icount+1;
|
||||||
end {if}
|
end {if}
|
||||||
|
else if opcode = pc_ind then begin
|
||||||
|
{conservatively assume any indirect stores may alias with op}
|
||||||
|
if not indirectStores then begin
|
||||||
|
op^.parents := icount;
|
||||||
|
icount := icount+1;
|
||||||
|
end; {if}
|
||||||
|
end {else if}
|
||||||
else if opcode = pc_cnv then begin
|
else if opcode = pc_cnv then begin
|
||||||
if op^.q & $000F <> ord(cgVoid) then begin
|
if op^.q & $000F <> ord(cgVoid) then begin
|
||||||
op^.parents := icount;
|
op^.parents := icount;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user