<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 - SROA emits too small debug fragments for padded types (e.g. long double on x86)"
   href="https://bugs.llvm.org/show_bug.cgi?id=37222">37222</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>SROA emits too small debug fragments for padded types (e.g. long double on x86)
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </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>david.stenberg@ericsson.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=20218" name="attach_20218" title="IR reproducer.">attachment 20218</a> <a href="attachment.cgi?id=20218&action=edit" title="IR reproducer.">[details]</a></span>
IR reproducer.

When running SROA on the attached reproducer, the pass emits 80-bit wide
fragments for the long double elements, that are aligned to 128 bits.
As the alignment is included in the long double's DW_AT_byte_size size,
the fragments should also include it.

Can be reproduced using:

  $ opt -sroa -S -o - sroa.ll | grep fragment
  call void @llvm.dbg.value(metadata x86_fp80 %0, metadata !28, metadata
!DIExpression(DW_OP_LLVM_fragment, 0, 80)), !dbg !32
  call void @llvm.dbg.value(metadata x86_fp80 %1, metadata !28, metadata
!DIExpression(DW_OP_LLVM_fragment, 128, 80)), !dbg !32

A similar change was made to GlobalOpt in: <a href="https://reviews.llvm.org/D42807">https://reviews.llvm.org/D42807</a>.
However, in this case I'm not sure how SROA should distinguish the cases where
you want the padding to be included in the fragment, and the cases where it
should be omitted (e.g. <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - "fragment is larger than or outside of variable" error in Windows selfhost build"
   href="show_bug.cgi?id=35447">https://bugs.llvm.org/show_bug.cgi?id=35447</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>