<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 28, 2015, at 4:02 AM, Jobin, Gaël <<a href="mailto:gael.jobin@switzerlandmail.ch" class="">gael.jobin@switzerlandmail.ch</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" class=""><div style="font-size: 10pt; font-family: Verdana,Geneva,sans-serif" class="">
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0" class="">
<div class="">
<div class="">I think pseudo-instructions should also define isPseudo = 1</div>
</div>
</blockquote>
<div class="">
<div class=""> </div>
<div class="">Ah yes, thank you.</div>
</div>
<div class=""> </div>
<div class="">
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0" class="">
<div class="">I expect that before your custom inserter, the value produced by your pseudo instruction was in a vreg. You just have to reuse this vreg to put the result of your "stuff".</div>
<div class="">If you run llc with —print-before-all, you should be able to see the actual sequence.</div>
</blockquote>
<br class="">
<div class=""> </div>
<div class="">That's exactly my problem. How to know before my custom inserter where the produced value will be? I found some documentation about the x86 target saying that the operand 0 is always the destination value, is it right? Also, sometimes I saw <em class="">getOperand(0).getReg()</em>, but how can I be sure that the destination will be in a vreg? Should I specify it explicitly in the TableGen definition?</div></div></div></div></blockquote><div><br class=""></div><div>Yes the first operands are the destinations (MI can produce multiple values).</div><div><br class=""></div><div>The instruction selector will always use a vreg to select your instruction, you don’t have anything to do.</div><div>The custom inserter is executed before register allocation, and it is the role of the RA to turn the vreg into a physical one, </div><div><br class=""></div><div>The physical registers that you can see at this point are mainly here to implement the ABI AFAIK.</div><div><br class=""></div></div>— <div class="">Mehdi</div><div class=""><br class=""></div></body></html>