<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 07/14/2015 09:09 PM, Eric
      Christopher wrote:<br>
    </div>
    <blockquote
cite="mid:CALehDX6ppShdrnYzobw0hfn6W0=1zDYSj_kxjbht2+P6pw6qgg@mail.gmail.com"
      type="cite">
      <div dir="ltr"><br>
        <br>
        <div class="gmail_quote">
          <div dir="ltr">On Tue, Jul 14, 2015 at 9:01 PM Philip Reames
            <<a moz-do-not-send="true"
              href="mailto:listmail@philipreames.com">listmail@philipreames.com</a>>
            wrote:<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000">
              <div>On 07/14/2015 05:07 PM, Pete Cooper wrote:<br>
              </div>
              <blockquote type="cite"> <br>
                <div>
                  <blockquote type="cite">
                    <div>On Jul 14, 2015, at 4:48 PM, Reid Kleckner <<a
                        moz-do-not-send="true"
                        href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>>
                      wrote:</div>
                    <br>
                    <div>
                      <div dir="ltr">This sounds more like a use case
                        for metadata. Can we attach metadata to function
                        arguments, or does that not work currently?</div>
                    </div>
                  </blockquote>
                  We can’t, no.</div>
                <div><br>
                </div>
                <div>I have an out of tree patch which allows metadata
                  in AttributeSets.  This would also potentially also
                  work here.</div>
                <div><br>
                </div>
                <div>However, depending on the number of unique
                  strings/metadata in AttributeSets, this could get
                  large.  I don’t think we’ve ever had more that a few
                  unique AttributeSets in an entire module.  If you have
                  too many different strings then you could have a
                  significant number of sets which could get slow.</div>
                <div><br>
                </div>
                <div>Metadata attached to the function or the function
                  arguments is likely to scale better than
                  strings/metadata in the AttributeSets, but I guess it
                  all depends on whether many are even needed.</div>
              </blockquote>
            </div>
            <div bgcolor="#FFFFFF" text="#000000"> As far as I can tell,
              the string attributes on function parameters is already
              "supposed to work".  We support it in bytecode.  We even
              support serialization of the attributes.  It's just the
              parsing that's broken.  I don't have any problem with an
              eventual move towards supporting metadata on arguments,
              but does anyone object to landing the current patches? 
              Whether we believe that the use case motivating the patch
              is better represented by metadata or not, having the
              deserialization support seems like a clear improvement.  <br>
              <br>
              As a side note, I can't find any mention of the string
              attribute functionality in the LangRef or ExtendingLLVM. 
              Seems like it might be time to add something about the
              capability for extension.  We should probably also
              *explicitly* reserve the entire namespace of possible
              keywords for future LLVM in tree enhancements.  <br>
            </div>
            <div bgcolor="#FFFFFF" text="#000000"> <br>
            </div>
          </blockquote>
          <div><br>
          </div>
          <div>So as far as the attribute versus metadata question here
            I don't have a particular care whether or not we support
            attributes on any particular thing in the Value hierarchy.
            As far as your particular case I really only have one
            question: are the attributes needed for correctness or for
            optimization? If they're the latter they should probably be
            metadata, the former then attributes seem to make the best
            sense.</div>
        </div>
      </div>
    </blockquote>
    For the particular use case we have, metadata on arguments would be
    a better semantic fit.  It's a pure optimization hint.  Having said
    that, attributes work just fine in practice as well.  <br>
    <blockquote
cite="mid:CALehDX6ppShdrnYzobw0hfn6W0=1zDYSj_kxjbht2+P6pw6qgg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_quote">
          <div><br>
          </div>
          <div>Mostly just trying to see about you getting the right
            fixes in for the support you need and the rest of us not
            having to worry about not breaking things that no one cares
            about :)</div>
        </div>
      </div>
    </blockquote>
    Let me restate my previous comment: Having support for custom
    attributes on function arguments is generally useful for external
    users of LLVM.  Whether it is ideal in this particular case is not
    really relevant.  There are certainly reasonable cases where using a
    target/environment specific attribute to effect call lowering makes
    perfect sense.  It seems desireable to be able to prototype these
    quickly so that they can mature and (possibly) make it upstream.  <br>
    <br>
    My view is that we *already* support these attributes.  I don't have
    an example user, but it really wouldn't surprise me if folks were
    using this functionality already.  Everything works if generated
    through the C++ APIs or read from bitcode.  It's only the
    deserialization parts that break.  In particular, you can have a
    working compiler which generates output which isn't parseable by
    LLVM's existing tools.  That's not exactly a good state to be in.  <br>
    <br>
    <blockquote
