<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000"><blockquote type="cite"><div dir="ltr"><div class="gmail_quote"><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></div><div bgcolor="#FFFFFF" text="#000000">
    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.  </div></blockquote><div><br></div><div>I guess as long as they're not upstreamed you can do whatever you'd like, I'd suggest the metadata though just to keep within the llvm design principles.</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"><blockquote type="cite"><div dir="ltr"><div class="gmail_quote"><div>
          </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></div><div bgcolor="#FFFFFF" text="#000000">
    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></div></blockquote><div><br></div><div>There's a lot of things that are generally useful that we delete. I don't see anything unused in any other way. Bitcode support is a bit more... solid though so removing anything that exists is harder. Misfeatures or things accidentally supported have a tendency to stick around and complicate things.</div><div><br></div><div>That said...</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">
    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></div><div bgcolor="#FFFFFF" text="#000000">
    <br></div></blockquote><div><br></div><div>I don't have a strong opinion here as I said in the first place. If fixing this support is useful then I've no objection.</div><div><br></div><div>-eric</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">
    <blockquote 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 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 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 href="mailto:apilipenko@azulsystems.com" target="_blank">apilipenko@azulsystems.com</a>><br>
                                          To:<span> </span><a href="mailto:llvmdev@cs.uiuc.edu" target="_blank">llvmdev@cs.uiuc.edu</a><br>
                                          Cc: "Hal Finkel" <<a 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 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 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 href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>   
                                 <a href="http://llvm.cs.uiuc.edu/" rel="noreferrer" target="_blank">http://llvm.cs.uiuc.edu</a><br>
                            <a 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 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><br>
                      <a 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 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>
</pre>
              </blockquote>
              <br>
            </div>
            _______________________________________________<br>
            LLVM Developers mailing list<br>
            <a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" rel="noreferrer" target="_blank">http://llvm.cs.uiuc.edu</a><br>
            <a 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>
  </div></blockquote></div></div>