<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 --- - VirtRegMap.cpp should not just remove an identity copy which also has a impl-def of a super-reg"
   href="https://llvm.org/bugs/show_bug.cgi?id=27156">27156</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>VirtRegMap.cpp should not just remove an identity copy which also has a impl-def of a super-reg
          </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>normal
          </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, matze@braunis.de
          </td>
        </tr>

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

VirtRegMap removes identity copies, but that leads to machine-verifier
complaints if there is a def of a super reg as well.

I am not sure what the best fix is, but the patch attached seems to fix this by
transforming the COPY to an IMPLICIT_DEF when there is a def of a super-reg.
The patch assumes (arbitrarily) that there could only be one extra operand -
not sure if this is always true...

./bin/clang -cc1 -triple s390x-ibm-linux -S -disable-free -main-file-name
expr.c -mrelocation-model static -mthread-model posix -fmath-errno
-masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu z13
-momit-leaf-frame-pointer -v -dwarf-column-info -debugger-tuning=gdb  -O3
-ferror-limit 19 -fmessage-length 238 -funroll-loops -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o expr.s -x ir ./expr.bc -mllvm -verify-machineinstrs</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>