<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>The representation change seems fine per se, but we still have a
      concern with the 65th attribute increasing the size of the objects
      in question.  Do you have a plan to minimize that impact?</p>
    <p>To be clear, I think the representation change is fine
      regardless.  As one example, we have a bunch of downstream
      attributes, and would happily pay the extra word to integrate them
      cleanly with the built in variety in our downstream code.  I'm
      sure we're not the only ones.</p>
    <p>Philip<br>
    </p>
    <div class="moz-cite-prefix">On 4/4/19 3:38 PM, Snider, Todd via
      llvm-dev wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:19ce1b62c8f242a88a4c932df6f003ff@ti.com">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Word 14 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span
style="font-size:9.0pt;font-family:"Arial","sans-serif";color:black;background:white"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:black;background:white">There
            are two 64-bit bitmasks maintained in </span><a
            href="https://sdocc.itg.ti.com/ui#file:review=11893/version=393846"
            title="Open AttributeImpl.h" moz-do-not-send="true"><span
              style="background:white">AttributeImpl.h</span></a><span
            style="color:black;background:white">:</span><span
            style="color:black"><br>
            <br>
            <span style="background:white">- AvailableFunctionAttrs is
              part of the AttributeListImpl class, and</span><br>
            <span style="background:white">- AvailableAttrs is part of
              the AttributeSetNode class</span><br>
            <br>
            <span style="background:white">Both of these assume that the
              number of available enum attributes is limited to 64. In
              fact, a static_assert in </span></span><a
            href="https://sdocc.itg.ti.com/ui#file:review=11893/version=393848"
            title="Open Attributes.cpp" moz-do-not-send="true"><span
              style="background:white">Attributes.cpp</span></a><span
            style="color:black;background:white"> enforces that the
            number of enum attributes stays at 64 or below. However, the
            bitcode writer and reader don't communicate enum attributes
            via bitmask anymore. Enum attributes are encoded in
            attribute groups.</span><span style="color:black"><br>
            <br>
            <span style="background:white">The AvailableFunctionAttrs
              and AvailableAttrs bitmasks are leftovers that need to be
              updated to remove the limitation on the number of enum
              attributes that can be defined in the Attribute::AttrKind
              enum.</span><br>
            <br>
            <span style="background:white">Per a suggestion that I
              received a while ago from Reid Kleckner (on the llvm-dev
              list), I propose to implement both of these data members
              as std::bitset objects.</span><br>
            <br>
            <span style="background:white">Here are the details for this
              proposed change:</span><br>
            <br>
            <span style="background:white">llvm/lib/IR/</span></span><a
href="https://sdocc.itg.ti.com/ui#file:review=11893/version=393846"
            title="Open AttributeImpl.h" moz-do-not-send="true"><span
              style="background:white">AttributeImpl.h</span></a><span
            style="color:black;background:white">:</span><span
            style="color:black"><br>
            <span style="background:white">- Define AvailableAttrs and
              AvailableFunctionAttrs with type
              std::bitset<AttributeEndAttrKinds> instead of
              uint64_t</span><br>
            <span style="background:white">- Update
              AttributeSetNode::hasAttribute() to use the std::bitset
              test function on AvailableAttrs to check if an enum
              attribute is present</span><br>
            <span style="background:white">- Update
              AttributeListImpl::hasFnAttribute() to use the std::bitset
              test function on AvailableFunctionAttrs to check if an
              enum attribute is present</span><br>
            <br>
            <span style="background:white">llvm/lib/IR/</span></span><a
href="https://sdocc.itg.ti.com/ui#file:review=11893/version=393848"
            title="Open Attributes.cpp" moz-do-not-send="true"><span
              style="background:white">Attributes.cpp</span></a><span
            style="color:black;background:white">:</span><span
            style="color:black"><br>
            <span style="background:white">- Update
              AttributeSetNode::AttributeSetNode() constructor to use
              the std::bitset's set function to initialize
              AvailableAttrs</span><br>
            <span style="background:white">- Update
              AttributeListImpl::AttributeListImpl() constructor to use
              the std::bitset's set function to initialize
              AvailableFunctionAttrs and remove the static_assert that
              enforces an upper limit of 64 on the number of enum
              attributes allowed</span></span><o:p></o:p></p>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
    </blockquote>
  </body>
</html>