<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 --- - NVPTX: Bad machine code: Reading virtual register without a def" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D24300&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=XxLmIe417Nhbk0Q10jjF6UJz_9d9rQR6xuU4xAxUw_Q&s=JQMf75DN_kBmfzoPkMrzi_JucI2M3K2ornCprH1jEio&e=">24300</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>NVPTX: Bad machine code: Reading virtual register without a def
          </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>Backend: PTX
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>tobias@grosser.es
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>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=14662" name="attach_14662" title="Test case to reproduce the bug">attachment 14662</a> <a href="attachment.cgi?id=14662&action=edit" title="Test case to reproduce the bug">[details]</a></span>
Test case to reproduce the bug

The attached test case fails when running it through llc (243247).

The following error is printed:

----------------------------------------------------------------------
# Machine code for function hoge: Post SSA

BB#0: derived from LLVM BB %bb
    %vreg2<def> = IMOV64i 0; Int64Regs:%vreg2
    CBranch %vreg3<undef>, <BB#6>; Int1Regs:%vreg3
    GOTO <BB#1>
    Successors according to CFG: BB#1(16) BB#6(16)

BB#6: 
    Predecessors according to CFG: BB#0
    %vreg9<def> = COPY %vreg2; Int64Regs:%vreg9,%vreg2
    GOTO <BB#5>
    Successors according to CFG: BB#5

BB#1: derived from LLVM BB %bb1
    Predecessors according to CFG: BB#0
    CBranch %vreg4<undef>, <BB#3>; Int1Regs:%vreg4
    GOTO <BB#2>
    Successors according to CFG: BB#3(16) BB#2(16)

BB#2: derived from LLVM BB %bb2
    Predecessors according to CFG: BB#1 BB#3
    CBranch %vreg7, <BB#4>; Int1Regs:%vreg7
    Successors according to CFG: BB#4(16) BB#7(16)

BB#7: 
    Predecessors according to CFG: BB#2
    %vreg9<def> = COPY %vreg2; Int64Regs:%vreg9,%vreg2
    GOTO <BB#5>
    Successors according to CFG: BB#5

BB#3: derived from LLVM BB %bb3
    Predecessors according to CFG: BB#1
    GOTO <BB#2>
    Successors according to CFG: BB#2(16)

BB#4: derived from LLVM BB %bb5
    Predecessors according to CFG: BB#2
    %vreg9<def> = COPY %vreg2; Int64Regs:%vreg9,%vreg2
    Successors according to CFG: BB#5

BB#5: derived from LLVM BB %bb7
    Predecessors according to CFG: BB#4 BB#5 BB#6 BB#7
    %vreg0<def> = COPY %vreg9<kill>; Int64Regs:%vreg0,%vreg9
    %vreg1<def> = ADDi64ri %vreg0, 1; Int64Regs:%vreg1,%vreg0
    %vreg9<def> = COPY %vreg1; Int64Regs:%vreg9,%vreg1
    GOTO <BB#5>
    Successors according to CFG: BB#5

# End machine code for function hoge.

*** Bad machine code: Reading virtual register without a def ***
- function:    hoge
- basic block: BB#2 bb2 (0x621000005648)
- instruction: CBranch- operand 0:   %vreg7
LLVM ERROR: Found 1 machine code errors.
----------------------------------------------------------------------

The test case has been found by bugpoint while reducing another issue. It would
be great if we could _not_ crash, as this would allow allow me to reduce the
original bug.</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>