[llvm-bugs] [Bug 50084] New: Crash when using saturating intrinsics for vectors of i128 on PowerPC

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 22 17:34:14 PDT 2021


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

            Bug ID: 50084
           Summary: Crash when using saturating intrinsics for vectors of
                    i128 on PowerPC
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: PowerPC
          Assignee: unassignedbugs at nondot.org
          Reporter: caleb.zulawski at gmail.com
                CC: llvm-bugs at lists.llvm.org, nemanja.i.ibm at gmail.com

Example: https://gcc.godbolt.org/z/jMqj91oza


IR:

declare <4 x i128> @llvm.sadd.sat.v4i128(<4 x i128> %a, <4 x i128> %b);

define <4 x i128> @sadd(<4 x i128> %a, <4 x i128> %b) local_unnamed_addr {
    %c = call <4 x i128> @llvm.sadd.sat.v4i128(<4 x i128> %a, <4 x i128> %b)
    ret <4 x i128> %c
}


Crash output:

LLVM ERROR: Cannot select: 0x56244a18e1d8: v1i128 = vselect 0x56244a18e8c0,
0x56244a18e170, 0x56244a18e240
  0x56244a18e8c0: v1i128 = bitcast 0x56244a18e858
    0x56244a18e858: v4i32 = xor 0x56244a18ea60, 0x56244a18e2a8
      0x56244a18ea60: v4i32 = bitcast 0x56244a18ee08
        0x56244a18ee08: v2i64 = BUILD_VECTOR 0x56244a1901f8, 0x56244a1901f8
          0x56244a1901f8: i64 = sra 0x56244a18ecd0, Constant:i32<63>
            0x56244a18ecd0: i64 = extract_vector_elt 0x56244a18ec00,
Constant:i64<1>
              0x56244a18ec00: v2i64 = bitcast 0x56244a183118
                0x56244a183118: v1i128,ch = CopyFromReg 0x56244a1832b8:1,
Register:v1i128 %15
                  0x56244a1831e8: v1i128 = Register %15
              0x56244a186308: i64 = Constant<1>
            0x56244a1863d8: i32 = Constant<63>
          0x56244a1901f8: i64 = sra 0x56244a18ecd0, Constant:i32<63>
            0x56244a18ecd0: i64 = extract_vector_elt 0x56244a18ec00,
Constant:i64<1>
              0x56244a18ec00: v2i64 = bitcast 0x56244a183118
                0x56244a183118: v1i128,ch = CopyFromReg 0x56244a1832b8:1,
Register:v1i128 %15
                  0x56244a1831e8: v1i128 = Register %15
              0x56244a186308: i64 = Constant<1>
            0x56244a1863d8: i32 = Constant<63>
      0x56244a18e2a8: v4i32 = bitcast 0x56244a18e378
        0x56244a18e378: v2i64 = BUILD_VECTOR 0x56244a186920, 0x56244a186920
          0x56244a186920: i64 = select_cc 0x56244a18e310, Constant:i32<0>,
Constant:i64<-1>, Constant:i64<0>, setne:ch
            0x56244a18e310: i32 = select_cc 0x56244a186e68, 0x56244a1862a0,
0x56244a18ada0, 0x56244a18af40, seteq:ch
              0x56244a186e68: i64 = extract_vector_elt 0x56244a186d98,
Constant:i64<1>
                0x56244a186d98: v2i64 = bitcast 0x56244a18e240
                  0x56244a18e240: v1i128 = add 0x56244a183a70, 0x56244a183118


                0x56244a186308: i64 = Constant<1>
              0x56244a1862a0: i64 = extract_vector_elt 0x56244a186370,
Constant:i64<1>
                0x56244a186370: v2i64 = bitcast 0x56244a183a70
                  0x56244a183a70: v1i128,ch = CopyFromReg 0x56244a183ce0:1,
Register:v1i128 %11

                0x56244a186308: i64 = Constant<1>
              0x56244a18ada0: i32 = setcc 0x56244a186e00, 0x56244a186238,
setult:ch
                0x56244a186e00: i64 = extract_vector_elt 0x56244a186d98,
Constant:i64<0>
                  0x56244a186d98: v2i64 = bitcast 0x56244a18e240

                  0x56244a183048: i64 = Constant<0>
                0x56244a186238: i64 = extract_vector_elt 0x56244a186370,
Constant:i64<0>
                  0x56244a186370: v2i64 = bitcast 0x56244a183a70

                  0x56244a183048: i64 = Constant<0>
              0x56244a18af40: i32 = setcc 0x56244a186e68, 0x56244a1862a0,
setlt:ch
                0x56244a186e68: i64 = extract_vector_elt 0x56244a186d98,
Constant:i64<1>
                  0x56244a186d98: v2i64 = bitcast 0x56244a18e240

                  0x56244a186308: i64 = Constant<1>
                0x56244a1862a0: i64 = extract_vector_elt 0x56244a186370,
