mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-08-13 10:25:25 +00:00
Change copies to stores when the value is unused.
This was already done by the optimizer, but it is simple enough to just do it all the time. This avoids most performance regressions from the previous commit, and also generates more efficient code for long long stores (in the common cases where the value of an assignment expression is not used in any larger expression).
This commit is contained in:
11
Gen.pas
11
Gen.pas
@@ -6528,6 +6528,17 @@ procedure GenTree {op: icptr};
|
|||||||
skipLoad := true;
|
skipLoad := true;
|
||||||
if op^.left^.opcode = pc_mov then
|
if op^.left^.opcode = pc_mov then
|
||||||
GenMov(op^.left, false)
|
GenMov(op^.left, false)
|
||||||
|
else if op^.left^.opcode in [pc_cop,pc_cpo,pc_cpi,pc_cbf] then begin
|
||||||
|
if op^.left^.opcode = pc_cop then
|
||||||
|
op^.left^.opcode := pc_str
|
||||||
|
else if op^.left^.opcode = pc_cpo then
|
||||||
|
op^.left^.opcode := pc_sro
|
||||||
|
else if op^.left^.opcode = pc_cpi then
|
||||||
|
op^.left^.opcode := pc_sto
|
||||||
|
else {if op^.left^.opcode = pc_cbf then}
|
||||||
|
op^.left^.opcode := pc_sbf;
|
||||||
|
GenTree(op^.left);
|
||||||
|
end {else if}
|
||||||
else begin
|
else begin
|
||||||
GenTree(op^.left);
|
GenTree(op^.left);
|
||||||
if isIncLoad then
|
if isIncLoad then
|
||||||
|
Reference in New Issue
Block a user