<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 7:42 AM, Mehdi Amini <<a href="mailto:mehdi.amini@apple.com" class="">mehdi.amini@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" class=""><div class=""><br class="Apple-interchange-newline">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=""><div class="" style="font-size: 10pt; font-family: Verdana, Geneva, sans-serif;"><blockquote type="cite" class="" style="padding: 0px 0.4em; border-left-color: rgb(16, 16, 255); border-left-width: 2px; border-left-style: solid; margin: 0px;"><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" class="" style="padding: 0px 0.4em; border-left-color: rgb(16, 16, 255); border-left-width: 2px; border-left-style: solid; margin: 0px;"><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<span class="Apple-converted-space"> </span><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 class=""><br class=""></div><div class="">Yes the first operands are the destinations (MI can produce multiple values).</div><div class=""><br class=""></div><div class="">The instruction selector will always use a vreg to select your instruction, you don’t have anything to do.</div><div class="">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 class=""><br class=""></div><div class="">The physical registers that you can see at this point are mainly here to implement the ABI AFAIK.</div></div></div></blockquote><div><br class=""></div><div><br class=""></div></div>I should also add that I don’t know what you’re trying to achieve, but keep in mind that some scheduling and optimizations will run after this point.<div class="">Depending on the end result you are seeking, you might need to your expansion later.</div><div class=""><br class=""></div><div class="">— </div><div class="">Mehdi</div><div class=""><br class=""></div></body></html>