Constant:i64<1>
                  0x56244a186370: v2i64 = bitcast 0x56244a183a70

                  0x56244a186308: i64 = Constant<1>
            0x56244a18bee8: i32 = Constant<0>
            0x56244a183d48: i64 = Constant<-1>
            0x56244a183048: i64 = Constant<0>
          0x56244a186920: i64 = select_cc 0x56244a18e310, Constant:i32<0>,
Constant:i64<-1>, Constant:i64<0>, setne:ch
            0x56244a18e310: i32 = select_cc 0x56244a186e68, 0x56244a1862a0,
0x56244a18ada0, 0x56244a18af40, seteq:ch
              0x56244a186e68: i64 = extract_vector_elt 0x56244a186d98,
Constant:i64<1>
                0x56244a186d98: v2i64 = bitcast 0x56244a18e240
                  0x56244a18e240: v1i128 = add 0x56244a183a70, 0x56244a183118


                0x56244a186308: i64 = Constant<1>
              0x56244a1862a0: i64 = extract_vector_elt 0x56244a186370,
Constant:i64<1>
                0x56244a186370: v2i64 = bitcast 0x56244a183a70
                  0x56244a183a70: v1i128,ch = CopyFromReg 0x56244a183ce0:1,
Register:v1i128 %11

                0x56244a186308: i64 = Constant<1>
              0x56244a18ada0: i32 = setcc 0x56244a186e00, 0x56244a186238,
setult:ch
                0x56244a186e00: i64 = extract_vector_elt 0x56244a186d98,
Constant:i64<0>
                  0x56244a186d98: v2i64 = bitcast 0x56244a18e240

                  0x56244a183048: i64 = Constant<0>
                0x56244a186238: i64 = extract_vector_elt 0x56244a186370,
Constant:i64<0>
                  0x56244a186370: v2i64 = bitcast 0x56244a183a70

                  0x56244a183048: i64 = Constant<0>
              0x56244a18af40: i32 = setcc 0x56244a186e68, 0x56244a1862a0,
setlt:ch
                0x56244a186e68: i64 = extract_vector_elt 0x56244a186d98,
Constant:i64<1>
                  0x56244a186d98: v2i64 = bitcast 0x56244a18e240

                  0x56244a186308: i64 = Constant<1>
                0x56244a1862a0: i64 = extract_vector_elt 0x56244a186370,
Constant:i64<1>
                  0x56244a186370: v2i64 = bitcast 0x56244a183a70

                  0x56244a186308: i64 = Constant<1>
            0x56244a18bee8: i32 = Constant<0>
            0x56244a183d48: i64 = Constant<-1>
            0x56244a183048: i64 = Constant<0>
  0x56244a18e170: v1i128 = vselect 0x56244a18eb98, 0x56244a18b938,
0x56244a18aa60
    0x56244a18eb98: v1i128 = bitcast 0x56244a18eb30
      0x56244a18eb30: v2i64 = BUILD_VECTOR 0x56244a18ed38, 0x56244a18ed38
        0x56244a18ed38: i64 = sra 0x56244a186e68, Constant:i32<63>
          0x56244a186e68: i64 = extract_vector_elt 0x56244a186d98,
Constant:i64<1>
            0x56244a186d98: v2i64 = bitcast 0x56244a18e240
              0x56244a18e240: v1i128 = add 0x56244a183a70, 0x56244a183118
                0x56244a183a70: v1i128,ch = CopyFromReg 0x56244a183ce0:1,
Register:v1i128 %11
                  0x56244a183c10: v1i128 = Register %11
                0x56244a183118: v1i128,ch = CopyFromReg 0x56244a1832b8:1,
Register:v1i128 %15
                  0x56244a1831e8: v1i128 = Register %15
            0x56244a186308: i64 = Constant<1>
          0x56244a1863d8: i32 = Constant<63>
        0x56244a18ed38: i64 = sra 0x56244a186e68, Constant:i32<63>
          0x56244a186e68: i64 = extract_vector_elt 0x56244a186d98,
Constant:i64<1>
            0x56244a186d98: v2i64 = bitcast 0x56244a18e240
              0x56244a18e240: v1i128 = add 0x56244a183a70, 0x56244a183118
                0x56244a183a70: v1i128,ch = CopyFromReg 0x56244a183ce0:1,
Register:v1i128 %11
                  0x56244a183c10: v1i128 = Register %11
                0x56244a183118: v1i128,ch = CopyFromReg 0x56244a1832b8:1,
Register:v1i128 %15
                  0x56244a1831e8: v1i128 = Register %15
            0x56244a186308: i64 = Constant<1>
          0x56244a1863d8: i32 = Constant<63>
    0x56244a18b938: v1i128 = bitcast 0x56244a18b420
      0x56244a18b420: v2f64,ch = PPCISD::XXSWAPD 0x56244a18b8d0:1,
0x56244a18b8d0
        0x56244a18b8d0: v2f64,ch = PPCISD::LXVD2X<(load 16 from constant-pool)>
0x56244a13aae8, 0x56244a18aac8
          0x56244a18aac8: i64,ch = PPCISD::TOC_ENTRY<(load 8 from got)>
