<br><br>2016年9月5日星期一,Dean Michael Berris <<a href="mailto:dean.berris@gmail.com">dean.berris@gmail.com</a>> 写道:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> On 5 Sep 2016, at 11:49, SHUCAI YAO <<a href="javascript:;" onclick="_e(event, 'cvml', 'yaos4@mcmaster.ca')">yaos4@mcmaster.ca</a>> wrote:<br>
><br>
> For the function call lowering, do you mean lowercall function? I did insert the instruction before the stack adjustments, but the inserted code appears in the prologue of the function, other than before the function call. Maybe I did something wrong with the iterator.<br>
><br>
> So you mean I should insert a pseudo instruction in the machinefunction pass, then replace it when function call lowering?  (Like segemented stack implementation?)<br>
><br>
<br>
Yes, inserting pseudo instructions in the MachineFunctionPass -- you might want to have a look at PATCHABLE_RET and how we handle this in XRay. Essentially the idea (which I saw Sanjoy Das do first) is to wrap the actual instruction (in this case, CALL or LEA, or something specific in the platform you're targeting) in a pseudo instruction that just lowers to the correct sequence. This gives you complete control of the actual assembly of the instructions that you're replacing.</blockquote><div><br></div><div>Hi Dean,</div><div><br></div><div>Do you have any example for this?  I would like have a look at how you handle this in XRay if it is possible. </div><div><br></div><div>Thank you very much!</div><div>Shucai </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-- Dean</blockquote>