<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, May 28, 2016 at 7:46 AM, Mehdi Amini <span dir="ltr"><<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><br><br>Sent from my iPhone</div><span class=""><div><br>On May 27, 2016, at 7:02 PM, vivek pandya <<a href="mailto:vivekvpandya@gmail.com" target="_blank">vivekvpandya@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, May 28, 2016 at 7:29 AM, Matthias Braun <span dir="ltr"><<a href="mailto:matze@braunis.de" target="_blank">matze@braunis.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><span><blockquote type="cite"><div>On May 27, 2016, at 6:55 PM, vivek pandya via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br><div><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, May 28, 2016 at 12:23 AM, vivek pandya<span> </span><span dir="ltr"><<a href="mailto:vivekvpandya@gmail.com" target="_blank">vivekvpandya@gmail.com</a>></span><span> </span>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Sat, May 28, 2016 at 12:21 AM, Mehdi Amini<span> </span><span dir="ltr"><<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>></span><span> </span>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span><br>> On May 27, 2016, at 11:49 AM, vivek pandya <<a href="mailto:vivekvpandya@gmail.com" target="_blank">vivekvpandya@gmail.com</a>> wrote:<br>><br>> Hello Mentors,<br>><br>> I have completed writing simple register mask calculator pass, an immutable pass that stores RegMasks and provides API to query them, and a target specific pass for X86 target which currently iterates through all MI in given MF and if a call instruction is found then it quires for RegMask to Immutable pass and prints which registers are clobbered and preserved as per actual register allocation for callee function.<br>><br>> So now I need to update RegMask for call instruction, so as per our previous discussion on IRC if we add a method to update RegMask, Do we have to do it in target specific way? Is it possible to have RegMask at fixed position in Operands array in MI? Also provide some more details on updating cached RegMask in various other class.<br><br></span>Add a method "setOperandMask()" in class MachineOperand, and then when you find a call you just walk all the operands till you find one which "isRegMask()" at which point you can update it.<br><span><font color="#888888"><br></font></span></blockquote></span><div>Ok.</div></div></div></div></blockquote><div><br></div><div>Is it ok to add "setRegMaskOperand()" in class MI and looping through operands to find RegMask is also included in method ?</div><div>-Vivek</div></div></div></div></div></blockquote><div><br></div></span><div>I expect your code to be the only user of such a function  so I would not add it to MachineInstr but keep the code local in your pass for now (you can add a static helper function in the .cpp file of your pass).</div><span><font color="#888888"><div><br></div></font></span></div></div></blockquote><div>But Operands are private to MI so It should go into MI or some other tricks like Friend Function ?</div></div></div></div></div></blockquote><div><br></div></span><div>Not sure what you mean by private here, can't you iterate the operands?</div><div>I'd expect you to iterate the operands till op->isRegMask() is true, then you just have to update the regmask inside the operand. I think I already pointed you this, what's not working? Why are you trying to find a different solution?</div><div><br></div></div></blockquote><div>I got the previous idea, I just did not see iterators and I just thought to move iteration to find RegMask from user code to MI but now it is clear.  Sorry for that : (</div><div><br></div><div>Vivek</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div></div><div><br></div><div><br></div><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Vivek</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><span><font color="#888888"><div></div><div>- Matthias</div></font></span></div></div></blockquote></div><br></div></div>
</div></blockquote></div></blockquote></div><br></div></div>