<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 - Wrong tbaa metadata after load store vectorizer due to recent change"
   href="https://bugs.llvm.org/show_bug.cgi?id=35225">35225</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Wrong tbaa metadata after load store vectorizer due to recent change
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>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>mikael.holmen@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=19377" name="attach_19377" title="reproducer">attachment 19377</a> <a href="attachment.cgi?id=19377&action=edit" title="reproducer">[details]</a></span>
reproducer

Reproduce with:
clang -mllvm -disable-llvm-optzns -S -emit-llvm -Xclang -O1 -pedantic tbaa.c -o
tbaa.ll
opt -O1 -load-store-vectorizer -S -o tbaa.opt.ll tbaa.ll
-debug-only=load-store-vectorizer

and then in the tbaa.opt.ll we see that the two stores have been merged to one:

  store <2 x i32> %8, <2 x i32>* %9, align 4, !tbaa !6

but looking at !6 we see

!4 = !{!"omnipotent char", !5, i64 0}
!5 = !{!"Simple C/C++ TBAA"}
!6 = !{!7, !7, i64 0}
!7 = !{!"int", !4, i64 0}

so we say that the merged stores now write a single int?

This started happening recently, after the change r317311:

    [Analysis] Refine matching and merging of TBAA tags

    This patch combines the code that matches and merges TBAA access
    tags. The aim is to simplify future changes and making sure that
    these operations produce consistent results.

    Differential Revision: <a href="https://reviews.llvm.org/D39463">https://reviews.llvm.org/D39463</a>

If reverting r317311 the merged store still get tbaa !6, but now !6 is:

!4 = !{!"omnipotent char", !5, i64 0}
!5 = !{!"Simple C/C++ TBAA"}
!6 = !{!4, !4, i64 0}</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>