<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 - Multiple evaluations of a GEP"
   href="https://bugs.llvm.org/show_bug.cgi?id=51184">51184</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Multiple evaluations of a GEP
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </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>Scalar Optimizations
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>momchil.velikov@arm.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=25056" name="attach_25056" title="test case">attachment 25056</a> <a href="attachment.cgi?id=25056&action=edit" title="test case">[details]</a></span>
test case

In the attached test case there is this instruction

  %h3 = getelementptr inbounds %struct.entry_t, %struct.entry_t* %2, i64
%idxprom, i32 0, i64 0, i32 0

and 12-13 more similar instructions like


   %h3.3 = getelementptr inbounds %struct.entry_t, %struct.entry_t* %2, i64
%idxprom, i32 0, i64 3, i32 0

which begin with the same part `getelementptr inbounds %struct.entry_t,
%struct.entry_t* %2, i64 %idxprom`


When the attached test case is compiled with

`opt  --passes="default<O3>" store.ll -S -o - | lcc`

the output assembly file still contains multiple evaluations of that part, e.g.


        mov     w15, #48
        madd    x15, x9, x15, x8

 ...
        mov     w13, #48
        madd    x13, x9, x13, x8

etc.</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>