<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 - [Subreg liveness] Enabling subreg liveness increases spilling significantly"
   href="https://bugs.llvm.org/show_bug.cgi?id=41342">41342</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[Subreg liveness]  Enabling subreg liveness increases spilling significantly
          </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>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>Register Allocator
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>paulsson@linux.vnet.ibm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, quentin.colombet@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=21715" name="attach_21715" title="unreduced test case, llc input">attachment 21715</a> <a href="attachment.cgi?id=21715&action=edit" title="unreduced test case, llc input">[details]</a></span>
unreduced test case, llc input

I found that the bzip2 benchmark regressed slightly when enabling subreg
liveness due to one particular function (decompress). It seems that for some
reason subreg liveness increases spilling instead of decreasing it:

./bin/llc -mtriple=s390x-linux-gnu -mcpu=z13 ./decompress.ll -o out.s --stats
|& grep spill
   1 regalloc              - Number of rematerialized defs for spilling
   9 regalloc              - Number of spilled snippets
  30 regalloc              - Number of spill slots allocated
  79 regalloc              - Number of spilled live ranges
 128 regalloc              - Number of spills inserted
  21 regalloc              - Number of spills removed

./bin/llc -mtriple=s390x-linux-gnu -mcpu=z13 ./decompress.ll -o out.subr.s 
-systemz-subreg-liveness --stats |& grep spill
   1 regalloc              - Number of rematerialized defs for spilling
  25 regalloc              - Number of spilled snippets
  27 regalloc              - Number of spill slots allocated
 168 regalloc              - Number of spilled live ranges
 173 regalloc              - Number of spills inserted
 149 regalloc              - Number of spills removed

I made a reduced test case also from this file:

./bin/llc -mtriple=s390x-linux-gnu -mcpu=z13 ./tc_decompress_reduced.ll -o
out.subr.s  --stats |& grep spill
  9 regalloc              - Number of spill slots allocated
  9 regalloc              - Number of spilled live ranges
 10 regalloc              - Number of spills inserted

./bin/llc -mtriple=s390x-linux-gnu -mcpu=z13 ./tc_decompress_reduced.ll -o
out.subr.s  -systemz-subreg-liveness --stats |& grep spill
  2 regalloc              - Number of spilled snippets
 11 regalloc              - Number of spill slots allocated
 11 regalloc              - Number of spilled live ranges
 13 regalloc              - Number of spills inserted

I wonder if anyone might be able to help me in understanding why this happens?</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>