<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 - llvm-mca does not understand x86 zeroing idioms"
   href="https://bugs.llvm.org/show_bug.cgi?id=41982">41982</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>llvm-mca does not understand x86 zeroing idioms
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </td>
        </tr>

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

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

        <tr>
          <th>OS</th>
          <td>All
          </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>llvm-mca
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>brennan.vincent@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>andrea.dibiagio@gmail.com, llvm-bugs@lists.llvm.org, matthew.davis@sony.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This seems similar: <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - [llvm-mca][x86] Teach how to identify optimizable register-register moves and zero-idioms."
   href="show_bug.cgi?id=36671">https://bugs.llvm.org/show_bug.cgi?id=36671</a>

It was marked fixed, but llvm-mca is still not recognizing xor as a zeroing
idiom in this simple test case. Note that the second `divl` has to wait for the
first to finish, despite the outputs being zeroed.


```
~ ❯❯❯ cat asm.s
        xorl %eax, %eax
        xorl %edx, %edx
        divl %edi
~ ❯❯❯ ~/clangmr/bin/llvm-mca -timeline -timeline-max-cycles=200  ~/asm.s       
                                                                               
                            ✘ 130 
<snip>


Timeline view:
                    0123456789          0123456789          0123456789         
0123456789          0123456789          0123456789          0123456789         
0123456789  
Index     0123456789          0123456789          0123456789         
0123456789          0123456789          0123456789          0123456789         
0123456789          01

[0,0]     DeER .    .    .    .    .    .    .    .    .    .    .    .    .   
.    .    .    .    .    .    .    .    .    .    .    .    .    .    .    .   
.    .    ..   xorl     %eax, %eax
[0,1]     DeER .    .    .    .    .    .    .    .    .    .    .    .    .   
.    .    .    .    .    .    .    .    .    .    .    .    .    .    .    .   
.    .    ..   xorl     %edx, %edx
[0,2]    
.DeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeER.
   .    .    .    .    .    .    .    .    .    .    .    .    .    .    .   
..   divl     %edi
[1,0]     .   
.D=======================================================================eER   
.    .    .    .    .    .    .    .    .    .    .    .    .    .    .    ..  
xorl     %eax, %eax
[1,1]     .   
.D=======================================================================eER   
.    .    .    .    .    .    .    .    .    .    .    .    .    .    .    ..  
xorl     %edx, %edx
[1,2]     .    .
D=======================================================================eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeER
  ..   divl     %edi
[2,0]     .    .    .
D==============================================================================================================================================eER
 ..   xorl     %eax, %eax
[2,1]     .    .    .
D==============================================================================================================================================eER
 ..   xorl     %edx, %edx
```</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>