<html>
    <head>
      <base href="https://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 --- - X86 scheduler causes mass spill/fills in test/CodeGen/X86/vector-sext.ll after r255761"
   href="https://llvm.org/bugs/show_bug.cgi?id=26091">26091</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>X86 scheduler causes mass spill/fills in test/CodeGen/X86/vector-sext.ll after r255761
          </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>evstupac@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>2 functions affected compiled with "-mtriple=x86_64-unknown-unknown
-mattr=+avx2":

"load_sext_16i1_to_16i16" and "load_sext_32i1_to_32i8"

For example in "load_sext_16i1_to_16i16" before the patch applied compiler do
sign extensions one-by-one and therefore do not need much registers:

        movzwl  (%rdi), %eax  <-----
        movq    %rax, %rcx
        shlq    $54, %rcx
        sarq    $63, %rcx
        movq    %rax, %rdx    <-----
        shlq    $55, %rdx
        sarq    $63, %rdx
        vmovd   %edx, %xmm0
        vpinsrw $1, %ecx, %xmm0, %xmm0
        movq    %rax, %rcx    <-----
        shlq    $53, %rcx
        sarq    $63, %rcx
        vpinsrw $2, %ecx, %xmm0, %xmm0
        ...........

After the patch was applied:
All initializations with %rax are moved to the beginning extending registers
life and therefore overall register pressure: 

        movswq  (%rdi), %rax
        movq    %rax, %rcx
        shlq    $55, %rcx
        sarq    $63, %rcx
        vmovd   %ecx, %xmm0
        movq    %rax, %r8
        movq    %rax, %r10
        movq    %rax, %r11
        movq    %rax, %r14
        movq    %rax, %r15
        movq    %rax, %r9
        movq    %rax, %r12
        movq    %rax, %r13
        movq    %rax, %rbx
        movq    %rax, %rdi
        movq    %rax, %rcx
        movq    %rax, %rdx
        movq    %rax, %rsi
        movsbq  %al, %rbp
        shlq    $54, %rax
        sarq    $63, %rax
        vpinsrw $1, %eax, %xmm0, %xmm0
        shlq    $53, %r8
        sarq    $63, %r8
        vpinsrw $2, %r8d, %xmm0, %xmm0

The applied patch is not related to scheduler and only uncover the issue.
There is no this issue if we pass "-enable-misched=0" option.</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>