<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </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 fails to eliminate alloca"
   href="http://llvm.org/bugs/show_bug.cgi?id=16053">16053</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>SROA fails to eliminate alloca
          </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>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>baldrick@free.fr
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>chandlerc@gmail.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=10535" name="attach_10535" title="testcase .ll">attachment 10535</a> <a href="attachment.cgi?id=10535&action=edit" title="testcase .ll">[details]</a></span>
testcase .ll

SROA fails to eliminate the alloca in this function.  This is the IR produced
for a store to a bitfield of float type (allowed in Ada).  SROA should
understand that bits 0 .. 32 of %.0.load are just the bits of %f, and the other
bits are all undef.

define i64 @bf__w__2(i64 %x.0, float %f) {
entry:
  %0 = alloca i40, align 8
  %1 = trunc i64 %x.0 to i40
  %.0.cast3 = bitcast i40* %0 to float*
  store float %f, float* %.0.cast3, align 8
  %.0.load = load i40* %0, align 8
  %2 = shl i40 %.0.load, 2
  %3 = and i40 %2, 17179869180
  %4 = and i40 %1, -17179869181
  %5 = or i40 %3, %4
  %.0.insert.ext = zext i40 %5 to i64
  ret i64 %.0.insert.ext
}</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>