* more RemoveCurrentP usage

git-svn-id: trunk@43576 -
This commit is contained in:
florian 2019-11-24 19:51:04 +00:00
parent 9e307f5c3a
commit 94b728005d

View File

@ -829,10 +829,8 @@ unit aoptx86;
{ remove "imul $1, reg" } { remove "imul $1, reg" }
begin begin
hp1 := tai(p.Next); hp1 := tai(p.Next);
asml.remove(p);
DebugMsg(SPeepholeOptimization + 'Imul2Nop done',p); DebugMsg(SPeepholeOptimization + 'Imul2Nop done',p);
p.free; RemoveCurrentP(p);
p := hp1;
result:=true; result:=true;
end end
else else
@ -844,9 +842,8 @@ unit aoptx86;
p.free; p.free;
p := hp1; p := hp1;
end end
else if else if ((taicpu(p).ops <= 2) or
((taicpu(p).ops <= 2) or (taicpu(p).oper[2]^.typ = Top_Reg)) and
(taicpu(p).oper[2]^.typ = Top_Reg)) and
not(cs_opt_size in current_settings.optimizerswitches) and not(cs_opt_size in current_settings.optimizerswitches) and
(not(GetNextInstruction(p, hp1)) or (not(GetNextInstruction(p, hp1)) or
not((tai(hp1).typ = ait_instruction) and not((tai(hp1).typ = ait_instruction) and
@ -883,10 +880,8 @@ unit aoptx86;
hp1 := taicpu.op_ref_reg(A_LEA, opsize, TmpRef, taicpu(p).oper[2]^.reg); hp1 := taicpu.op_ref_reg(A_LEA, opsize, TmpRef, taicpu(p).oper[2]^.reg);
AsmL.InsertAfter(hp1,p); AsmL.InsertAfter(hp1,p);
DebugMsg(SPeepholeOptimization + 'Imul2LeaShl done',p); DebugMsg(SPeepholeOptimization + 'Imul2LeaShl done',p);
AsmL.Remove(p);
taicpu(hp1).fileinfo:=taicpu(p).fileinfo; taicpu(hp1).fileinfo:=taicpu(p).fileinfo;
p.free; RemoveCurrentP(p);
p := hp1;
if ShiftValue>0 then if ShiftValue>0 then
AsmL.InsertAfter(taicpu.op_const_reg(A_SHL, opsize, ShiftValue, taicpu(hp1).oper[1]^.reg),hp1); AsmL.InsertAfter(taicpu.op_const_reg(A_SHL, opsize, ShiftValue, taicpu(hp1).oper[1]^.reg),hp1);
end; end;