Optimize away unneeded floating-point conversions after loads.

This commit is contained in:
Stephen Heumann 2021-03-10 18:48:58 -06:00
parent 031af54112
commit c95d8d9f9b
1 changed files with 5 additions and 0 deletions

View File

@ -1430,6 +1430,11 @@ case op^.opcode of {check for optimizations of this node}
op^.left^.optype := totype.optype;
opv := op^.left;
end; {if}
if totype.optype in [cgReal,cgDouble,cgExtended,cgComp] then
if (totype.optype = op^.left^.optype) or
(totype.optype = cgExtended) or
((totype.optype = cgDouble) and (op^.left^.optype = cgReal)) then
opv := op^.left;
end {else if}
else if op^.q in [$40,$41,$50,$51] then begin
{any long type to byte type}