<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 6/20/16 11:18 AM, vivek pandya
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAHYgpoKUBqpoKx1LPC50+2yJrXnVkpiB9xwm9CVn+4xcgnxu1g@mail.gmail.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
      <div dir="ltr"><br>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">On Mon, Jun 20, 2016 at 8:42 PM, John
            Criswell <span dir="ltr"><<a moz-do-not-send="true"
                href="mailto:jtcriswel@gmail.com" target="_blank">jtcriswel@gmail.com</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote">
              <div><span class="">
                  <div>On 6/20/16 9:39 AM, vivek pandya via llvm-dev
                    wrote:<br>
                  </div>
                  <blockquote type="cite">
                    <div dir="ltr">Dear Community,
                      <div><br>
                      </div>
                      <div>To improve current interprocedural register
                        allocation (IPRA) , we have planned to set
                        callee saved registers to none for local
                        functions, currently I am doing it in following
                        way:</div>
                      <div><br>
                      </div>
                      <div>if (F->hasLocalLinkage() <span> </span><span>&&
                          !F->hasAddressTaken()</span>) {</div>
                    </div>
                  </blockquote>
                  <br>
                </span> As an aside, you might want to analyze how many
                functions have both local linkage and are not address
                taken.  I recall that many functions returned false for
                hasAddressTaken() because some direct calls casted the
                function to a different function type before calling
                it.  Such functions are still not address taken, but the
                simple hasAddressTaken() method can't determine it.<br>
                <br>
                If you see that happening, you can simply scan through a
                function's def-use chains and see if any "indirect
                calls" are really direct calls that cast the function
                pointer.  I believe SAFECode has some code somewhere
                that does this if you need it.<span class=""><br>
                  <br>
                </span></div>
            </blockquote>
            <div>Dear Professor John,</div>
            <div><br>
            </div>
            <div>Thanks for pointing out this , but I wonder that how
              many such cases may be there on average in a module? Is it
              too frequently seen?</div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    As of 2-3 years ago, I saw this all the time.  It is easy enough to
    write an LLVM pass that iterates through all instructions and counts
    the number of call instructions that case their constant function
    pointer operand, so you can write that pass and see for yourself
    whether it is still an issue.<br>
    <br>
    Regards,<br>
    <br>
    John Criswell<br>
    <p><br>
    </p>
    <pre class="moz-signature" cols="72">-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
  </body>
</html>