mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-12-28 16:30:59 +00:00
Optimize out ? : operations with constant conditions.
The condition expression may become a constant due to optimizations, and optimizing out the ? : operation may also enable further optimizations.
This commit is contained in:
parent
102d6873a3
commit
c987f240c6
12
DAG.pas
12
DAG.pas
@ -2553,7 +2553,17 @@ case op^.opcode of {check for optimizations of this node}
|
||||
ReverseChildren(op^.right);
|
||||
op^.left := op^.left^.left;
|
||||
end; {if}
|
||||
end; {else if}
|
||||
end {else if}
|
||||
else if opcode = pc_ldc then
|
||||
if op^.left^.optype in [cgWord,cgUWord] then
|
||||
if op^.next = nil then
|
||||
if op^.left^.q <> 0 then begin
|
||||
if op^.optype = TypeOf(op^.right^.left) then
|
||||
opv := op^.right^.left;
|
||||
end {if}
|
||||
else
|
||||
if op^.optype = TypeOf(op^.right^.right) then
|
||||
opv := op^.right^.right;
|
||||
end; {case pc_tri}
|
||||
|
||||
pc_udi: begin {pc_udi}
|
||||
|
Loading…
Reference in New Issue
Block a user