<div dir="ltr">Hello,<div><br></div><div>I have a LLVM backend question regarding how to prevent compiler from reordering instructions. For example, I have the following instructions. Z_instruction is the one which I want to insert. </div><div><br></div><div><br></div><div><span style="background-color:rgb(255,255,0)">// instruction order which I am looking for</span></div><div>/////////////////////////////////////////</div><div>A_instruction</div><div>B_instruction</div><div><br></div><div><b>Z_instruction</b></div><div><br></div><div>C_instruction</div><div>D_instruction</div><div>E_instruction</div><div>F_instruction</div><div><br></div><div><b>Z_instruction</b><br></div><div><br></div><div>G_instruction</div><div>F_instruction</div><div><br></div><div><br></div><div>==================================================</div><div><br></div><div>But I found compiler reordered those instructions like the following. <span style="background-color:rgb(255,255,0)">How could I prevent compiler from moving <b>A_instruction</b> and <b>B_instruction</b> after the first <b>Z_instruction</b>? </span>Any recommendations and suggestion are greatly appreciated here!!!</div><div><br></div><div><div><b>Z_instruction</b></div><div><b><br></b></div><div><div><font color="#ff0000">A_instruction</font></div><div><font color="#ff0000">B_instruction</font></div></div><div><br></div><div>C_instruction</div><div>D_instruction</div><div>E_instruction</div><div>F_instruction</div><div><br></div><div><b>Z_instruction</b><br></div><div><br></div><div>G_instruction</div><div>F_instruction</div></div><div><br></div><div>BTW, I have define input/output chain for : <b>C_instruction, D_instruction, E_instruction, F_instruction and Z_instruction</b></div><div><b><br></b></div><div>Thank you so much!</div><div><div><br></div>-- <br><div class="gmail_signature">Wei Ding<br></div>
</div></div>