<div dir="ltr">I did look at the suggested functions. I am calling those functions on a MachineInstr that I created by hand in my tool.<div><br></div><div>For example, I created an MachineInstr (whose dump is as follows)</div><div>
<p class="gmail-p1"><span class="gmail-s1">(lldb) call mi.dump()</span></p>
<p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space"> </span>MOV32mr %RBP, 1, %noreg, -12, %noreg, %EDI</span></p><p class="gmail-p1">corresponding to </p><p class="gmail-p1">
</p><p class="gmail-p1"><span class="gmail-s1">mov<span class="gmail-Apple-tab-span"> </span>dword ptr [rbp - 12], edi</span></p><p class="gmail-p1"><span class="gmail-s1">
</span></p><p class="gmail-p1"><span class="gmail-s1">I thought a call </span><span style="color:rgb(79,129,135);font-family:Menlo;font-size:11px">subTargetInstrInfo</span><span class="gmail-s1" style="font-family:Menlo;font-size:11px">-></span><span class="gmail-s2" style="font-family:Menlo;font-size:11px">isStoreToStackSlot</span><span class="gmail-s1" style="font-family:Menlo;font-size:11px">(mi, 0); would return true</span></p>
<p class="gmail-p1"><span class="gmail-s1">but X86InstrInfo</span>::isFrameOperand() fails because <span class="gmail-s1" style="font-family:Menlo;font-size:11px">MI.</span><span style="color:rgb(49,89,93);font-family:Menlo;font-size:11px">getOperand</span><span class="gmail-s1" style="font-family:Menlo;font-size:11px">(Op + </span><span class="gmail-s2" style="font-family:Menlo;font-size:11px">X86</span><span class="gmail-s1" style="font-family:Menlo;font-size:11px">::</span><span style="color:rgb(49,89,93);font-family:Menlo;font-size:11px">AddrBaseReg</span><span class="gmail-s1" style="font-family:Menlo;font-size:11px">).</span><span style="color:rgb(49,89,93);font-family:Menlo;font-size:11px">isFI</span><span class="gmail-s1" style="font-family:Menlo;font-size:11px">() fails.</span></p><p class="gmail-p1">May be my construction of the mi (as well as my understanding) is incomplete. </p><p class="gmail-p1">Any additional nudges are very much appreciated.</p><p class="gmail-p1">Thanks!</p>
</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 20, 2017 at 8:41 PM, Craig Topper <span dir="ltr"><<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@gmail.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="ltr">Isn't X86InstrInfo::<wbr>isLoadFromStackSlot and X86InstrInfo::<wbr>isStoreToStackSlot what's you're looking for?</div><div class="gmail_extra"><br clear="all"><div><div class="m_444165267063014381gmail_signature" data-smartmail="gmail_signature">~Craig</div></div>
<br><div class="gmail_quote"><div><div class="h5">On Fri, Oct 20, 2017 at 8:30 PM, Nivas Valli via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><font face="arial, helvetica, sans-serif">Hi,</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><font face="arial, helvetica, sans-serif">I would like to query the X86InstrInfo tables to determine if a given opcode is a load or store from stack. I see functions isFrameLoadOpcode and <span style="color:rgb(0,0,0)">isFrameStoreOpcode in lib/Target/X86/X86InstrInfo.cp<wbr>p that would provide the functionality I am looking for.</span></font><div><font face="arial, helvetica, sans-serif"><span style="color:rgb(0,0,0)"><br></span></font></div><div><font face="arial, helvetica, sans-serif"><span style="color:rgb(0,0,0)">However, these functions are static.</span></font></div><div><font face="arial, helvetica, sans-serif"><span style="color:rgb(0,0,0)"><br></span></font></div><div><font face="arial, helvetica, sans-serif"><span style="color:rgb(0,0,0)">What is the recommended way to perform such queries for a MachineInstr - short of replicating the logic from X86InstrInfo.cpp in my tool that links to llvm libraries?</span></font></div><div><font face="arial, helvetica, sans-serif"><span style="color:rgb(0,0,0)"><br></span></font></div><div><font face="arial, helvetica, sans-serif"><span style="color:rgb(0,0,0)">Thanks,</span></font></div><div><font face="arial, helvetica, sans-serif"><span style="color:rgb(0,0,0)"><br></span></font></div><div><font face="arial, helvetica, sans-serif"><span style="color:rgb(0,0,0)">Bharadwaj</span></font></div><div><font face="arial, helvetica, sans-serif"><span style="color:rgb(0,0,0)"><br></span></font></div></div>
<br></div></div>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>