I have two questions regarding MachineMemOperands and dependence information.<br><br>Q1) I noticed that MachineMemOperands are lost when two LDRs are combined and a LDRD is generated in ARMPreAllocLoadStoreOpt:::RescheduleOps.<br>
<br>(before optimization)<br>%reg1033<def> = LDR %reg1030, %reg0, 4100, pred:14, pred:%reg0; mem:LD4[%uglygep10]<br>%reg1054<def> = LDR %reg1030, %reg0, 4104, pred:14, pred:%reg0; mem:LD4[%uglygep2021]<br><br>
(after optimization)<br>%reg1054<def>, %reg1033<def> = LDRD %reg1030, %reg0, 264, pred:14, pred:%reg0<br><br>Are there any reasons they need to be removed?<br>Would it break something if both MachineMemOperands were added to the newly generated instruction? <br>
<br>(after optimization)<br>%reg1054<def>, %reg1033<def> = LDRD %reg1030, %reg0, 264, pred:14, pred:%reg0; mem:LD4[%uglygep10], mem:LD4[%uglygep2021]<br> 
<br>Q2) If a pass generates new instructions and it is not possible to add MachineMemOperands in a way that correctly reflects dependence information, should the MachineMemOperands be removed altogether? The pass I am writing does something similar to loop unrolling and replicates and reorders existing instructions. <br>
<br>For example, a single load instruction could be replicated three times.<br>(before transformation)<br>%reg1033<def> = LDR %reg1030, %reg0, 4100, pred:14, pred:%reg0; mem:LD4[%uglygep10]<br>

<br>(after transformation)<br>%reg1043<def> = LDR %reg1040, %reg0, 4100, pred:14, pred:%reg0; mem:LD4[%uglygep10]<br>...<br>
%reg1053<def> = LDR %reg1050, %reg0, 4100, pred:14, pred:%reg0; mem:LD4[%uglygep10]<br>...<br>
%reg1063<def> = LDR %reg1060, %reg0, 4100, pred:14, pred:%reg0; mem:LD4[%uglygep10]<br>

<br>In this example, should mem:LD4[%uglygep10] be removed from the three instructions so that passes run later will not use dependence information that is no longer correct?<br><br>Thank you.<br><br>