cite="mid:CALehDX6ppShdrnYzobw0hfn6W0=1zDYSj_kxjbht2+P6pw6qgg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_quote">
          <div><br>
          </div>
          <div>-eric</div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div> </div>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000"> Philip</div>
            <div bgcolor="#FFFFFF" text="#000000"><br>
              <blockquote type="cite">
                <div>
                  <blockquote type="cite">
                    <div>
                      <div class="gmail_extra"><br>
                        <div class="gmail_quote">On Mon, Jul 13, 2015 at
                          7:42 AM, Artur Pilipenko <span dir="ltr"><<a
                              moz-do-not-send="true"
                              href="mailto:apilipenko@azulsystems.com"
                              target="_blank">apilipenko@azulsystems.com</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"> Hi,
                              <div><br>
                                <div><span>
                                    <blockquote type="cite">
                                      <div>On 13 Jul 2015, at 15:59, Hal
                                        Finkel <<a
                                          moz-do-not-send="true"
                                          href="mailto:hfinkel@anl.gov"
                                          target="_blank">hfinkel@anl.gov</a>>

                                        wrote:</div>
                                      <br>
                                      <div><span
style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">-----
                                          Original Message -----</span><br
style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
                                        <blockquote type="cite"
style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
                                          From: "Artur Pilipenko" <<a
                                            moz-do-not-send="true"
                                            href="mailto:apilipenko@azulsystems.com"
                                            target="_blank">apilipenko@azulsystems.com</a>><br>
                                          To:<span> </span><a
                                            moz-do-not-send="true"
                                            href="mailto:llvmdev@cs.uiuc.edu"
                                            target="_blank">llvmdev@cs.uiuc.edu</a><br>
                                          Cc: "Hal Finkel" <<a
                                            moz-do-not-send="true"
                                            href="mailto:hfinkel@anl.gov"
                                            target="_blank">hfinkel@anl.gov</a>><br>
                                          Sent: Monday, July 13, 2015
                                          6:45:35 AM<br>
                                          Subject: String attributes for
                                          function arguments and return
                                          values<br>
                                          <br>
                                          Hi,<br>
                                          <br>
                                          I’d like to support string
                                          attributes on function
                                          arguments and<br>
                                          return values. We are going to
                                          use them in our tree to
                                          express<br>
                                          higher level language types.<br>
                                        </blockquote>
                                        <br
style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
                                        <span
style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">How
                                          do you expect to use this
                                          information? Will you need the
                                          inliner to do something
                                          special with these?</span><br
style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
                                      </div>
                                    </blockquote>
                                  </span> Type information is required
                                  for Java specific optimizations, like
                                  devirtualization, subtype check
                                  optimizations, etc. There are no plans
                                  to upstream them, because they are too
                                  specific to Java.</div>
                                <div><br>
                                </div>
                                <div>W.r.t inlining I don’t think that
                                  these attributes will require any
                                  special handling.</div>
                                <span><font color="#888888">
                                    <div><br>
                                    </div>
                                  </font></span>
                                <div><span><font color="#888888">Artur</font></span>
                                  <div>
                                    <div><br>
                                      <blockquote type="cite">
                                        <div><br
style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
                                          <span
style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">Thanks
                                            again,</span><br
style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
                                          <span
style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">Hal</span><br
style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
                                          <br
style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
                                          <blockquote type="cite"
style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
                                            <br>
                                            Internally attributes
                                            framework have everything to
                                            do this, it’s even<br>
                                            possible to generate string
                                            attributes via API right
                                            now:<br>
                                            Function *function;<br>
