<div dir="ltr"><span style="font-family:arial,helvetica,sans-serif;font-size:13px">I'm trying to insert some instructions before each function calls (before arguments push):</span><br><div><span style="font-family:arial,helvetica,sans-serif;font-size:13px">   lea %EAX, label                      ----- new instructions</span></div><div><span style="font-family:arial,helvetica,sans-serif;font-size:13px">   mov [ESP+stacksize], %EAX  ----- new instructions</span></div><div><span style="font-family:arial,helvetica,sans-serif;font-size:13px">   push arg1</span></div><div><span style="font-family:arial,helvetica,sans-serif;font-size:13px">   push arg2</span></div><div><span style="font-family:arial,helvetica,sans-serif;font-size:13px">   ...</span></div><div><span style="font-family:arial,helvetica,sans-serif;font-size:13px">   push argn</span></div><div><span style="font-family:arial,helvetica,sans-serif;font-size:13px">   call callee_name</span></div><div><span style="font-family:arial,helvetica,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,helvetica,sans-serif;font-size:13px">I am a newbie to LLVM. I tried to use buildMI() to insert the instructions in the lowercall() function. But I couldn't put these instructions in the right positions. Is there a way to locate the position by using MachineBasicBlock iterator?</span></div><div><span style="font-family:arial,helvetica,sans-serif;font-size:13px"><br></span></div><div><div style="font-size:12.8px"><span style="font-family:arial,helvetica,sans-serif;font-size:13px">Any suggestions are appreciated.</span></div><div style="font-size:12.8px"><span style="font-family:arial,helvetica,sans-serif;font-size:13px"><br></span></div><div style="font-size:12.8px"><span style="font-family:arial,helvetica,sans-serif;font-size:13px">Thanks!</span></div></div><div style="font-size:12.8px"><span style="font-family:arial,helvetica,sans-serif;font-size:13px">Shucai</span></div><div><span style="font-family:arial,helvetica,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,helvetica,sans-serif;font-size:13px"><br></span></div></div>