aoptcpu.pas 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577
  1. {
  2. Copyright (c) 1998-2002 by Jonas Maebe, member of the Free Pascal
  3. Development Team
  4. This unit implements the ARM optimizer object
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. Unit aoptcpu;
  19. {$i fpcdefs.inc}
  20. Interface
  21. uses cpubase, aasmtai, aopt, aoptcpub;
  22. Type
  23. TCpuAsmOptimizer = class(TAsmOptimizer)
  24. { uses the same constructor as TAopObj }
  25. function PeepHoleOptPass1Cpu(var p: tai): boolean; override;
  26. procedure PeepHoleOptPass2;override;
  27. End;
  28. TCpuPreRegallocScheduler = class(TAsmOptimizer)
  29. function PeepHoleOptPass1Cpu(var p: tai): boolean;override;
  30. end;
  31. TCpuThumb2AsmOptimizer = class(TCpuAsmOptimizer)
  32. { uses the same constructor as TAopObj }
  33. procedure PeepHoleOptPass2;override;
  34. End;
  35. Implementation
  36. uses
  37. cutils,
  38. verbose,
  39. cgbase,cgutils,
  40. aasmbase,aasmdata,aasmcpu;
  41. function CanBeCond(p : tai) : boolean;
  42. begin
  43. result:=
  44. (p.typ=ait_instruction) and
  45. (taicpu(p).condition=C_None) and
  46. ((taicpu(p).opcode<>A_BLX) or
  47. (taicpu(p).oper[0]^.typ=top_reg));
  48. end;
  49. function RefsEqual(const r1, r2: treference): boolean;
  50. begin
  51. refsequal :=
  52. (r1.offset = r2.offset) and
  53. (r1.base = r2.base) and
  54. (r1.index = r2.index) and (r1.scalefactor = r2.scalefactor) and
  55. (r1.symbol=r2.symbol) and (r1.refaddr = r2.refaddr) and
  56. (r1.relsymbol = r2.relsymbol) and
  57. (r1.signindex = r2.signindex) and
  58. (r1.shiftimm = r2.shiftimm) and
  59. (r1.addressmode = r2.addressmode) and
  60. (r1.shiftmode = r2.shiftmode);
  61. end;
  62. function TCpuAsmOptimizer.PeepHoleOptPass1Cpu(var p: tai): boolean;
  63. var
  64. next1: tai;
  65. hp1,hp2: tai;
  66. begin
  67. result := false;
  68. case p.typ of
  69. ait_instruction:
  70. begin
  71. (* optimization proved not to be safe, see tw4768.pp
  72. {
  73. change
  74. <op> reg,x,y
  75. cmp reg,#0
  76. into
  77. <op>s reg,x,y
  78. }
  79. { this optimization can applied only to the currently enabled operations because
  80. the other operations do not update all flags and FPC does not track flag usage }
  81. if (taicpu(p).opcode in [A_ADC,A_ADD,A_SUB {A_UDIV,A_SDIV,A_MUL,A_MVN,A_MOV,A_ORR,A_EOR,A_AND}]) and
  82. (taicpu(p).oper[0]^.typ = top_reg) and
  83. (taicpu(p).oppostfix = PF_None) and
  84. (taicpu(p).condition = C_None) and
  85. GetNextInstruction(p, hp1) and
  86. (tai(hp1).typ = ait_instruction) and
  87. (taicpu(hp1).opcode = A_CMP) and
  88. (taicpu(hp1).oppostfix = PF_None) and
  89. (taicpu(hp1).condition = C_None) and
  90. (taicpu(hp1).oper[0]^.typ = top_reg) and
  91. (taicpu(hp1).oper[1]^.typ = top_const) and
  92. (taicpu(p).oper[0]^.reg = taicpu(hp1).oper[0]^.reg) and
  93. (taicpu(hp1).oper[1]^.val = 0) { and
  94. GetNextInstruction(hp1, hp2) and
  95. (tai(hp2).typ = ait_instruction) and
  96. // be careful here, following instructions could use other flags
  97. // however after a jump fpc never depends on the value of flags
  98. (taicpu(hp2).opcode = A_B) and
  99. (taicpu(hp2).condition in [C_EQ,C_NE,C_MI,C_PL])} then
  100. begin
  101. taicpu(p).oppostfix:=PF_S;
  102. asml.remove(hp1);
  103. hp1.free;
  104. end
  105. else
  106. *)
  107. case taicpu(p).opcode of
  108. A_STR:
  109. begin
  110. { change
  111. str reg1,ref
  112. ldr reg2,ref
  113. into
  114. str reg1,ref
  115. mov reg2,reg1
  116. }
  117. if (taicpu(p).oper[1]^.ref^.addressmode=AM_OFFSET) and
  118. GetNextInstruction(p,hp1) and
  119. (hp1.typ = ait_instruction) and
  120. (taicpu(hp1).opcode = A_LDR) and
  121. RefsEqual(taicpu(p).oper[1]^.ref^,taicpu(hp1).oper[1]^.ref^) and
  122. ((taicpu(p).condition = taicpu(hp1).condition) or
  123. (taicpu(p).condition = C_None)) and
  124. (taicpu(hp1).oper[1]^.ref^.addressmode=AM_OFFSET) then
  125. begin
  126. if taicpu(hp1).oper[0]^.reg=taicpu(p).oper[0]^.reg then
  127. begin
  128. asml.remove(hp1);
  129. hp1.free;
  130. end
  131. else
  132. begin
  133. taicpu(hp1).opcode:=A_MOV;
  134. taicpu(hp1).oppostfix:=PF_None;
  135. taicpu(hp1).loadreg(1,taicpu(p).oper[0]^.reg);
  136. end;
  137. result := true;
  138. end;
  139. end;
  140. A_LDR:
  141. begin
  142. { change
  143. ldr reg1,ref
  144. ldr reg2,ref
  145. into
  146. ldr reg1,ref
  147. mov reg2,reg1
  148. }
  149. if (taicpu(p).oper[1]^.ref^.addressmode=AM_OFFSET) and
  150. GetNextInstruction(p,hp1) and
  151. (hp1.typ = ait_instruction) and
  152. (taicpu(hp1).opcode = A_LDR) and
  153. RefsEqual(taicpu(p).oper[1]^.ref^,taicpu(hp1).oper[1]^.ref^) and
  154. ((taicpu(p).condition = taicpu(hp1).condition) or
  155. (taicpu(p).condition = C_None)) and
  156. (taicpu(p).oper[0]^.reg<>taicpu(hp1).oper[1]^.ref^.index) and
  157. (taicpu(p).oper[0]^.reg<>taicpu(hp1).oper[1]^.ref^.base) and
  158. (taicpu(hp1).oper[1]^.ref^.addressmode=AM_OFFSET) then
  159. begin
  160. if taicpu(hp1).oper[0]^.reg=taicpu(p).oper[0]^.reg then
  161. begin
  162. asml.remove(hp1);
  163. hp1.free;
  164. end
  165. else
  166. begin
  167. taicpu(hp1).opcode:=A_MOV;
  168. taicpu(hp1).oppostfix:=PF_None;
  169. taicpu(hp1).loadreg(1,taicpu(p).oper[0]^.reg);
  170. end;
  171. result := true;
  172. end;
  173. end;
  174. A_MOV:
  175. begin
  176. { fold
  177. mov reg1,reg0, shift imm1
  178. mov reg1,reg1, shift imm2
  179. to
  180. mov reg1,reg0, shift imm1+imm2
  181. }
  182. if (taicpu(p).ops=3) and
  183. (taicpu(p).oper[0]^.typ = top_reg) and
  184. (taicpu(p).oper[2]^.typ = top_shifterop) and
  185. (taicpu(p).oper[2]^.shifterop^.rs = NR_NO) and
  186. getnextinstruction(p,next1) and
  187. (next1.typ = ait_instruction) and
  188. (taicpu(next1).opcode = A_MOV) and
  189. (taicpu(p).condition=taicpu(next1).condition) and
  190. (taicpu(next1).ops=3) and
  191. (taicpu(next1).oper[0]^.typ = top_reg) and
  192. (taicpu(p).oper[0]^.reg=taicpu(next1).oper[0]^.reg) and
  193. (taicpu(next1).oper[1]^.typ = top_reg) and
  194. (taicpu(p).oper[0]^.reg=taicpu(next1).oper[1]^.reg) and
  195. (taicpu(next1).oper[2]^.typ = top_shifterop) and
  196. (taicpu(next1).oper[2]^.shifterop^.rs = NR_NO) and
  197. (taicpu(p).oper[2]^.shifterop^.shiftmode=taicpu(next1).oper[2]^.shifterop^.shiftmode) then
  198. begin
  199. inc(taicpu(p).oper[2]^.shifterop^.shiftimm,taicpu(next1).oper[2]^.shifterop^.shiftimm);
  200. { avoid overflows }
  201. if taicpu(p).oper[2]^.shifterop^.shiftimm>31 then
  202. case taicpu(p).oper[2]^.shifterop^.shiftmode of
  203. SM_ROR:
  204. taicpu(p).oper[2]^.shifterop^.shiftimm:=taicpu(p).oper[2]^.shifterop^.shiftimm and 31;
  205. SM_ASR:
  206. taicpu(p).oper[2]^.shifterop^.shiftimm:=31;
  207. SM_LSR,
  208. SM_LSL:
  209. begin
  210. hp1:=taicpu.op_reg_const(A_MOV,taicpu(p).oper[0]^.reg,0);
  211. InsertLLItem(p.previous, p.next, hp1);
  212. p.free;
  213. p:=hp1;
  214. end;
  215. else
  216. internalerror(2008072803);
  217. end;
  218. asml.remove(next1);
  219. next1.free;
  220. result := true;
  221. end;
  222. end;
  223. A_AND:
  224. begin
  225. {
  226. change
  227. and reg2,reg1,const1
  228. and reg2,reg2,const2
  229. to
  230. and reg2,reg1,(const1 and const2)
  231. }
  232. if (taicpu(p).oper[0]^.typ = top_reg) and
  233. (taicpu(p).oper[1]^.typ = top_reg) and
  234. (taicpu(p).oper[2]^.typ = top_const) and
  235. GetNextInstruction(p, hp1) and
  236. (tai(hp1).typ = ait_instruction) and
  237. (taicpu(hp1).opcode = A_AND) and
  238. (taicpu(p).condition=taicpu(hp1).condition) and
  239. (taicpu(p).oppostfix=PF_None) and
  240. (taicpu(hp1).oper[0]^.typ = top_reg) and
  241. (taicpu(hp1).oper[1]^.typ = top_reg) and
  242. (taicpu(hp1).oper[2]^.typ = top_const) and
  243. (taicpu(p).oper[0]^.reg = taicpu(hp1).oper[0]^.reg) and
  244. (taicpu(hp1).oper[0]^.reg = taicpu(hp1).oper[1]^.reg) then
  245. begin
  246. taicpu(p).loadConst(2,taicpu(p).oper[2]^.val and taicpu(hp1).oper[2]^.val);
  247. taicpu(p).oppostfix:=taicpu(hp1).oppostfix;
  248. asml.remove(hp1);
  249. hp1.free;
  250. end;
  251. end;
  252. end;
  253. end;
  254. end;
  255. end;
  256. { instructions modifying the CPSR can be only the last instruction }
  257. function MustBeLast(p : tai) : boolean;
  258. begin
  259. Result:=(p.typ=ait_instruction) and
  260. ((taicpu(p).opcode in [A_BL,A_BLX,A_CMP,A_CMN,A_SWI,A_TEQ,A_TST,A_CMF,A_CMFE {,A_MSR}]) or
  261. ((taicpu(p).ops>=1) and (taicpu(p).oper[0]^.typ=top_reg) and (taicpu(p).oper[0]^.reg=NR_PC)) or
  262. (taicpu(p).oppostfix=PF_S));
  263. end;
  264. procedure TCpuAsmOptimizer.PeepHoleOptPass2;
  265. var
  266. p,hp1,hp2: tai;
  267. l : longint;
  268. condition : tasmcond;
  269. hp3: tai;
  270. WasLast: boolean;
  271. { UsedRegs, TmpUsedRegs: TRegSet; }
  272. begin
  273. p := BlockStart;
  274. { UsedRegs := []; }
  275. while (p <> BlockEnd) Do
  276. begin
  277. { UpdateUsedRegs(UsedRegs, tai(p.next)); }
  278. case p.Typ Of
  279. Ait_Instruction:
  280. begin
  281. case taicpu(p).opcode Of
  282. A_B:
  283. if taicpu(p).condition<>C_None then
  284. begin
  285. { check for
  286. Bxx xxx
  287. <several instructions>
  288. xxx:
  289. }
  290. l:=0;
  291. WasLast:=False;
  292. GetNextInstruction(p, hp1);
  293. while assigned(hp1) and
  294. (l<=4) and
  295. CanBeCond(hp1) and
  296. { stop on labels }
  297. not(hp1.typ=ait_label) do
  298. begin
  299. inc(l);
  300. if MustBeLast(hp1) then
  301. begin
  302. WasLast:=True;
  303. GetNextInstruction(hp1,hp1);
  304. break;
  305. end
  306. else
  307. GetNextInstruction(hp1,hp1);
  308. end;
  309. if assigned(hp1) then
  310. begin
  311. if FindLabel(tasmlabel(taicpu(p).oper[0]^.ref^.symbol),hp1) then
  312. begin
  313. if (l<=4) and (l>0) then
  314. begin
  315. condition:=inverse_cond(taicpu(p).condition);
  316. hp2:=p;
  317. GetNextInstruction(p,hp1);
  318. p:=hp1;
  319. repeat
  320. if hp1.typ=ait_instruction then
  321. taicpu(hp1).condition:=condition;
  322. if MustBeLast(hp1) then
  323. begin
  324. GetNextInstruction(hp1,hp1);
  325. break;
  326. end
  327. else
  328. GetNextInstruction(hp1,hp1);
  329. until not(assigned(hp1)) or
  330. not(CanBeCond(hp1)) or
  331. (hp1.typ=ait_label);
  332. { wait with removing else GetNextInstruction could
  333. ignore the label if it was the only usage in the
  334. jump moved away }
  335. tasmlabel(taicpu(hp2).oper[0]^.ref^.symbol).decrefs;
  336. asml.remove(hp2);
  337. hp2.free;
  338. continue;
  339. end;
  340. end
  341. else
  342. { do not perform further optimizations if there is inctructon
  343. in block #1 which can not be optimized.
  344. }
  345. if not WasLast then
  346. begin
  347. { check further for
  348. Bcc xxx
  349. <several instructions 1>
  350. B yyy
  351. xxx:
  352. <several instructions 2>
  353. yyy:
  354. }
  355. { hp2 points to jmp yyy }
  356. hp2:=hp1;
  357. { skip hp1 to xxx }
  358. GetNextInstruction(hp1, hp1);
  359. if assigned(hp2) and
  360. assigned(hp1) and
  361. (l<=3) and
  362. (hp2.typ=ait_instruction) and
  363. (taicpu(hp2).is_jmp) and
  364. (taicpu(hp2).condition=C_None) and
  365. { real label and jump, no further references to the
  366. label are allowed }
  367. (tasmlabel(taicpu(p).oper[0]^.ref^.symbol).getrefs=2) and
  368. FindLabel(tasmlabel(taicpu(p).oper[0]^.ref^.symbol),hp1) then
  369. begin
  370. l:=0;
  371. { skip hp1 to <several moves 2> }
  372. GetNextInstruction(hp1, hp1);
  373. while assigned(hp1) and
  374. CanBeCond(hp1) do
  375. begin
  376. inc(l);
  377. GetNextInstruction(hp1, hp1);
  378. end;
  379. { hp1 points to yyy: }
  380. if assigned(hp1) and
  381. FindLabel(tasmlabel(taicpu(hp2).oper[0]^.ref^.symbol),hp1) then
  382. begin
  383. condition:=inverse_cond(taicpu(p).condition);
  384. GetNextInstruction(p,hp1);
  385. hp3:=p;
  386. p:=hp1;
  387. repeat
  388. if hp1.typ=ait_instruction then
  389. taicpu(hp1).condition:=condition;
  390. GetNextInstruction(hp1,hp1);
  391. until not(assigned(hp1)) or
  392. not(CanBeCond(hp1));
  393. { hp2 is still at jmp yyy }
  394. GetNextInstruction(hp2,hp1);
  395. { hp2 is now at xxx: }
  396. condition:=inverse_cond(condition);
  397. GetNextInstruction(hp1,hp1);
  398. { hp1 is now at <several movs 2> }
  399. repeat
  400. taicpu(hp1).condition:=condition;
  401. GetNextInstruction(hp1,hp1);
  402. until not(assigned(hp1)) or
  403. not(CanBeCond(hp1)) or
  404. (hp1.typ=ait_label);
  405. {
  406. asml.remove(hp1.next)
  407. hp1.next.free;
  408. asml.remove(hp1);
  409. hp1.free;
  410. }
  411. { remove Bcc }
  412. tasmlabel(taicpu(hp3).oper[0]^.ref^.symbol).decrefs;
  413. asml.remove(hp3);
  414. hp3.free;
  415. { remove jmp }
  416. tasmlabel(taicpu(hp2).oper[0]^.ref^.symbol).decrefs;
  417. asml.remove(hp2);
  418. hp2.free;
  419. continue;
  420. end;
  421. end;
  422. end;
  423. end;
  424. end;
  425. end;
  426. end;
  427. end;
  428. p := tai(p.next)
  429. end;
  430. end;
  431. const
  432. { set of opcode which might or do write to memory }
  433. { TODO : extend armins.dat to contain r/w info }
  434. opcode_could_mem_write = [A_B,A_BL,A_BLX,A_BKPT,A_BX,A_STR,A_STRB,A_STRBT,
  435. A_STRH,A_STRT,A_STF,A_SFM,A_STM,A_FSTS,A_FSTD];
  436. function TCpuPreRegallocScheduler.PeepHoleOptPass1Cpu(var p: tai): boolean;
  437. { TODO : schedule also forward }
  438. { TODO : schedule distance > 1 }
  439. var
  440. hp1,hp2,hp3,hp4,hp5 : tai;
  441. list : TAsmList;
  442. begin
  443. result:=true;
  444. list:=TAsmList.Create;
  445. p := BlockStart;
  446. { UsedRegs := []; }
  447. while (p <> BlockEnd) Do
  448. begin
  449. if (p.typ=ait_instruction) and
  450. GetNextInstruction(p,hp1) and
  451. (hp1.typ=ait_instruction) and
  452. { for now we don't reschedule if the previous instruction changes potentially a memory location }
  453. ( (not(taicpu(p).opcode in opcode_could_mem_write) and
  454. not(RegModifiedByInstruction(NR_PC,p)) and
  455. (taicpu(hp1).opcode in [A_LDR,A_LDRB,A_LDRH,A_LDRSB,A_LDRSH])
  456. ) or
  457. ((taicpu(p).opcode in [A_STM,A_STRB,A_STRH,A_STR]) and
  458. (taicpu(hp1).opcode in [A_LDR,A_LDRB,A_LDRH,A_LDRSB,A_LDRSH]) and
  459. ((taicpu(hp1).oper[1]^.ref^.base=NR_PC) or
  460. (assigned(taicpu(hp1).oper[1]^.ref^.symboldata) and
  461. (taicpu(hp1).oper[1]^.ref^.offset=0)
  462. )
  463. ) or
  464. { try to prove that the memory accesses don't overlapp }
  465. ((taicpu(p).opcode in [A_STRB,A_STRH,A_STR]) and
  466. (taicpu(hp1).opcode in [A_LDR,A_LDRB,A_LDRH,A_LDRSB,A_LDRSH]) and
  467. (taicpu(p).oper[1]^.ref^.base=taicpu(hp1).oper[1]^.ref^.base) and
  468. (taicpu(p).oppostfix=PF_None) and
  469. (taicpu(hp1).oppostfix=PF_None) and
  470. (taicpu(p).oper[1]^.ref^.index=NR_NO) and
  471. (taicpu(hp1).oper[1]^.ref^.index=NR_NO) and
  472. { get operand sizes and check if the offset distance is large enough to ensure no overlapp }
  473. (abs(taicpu(p).oper[1]^.ref^.offset-taicpu(hp1).oper[1]^.ref^.offset)>=max(tcgsize2size[reg_cgsize(taicpu(p).oper[0]^.reg)],tcgsize2size[reg_cgsize(taicpu(hp1).oper[0]^.reg)]))
  474. )
  475. )
  476. ) and
  477. GetNextInstruction(hp1,hp2) and
  478. (hp2.typ=ait_instruction) and
  479. { loaded register used by next instruction? }
  480. (RegInInstruction(taicpu(hp1).oper[0]^.reg,hp2)) and
  481. { loaded register not used by previous instruction? }
  482. not(RegInInstruction(taicpu(hp1).oper[0]^.reg,p)) and
  483. { same condition? }
  484. (taicpu(p).condition=taicpu(hp1).condition) and
  485. { first instruction might not change the register used as base }
  486. ((taicpu(hp1).oper[1]^.ref^.base=NR_NO) or
  487. not(RegModifiedByInstruction(taicpu(hp1).oper[1]^.ref^.base,p))
  488. ) and
  489. { first instruction might not change the register used as index }
  490. ((taicpu(hp1).oper[1]^.ref^.index=NR_NO) or
  491. not(RegModifiedByInstruction(taicpu(hp1).oper[1]^.ref^.index,p))
  492. ) then
  493. begin
  494. hp3:=tai(p.Previous);
  495. hp5:=tai(p.next);
  496. asml.Remove(p);
  497. { if there is a reg. dealloc instruction associated with p, move it together with p }
  498. { before the instruction? }
  499. while assigned(hp3) and (hp3.typ<>ait_instruction) do
  500. begin
  501. if (hp3.typ=ait_regalloc) and (tai_regalloc(hp3).ratype in [ra_dealloc]) and
  502. RegInInstruction(tai_regalloc(hp3).reg,p) then
  503. begin
  504. hp4:=hp3;
  505. hp3:=tai(hp3.Previous);
  506. asml.Remove(hp4);
  507. list.Concat(hp4);
  508. end
  509. else
  510. hp3:=tai(hp3.Previous);
  511. end;
  512. list.Concat(p);
  513. { after the instruction? }
  514. while assigned(hp5) and (hp5.typ<>ait_instruction) do
  515. begin
  516. if (hp5.typ=ait_regalloc) and (tai_regalloc(hp5).ratype in [ra_dealloc]) and
  517. RegInInstruction(tai_regalloc(hp5).reg,p) then
  518. begin
  519. hp4:=hp5;
  520. hp5:=tai(hp5.next);
  521. asml.Remove(hp4);
  522. list.Concat(hp4);
  523. end
  524. else
  525. hp5:=tai(hp5.Next);
  526. end;
  527. asml.Remove(hp1);
  528. {$ifdef DEBUG_PREREGSCHEDULER}
  529. asml.InsertBefore(tai_comment.Create(strpnew('Rescheduled')),hp2);
  530. {$endif DEBUG_PREREGSCHEDULER}
  531. asml.InsertBefore(hp1,hp2);
  532. asml.InsertListBefore(hp2,list);
  533. end;
  534. p := tai(p.next)
  535. end;
  536. list.Free;
  537. end;
  538. procedure TCpuThumb2AsmOptimizer.PeepHoleOptPass2;
  539. begin
  540. { TODO: Add optimizer code }
  541. end;
  542. begin
  543. casmoptimizer:=TCpuAsmOptimizer;
  544. cpreregallocscheduler:=TCpuPreRegallocScheduler;
  545. End.