<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - AARCH64 ADRP/ADD Code Size Regression between v6 and v7"
   href="https://bugs.llvm.org/show_bug.cgi?id=42373">42373</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>AARCH64 ADRP/ADD Code Size Regression between v6 and v7
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>7.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>rrmills@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=22134" name="attach_22134" title="Example of simple code the reproduces issue">attachment 22134</a> <a href="attachment.cgi?id=22134&action=edit" title="Example of simple code the reproduces issue">[details]</a></span>
Example of simple code the reproduces issue

In developing for an extremely memory-constrained AARCH64 embedded environment,
I noticed a code size regression between versions 6 and 7.  Specifically, I see
the regression when performing accesses into global structures.  

Earlier versions (6 and older) would compile a single ADRP/ADD to the front of
the global struct at the beginning of a function.  Accesses into the structures
would then be LDR/STR with offsets to the original calculated address.

Later versions are doing ADRP/ADD (followed by STR/LDR) combos on every access
into the struct.  

The issue seems to come up in LLC.  The IR produced by versions 6/7/8 seem
fundamentally identical.  Furthermore, I can feed IR generated by llvm 6 into
LLC for versions 6, 7, and 8, and 7/8 produce the larger code.    In all cases
I am compiling with '-Oz'

I have a bit more info in this thread on the llvm mailing list.  I have also
attached a trivial example in which versions 7 and later will produce larger
code than versions 6 and older.

LLVM Mailing list thread:
<a href="http://lists.llvm.org/pipermail/llvm-dev/2019-May/132424.html">http://lists.llvm.org/pipermail/llvm-dev/2019-May/132424.html</a></pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>