<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 - update_test_checks.py is reusing the same TMP name for overlapping values"
   href="https://bugs.llvm.org/show_bug.cgi?id=45951">45951</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>update_test_checks.py is reusing the same TMP name for overlapping values
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>support scripts
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>quentin.colombet@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>greg.bedwell@sony.com, i@maskray.me, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23495" name="attach_23495" title="Reproducer">attachment 23495</a> <a href="attachment.cgi?id=23495&action=edit" title="Reproducer">[details]</a></span>
Reproducer

I found a bug where the update script will reuse the same temporary name for
two variables that overlap.

Essentially the test case looks like:
tmp1 = …
%1 = …
= %1
= %tmp1

And update_test_checks.py will assign TMP1 to both %1 and %tmp1.

To reproduce:
update_test_checks.py --opt-binary opt wrong_update.orig.ll

Result:
The generated REGEX will have something like:
; CHECK-NEXT:    [[TMP1:%.*]] = call float @eggs(<4 x float>* getelementptr
inbounds ([2 x <4 x float>], [2 x <4 x float>]* @global.5, i32 0, i32 0), <4 x
float>* @global)
<...>
; CHECK-NEXT:    [[TMP1:%.*]] = call i32 @wibble(i16 2, i16 1, i16 -1, i16 0,
i16 20, i16 0, i16 0)
; CHECK-NEXT:    [[TMP4:%.*]] = bitcast i32 [[TMP1]] to <4 x i8>
<...>
; CHECK-NEXT:    [[TMP9:%.*]] = insertelement <4 x float> undef, float
[[TMP1]], i32 0

This is wrong, since the second TMP1 use (happening on the definition of TMP9)
should use the value from the first TMP1.</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>