<html>
    <head>
      <base href="http://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 --- - Bug in PostRA scheduler on spec2000 255.vortex"
   href="http://llvm.org/bugs/show_bug.cgi?id=20308">20308</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Bug in PostRA scheduler on spec2000 255.vortex
          </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>avolkov.intel@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>hfinkel@anl.gov, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=12766" name="attach_12766" title="test">attachment 12766</a> <a href="attachment.cgi?id=12766&action=edit" title="test">[details]</a></span>
test

There was a regression on 255.vortex when compiling for x86 Silvermont
processor.
It was happenned after the following commit of Hal Finkel:
Author: Hal Finkel <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>>
Date:   Mon Mar 31 23:23:51 2014 +0000

    Move partial/runtime unrolling late in the pipeline

    The generic (concatenation) loop unroller is currently placed early in the
    standard optimization pipeline. This is a good place to perform full
unrolling,
    but not the right place to perform partial/runtime unrolling. However, most
    targets don't enable partial/runtime unrolling, so this never mattered.

    However, even some x86 cores benefit from partial/runtime unrolling of very
    small loops, and follow-up commits will enable this. First, we need to move
    partial/runtime unrolling late in the optimization pipeline (importantly,
this
    is after SLP and loop vectorization, as vectorization can drastically
change
    the size of a loop), while keeping the full unrolling where it is now. This
    change does just that.

    git-svn-id: <a href="https://llvm.org/svn/llvm-project/llvm/trunk@205264">https://llvm.org/svn/llvm-project/llvm/trunk@205264</a>
91177308-0d34-0410-b5e6-96231b3b80d8

The root cause of failure is wrong code after PostRA schedule:
Before PostRA:
        %RAX<def> = MOV64rm %RIP, 1, %noreg, <ga:@Part_Class>[TF=5], %noreg;
mem:LD8[GOT]
        %RDI<def> = KILL %RBP
        CALL64pcrel32 <ga:@Object_NewImage>[TF=6], <regmask>, %RSP<imp-use>,
%RDI<imp-use>, %ESI<imp-use>, %EDX<imp-use>, %ECX<imp-use>, %R8<imp-use,kill>,
%R9<imp-use,kill>, %RSP<imp-def>, %EAX<imp-def>
After PostRA:
        %RDI<def> = MOV64rm %RIP, 1, %noreg, <ga:@Part_Class>[TF=5], %noreg;
mem:LD8[GOT]
        %RDI<def> = KILL %RBP
        CALL64pcrel32 <ga:@Object_NewImage>[TF=6], <regmask>, %RSP<imp-use>,
%RDI<imp-use,kill>, %ESI<imp-use,kill>, %EDX<imp-use,kill>, %ECX<imp-use,kill>,
%R8<imp-use,kill>, %R9<imp-use,kill>, %RSP<imp-def>, %EAX<imp-def>

For some reason PostRA scheduler changes register for MOV64rm from RAX to RDI.
It causes wrong value passed to Object_NewImage call later since KILL
instruction lowered to nothing in assembler.

I attached test.ll file and file with IR, use the following command to
reproduce:
llc -O2 -mcpu=slm -relocation-model=pic test.ll</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>