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

            Bug ID: 51974
           Summary: compiler crash when optimizing multiple _mm_hsub_epi16
                    intrinsics in certain pattern
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected],
                    [email protected]

Created attachment 25294
  --> https://bugs.llvm.org/attachment.cgi?id=25294&action=edit
Compiler output with error log/callstack

I ran into a compiler crash when compiling some SSE code. It appears to stem
from optimizing a specific dataflow for some intrinsics, which causes the DAG
to have cycles. A debug build asserts, while a release build infinitely loops.

The following is a minimal repro example:

#include <immintrin.h>
__m128i do_stuff(__m128i A) {
        __m128i B = _mm_hadd_epi16(A, A);
        __m128i C = _mm_hadd_epi16(B, A);
        return C;
}

when compiled with `clang -O1 -msse4` it exhibits the issue. It also appears to
repro if both intrinsics are changed to one of _mm_hadd_epi32, _mm_hsub_epi16,
or _mm_hsub_epi32. It does not repro with -O0.

I've attached the error output I get from the compiler showing more details
including the state of the DAG and a callstack

I tested this on trunk at commit 9820dd970c1b72c7f77fad647b762053e2f60e31 and
confirmed it's still present. It happens both on Windows and Linux.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to