<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">On Thu, May 17, 2018, 3:31 PM Friedman, Eli <<a href="mailto:efriedma@codeaurora.org">efriedma@codeaurora.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <div class="m_3813065033578595834moz-cite-prefix">On 5/17/2018 12:22 PM, Kenneth Adam
      Miller wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">
        <div class="gmail_extra"><br>
          <div class="gmail_quote">On Thu, May 17, 2018 at 3:09 PM,
            Friedman, Eli <span dir="ltr"><<a href="mailto:efriedma@codeaurora.org" target="_blank" rel="noreferrer">efriedma@codeaurora.org</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 5/17/2018 10:10 AM, Kenneth Adam Miller via
                llvm-dev wrote:<br>
                <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  Hello,<br>
                  <br>
                  <br>
                  I've looked around in the documentation, and I can't
                  see anywhere where there is a backend plugin
                  capability for LLVM. I'd like to be able to get the
                  output of the instruction selector along with the LLVM
                  IR, or perhaps instrument that.<br>
                  <br>
                  <br>
                  Is there any capability to have a backend plugin in
                  LLVM at all?<br>
                </blockquote>
                <br>
              </span>
              It sounds like you want to write a MachineFunctionPass as
              a plugin, and run it in the middle of the pass pipeline of
              an existing backend?  No, there isn't any support for
              that; RegisterStandardPasses only works on IR.<span class="m_3813065033578595834HOEnZb"><font color="#888888"><br>
                  <br>
                  -Eli<br>
                  <br>
                  -- <br>
                  Employee of Qualcomm Innovation Center, Inc.<br>
                  Qualcomm Innovation Center, Inc. is a member of Code
                  Aurora Forum, a Linux Foundation Collaborative Project<br>
                  <br>
                </font></span></blockquote>
          </div>
          <br>
        </div>
        <div class="gmail_extra">Yeah, I just discovered
          MachineFunctionPass. I don't know that I want to run it in the
          middle of the pass pipeline of an existing backend so much as
          I want the desired target to run and then have my machine
          function pass run. If I can get the address of every machine
          instruction I will be very happy.</div>
        <div class="gmail_extra"><br>
        </div>
      </div>
    </blockquote>
    <p>If you're inserting instrumentation, you need to emit the
      instrumented code somehow, which implies the "middle" of the pass
      pipeline of an existing backend (although maybe pretty close to
      the end).  And if you're not inserting instrumentation, I'm not
      sure what you mean by the "address" of an instruction.<br>
    </p>
    <p>-Eli<br>
    </p>
    <pre class="m_3813065033578595834moz-signature" cols="72">-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project</pre></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">By address, I mean the selected location in the binary. I need the ground truth for other static analyses.</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF">
  </div>

</blockquote></div></div></div>