<div dir="ltr"><div><div><div>Respected Dr. Criswell,<br><br></div>My problem is that the output of following code looks nothing like any opcode:<br><br>    <b>for(MachineBasicBlock::iterator I = BB->begin(); I != BB->end(); )<br>    {<br>         MachineInstr *mi = I;<br>         int op = mi->getOpcode();<br>         std::cout << op << '\t';<br>    }</b><br></div><br></div>I need to identify specific instructions in my MachineFunctionPass and I was hoping that I can do that by using <i>getOpcode(). </i>I am kinda stuck at this point. Kindly guide me ! Thank you !<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 2, 2014 at 4:37 PM, John Criswell <span dir="ltr"><<a href="mailto:jtcriswel@gmail.com" target="_blank">jtcriswel@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 bgcolor="#FFFFFF" text="#000000">
    <div>Dear Sachin,<br>
      <br>
      Your description of the problem contains too few details; no one
      will be able to diagnose the problem you're having.  You need to
      provide more information on what, exactly, is not working as you
      expected.<br>
      <br>
      Regards,<br>
      <br>
      John Criswell<div><div class="h5"><br>
      <br>
      On 10/2/14, 5:11 PM, sachin arora wrote:<br>
    </div></div></div>
    <blockquote type="cite"><div><div class="h5">
      <div dir="ltr">
        <div>
          <div>Hello,<br>
            <br>
          </div>
          I am writing a MachineFunctionPass that inspects the generated
          machine code, and examines each opcode and its corresponding
          operands. If the 'instruction + operands' match a particular
          sequence, then the pass should replace them with a fixed
          instruction + operands sequence. I tried using MachineInstr's
          getOpcode and getOperand functions but the pass didn't work as
          expected. <br>
          <br>
        </div>
        Kindly tell me how to proceed or point to appropriate
        references. Thank you !<br clear="all">
        <div>
          <div>
            <div>
              <div>
                <div><br>
                  -- <br>
                  <div dir="ltr">Regards,
                    <div>Sachin</div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>_______________________________________________
LLVM Developers mailing list
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><span class="HOEnZb"><font color="#888888">
</font></span></pre><span class="HOEnZb"><font color="#888888">
    </font></span></blockquote><span class="HOEnZb"><font color="#888888">
    <br>
    <br>
    <pre cols="72">-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a href="http://www.cs.rochester.edu/u/criswell" target="_blank">http://www.cs.rochester.edu/u/criswell</a></pre>
  </font></span></div>

</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Regards,<div>Sachin</div></div>
</div>