function->setAttributes(function->getAttributes().addAttribute(context,<br>
                                            i, "attribute"));<br>
                                            But because it’s not
                                            supported in LLParser if you
                                            dump the function<br>
                                            and try to parse it back it
                                            will fail. I have a patch to
                                            fix this<br>
                                            problem:<br>
                                            <a moz-do-not-send="true"
href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D11058&d=AwMGaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=QxcZ1dQY-4Fptsg8J_QZvUH5zX3_zJfFtYe_mFFV434&s=yDXYh5H5eycn3Yn6A7bDimwo8jVbqaGav2FdRRIz0lg&e="
                                              target="_blank">http://reviews.llvm.org/D11058</a><br>
                                            I consider this part as a
                                            bug fix for existing
                                            functionality.<br>
                                            <br>
                                            The second patch is to add
                                            accessors to string
                                            attributes to Argument<br>
                                            and Function classes:<br>
                                            <a moz-do-not-send="true"
href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D10872&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=x-SxyqtoLVC9ndWtSNBJBeyYQml3MZ2Ch4L_B4Hc3Yg&s=a-NOt0poEqPq0I1bAMlsGTKRbxjviviAhMjJ41PNN2Y&e="
                                              target="_blank">http://reviews.llvm.org/D10872</a><br>
                                            This part is optional
                                            because there no code in
                                            upstream will make use<br>
                                            of it. But if we support
                                            string attributes syntax it
                                            makes sense to<br>
                                            provide API support as well.<br>
                                            <br>
                                            Does anyone have any
                                            objections?<br>
                                            <br>
                                            Thanks,<br>
                                            Artur<br>
                                            <br>
                                            <br>
                                            <br>
                                          </blockquote>
                                          <br
style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
                                          <span
style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">--<span> </span></span><br
style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
                                          <span
style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">Hal
                                            Finkel</span><br
style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
                                          <span
style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">Assistant
                                            Computational Scientist</span><br
style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
                                          <span
style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">Leadership
                                            Computing Facility</span><br
style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
                                          <span
style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">Argonne
                                            National Laboratory</span></div>
                                      </blockquote>
                                    </div>
                                  </div>
                                </div>
                                <br>
                              </div>
                            </div>
                            <br>
_______________________________________________<br>
                            LLVM Developers mailing list<br>
                            <a moz-do-not-send="true"
                              href="mailto:LLVMdev@cs.uiuc.edu"
                              target="_blank">LLVMdev@cs.uiuc.edu</a>   
                                 <a moz-do-not-send="true"
                              href="http://llvm.cs.uiuc.edu/"
                              rel="noreferrer" target="_blank">http://llvm.cs.uiuc.edu</a><br>
                            <a moz-do-not-send="true"
                              href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev"
                              rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
                            <br>
                          </blockquote>
                        </div>
                        <br>
                      </div>
                      _______________________________________________<br>
                      LLVM Developers mailing list<br>
                      <a moz-do-not-send="true"
                        href="mailto:LLVMdev@cs.uiuc.edu"
                        target="_blank">LLVMdev@cs.uiuc.edu</a>         <a
                        moz-do-not-send="true"
                        href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
                      <a moz-do-not-send="true"
                        href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev"
                        target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
                    </div>
                  </blockquote>
                </div>
                <br>
                <br>
                <fieldset></fieldset>
                <br>
                <pre>_______________________________________________
LLVM Developers mailing list
<a moz-do-not-send="true" href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a moz-do-not-send="true" href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a>
<a moz-do-not-send="true" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
              </blockquote>
              <br>
            </div>
            _______________________________________________<br>
            LLVM Developers mailing list<br>
            <a moz-do-not-send="true" href="mailto:LLVMdev@cs.uiuc.edu"
              target="_blank">LLVMdev@cs.uiuc.edu</a>         <a
              moz-do-not-send="true" href="http://llvm.cs.uiuc.edu"
              rel="noreferrer" target="_blank">http://llvm.cs.uiuc.edu</a><br>
            <a moz-do-not-send="true"
              href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev"
              rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
          </blockquote>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>