[llvm-bugs] [Bug 45951] New: update_test_checks.py is reusing the same TMP name for overlapping values

via llvm-bugs llvm-bugs at lists.llvm.org
Fri May 15 16:22:34 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=45951

            Bug ID: 45951
           Summary: update_test_checks.py is reusing the same TMP name for
                    overlapping values
           Product: tools
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: support scripts
          Assignee: unassignedbugs at nondot.org
          Reporter: quentin.colombet at gmail.com
                CC: greg.bedwell at sony.com, i at maskray.me,
                    llvm-bugs at lists.llvm.org

Created attachment 23495
  --> https://bugs.llvm.org/attachment.cgi?id=23495&action=edit
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200515/65d90eb2/attachment.html>


More information about the llvm-bugs mailing list