TargetConstantPool:i64<<2 x i64> <i64 -1, i64 9223372036854775807>> 0,
Register:i64 $x2
            0x56244a18ba08: i64 = TargetConstantPool<<2 x i64> <i64 -1, i64
9223372036854775807>> 0
            0x56244a183938: i64 = Register $x2
    0x56244a18aa60: v1i128 = bitcast 0x56244a18b488
      0x56244a18b488: v2f64,ch = PPCISD::XXSWAPD 0x56244a1835f8:1,
0x56244a1835f8
        0x56244a1835f8: v2f64,ch = PPCISD::LXVD2X<(load 16 from constant-pool)>
0x56244a13aae8, 0x56244a190260
          0x56244a190260: i64,ch = PPCISD::TOC_ENTRY<(load 8 from got)>
TargetConstantPool:i64<<2 x i64> <i64 0, i64 -9223372036854775808>> 0,
Register:i64 $x2
            0x56244a190ae8: i64 = TargetConstantPool<<2 x i64> <i64 0, i64
-9223372036854775808>> 0
            0x56244a183938: i64 = Register $x2
  0x56244a18e240: v1i128 = add 0x56244a183a70, 0x56244a183118
    0x56244a183a70: v1i128,ch = CopyFromReg 0x56244a183ce0:1, Register:v1i128
%11
      0x56244a183c10: v1i128 = Register %11
    0x56244a183118: v1i128,ch = CopyFromReg 0x56244a1832b8:1, Register:v1i128
%15
      0x56244a1831e8: v1i128 = Register %15
In function: sadd
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace.
Stack dump:
0.      Program arguments: /opt/compiler-explorer/clang-trunk/bin/llc -o
/app/output.s -O0 -march=ppc64le <source>
1.      Running pass 'Function Pass Manager' on module '<source>'.
2.      Running pass 'PowerPC DAG->DAG Pattern Instruction Selection' on
function '@sadd'
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH
or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
/opt/compiler-explorer/clang-trunk/bin/llc(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamEi+0x2c)[0x56244548ed2c]
/opt/compiler-explorer/clang-trunk/bin/llc(_ZN4llvm3sys17RunSignalHandlersEv+0x34)[0x56244548ccb4]
/opt/compiler-explorer/clang-trunk/bin/llc(+0x28d3e23)[0x56244548ce23]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7f477290a3c0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb)[0x7f47723da18b]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x12b)[0x7f47723b9859]
/opt/compiler-explorer/clang-trunk/bin/llc(_ZN4llvm18report_fatal_errorERKNS_5TwineEb+0x96)[0x5624453fb656]
/opt/compiler-explorer/clang-trunk/bin/llc(+0x28427be)[0x5624453fb7be]
/opt/compiler-explorer/clang-trunk/bin/llc(_ZN4llvm16SelectionDAGISel15CannotYetSelectEPNS_6SDNodeE+0x234)[0x5624452d6ce4]
/opt/compiler-explorer/clang-trunk/bin/llc(_ZN4llvm16SelectionDAGISel16SelectCodeCommonEPNS_6SDNodeEPKhj+0x21da)[0x5624452d9e1a]
/opt/compiler-explorer/clang-trunk/bin/llc(+0x1313ca7)[0x562443eccca7]
/opt/compiler-explorer/clang-trunk/bin/llc(_ZN4llvm16SelectionDAGISel22DoInstructionSelectionEv+0x254)[0x5624452d5834]
/opt/compiler-explorer/clang-trunk/bin/llc(_ZN4llvm16SelectionDAGISel17CodeGenAndEmitDAGEv+0x2a6)[0x5624452dd116]
/opt/compiler-explorer/clang-trunk/bin/llc(_ZN4llvm16SelectionDAGISel20SelectAllBasicBlocksERKNS_8FunctionE+0x1d44)[0x5624452e0664]
/opt/compiler-explorer/clang-trunk/bin/llc(+0x2729682)[0x5624452e2682]
/opt/compiler-explorer/clang-trunk/bin/llc(+0x1318936)[0x562443ed1936]
/opt/compiler-explorer/clang-trunk/bin/llc(_ZN4llvm19MachineFunctionPass13runOnFunctionERNS_8FunctionE+0x378)[0x562444990cd8]
/opt/compiler-explorer/clang-trunk/bin/llc(_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE+0x427)[0x562444d82df7]
/opt/compiler-explorer/clang-trunk/bin/llc(_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE+0x31)[0x562444d83511]
/opt/compiler-explorer/clang-trunk/bin/llc(_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE+0x53f)[0x562444d8204f]
/opt/compiler-explorer/clang-trunk/bin/llc(+0x88ec11)[0x562443447c11]
/opt/compiler-explorer/clang-trunk/bin/llc(main+0x3a6)[0x5624433769c6]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7f47723bb0b3]
/opt/compiler-explorer/clang-trunk/bin/llc(_start+0x2a)[0x56244343f9aa]
Compiler returned: 139

-- 
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/20210423/8f256cd0/attachment-0001.html>


More information about the llvm-bugs mailing list