[llvm-bugs] [Bug 37499] New: [AVX512] LLVM ERROR: Cannot select: v8i16 = vselect v8i16, v8i16, v8i16

via llvm-bugs llvm-bugs at lists.llvm.org
Thu May 17 06:55:04 PDT 2018


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

            Bug ID: 37499
           Summary: [AVX512] LLVM ERROR: Cannot select: v8i16 = vselect
                    v8i16, v8i16, v8i16
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: ilia.taraban at intel.com
                CC: llvm-bugs at lists.llvm.org

This test fails at "X86 DAG->DAG Instruction Selection" with error "Cannot
select: 0x1ad76e8: v8i16 = vselect 0x1ad7ea0, undef:v8i16, 0x1ad7548" :

================= nice.c ==============
#include <x86intrin.h>

void foo (void)
{
    __m128i x = _mm_setr_epi16(1, 1, 1, 1, 1, 1, 1, 1);
    __m512i y;
    int mask = 0x1;
    x = _mm512_mask_cvtepi64_epi16(x, mask, y);
    goo(x);
}

=======================================

>>> clang -v
clang version 7.0.0 (trunk 332600)
Target: x86_64-unknown-linux-gnu
Thread model: posix
...


>>> clang -c nice.c -O2 -march=knl
fatal error: error in backend: Cannot select: t29: v8i16 = vselect t38,
undef:v8i16, t25
  t38: v8i16 = extract_subvector t37, Constant:i64<0>
    t37: v16i16 = truncate t36
      t36: v16i32 = vselect t32, t34, t35
        t32: v16i1 = insert_subvector undef:v16i1, t19, Constant:i64<0>
          t31: v16i1 = undef
          t19: v8i1 = bitcast Constant:i8<1>
            t5: i8 = Constant<1>
          t30: i64 = Constant<0>
        t34: v16i32 = BUILD_VECTOR Constant:i32<-1>, Constant:i32<-1>,
Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>,
Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>,
Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>,
Constant:i32<-1>, Constant:i32<-1>
          t33: i32 = Constant<-1>
          t33: i32 = Constant<-1>
          t33: i32 = Constant<-1>
          t33: i32 = Constant<-1>
          t33: i32 = Constant<-1>
          t33: i32 = Constant<-1>
          t33: i32 = Constant<-1>
          t33: i32 = Constant<-1>
          t33: i32 = Constant<-1>
          t33: i32 = Constant<-1>
          t33: i32 = Constant<-1>
          t33: i32 = Constant<-1>
          t33: i32 = Constant<-1>
          t33: i32 = Constant<-1>
          t33: i32 = Constant<-1>
          t33: i32 = Constant<-1>
        t35: v16i32 = BUILD_VECTOR Constant:i32<0>, Constant:i32<0>,
Constant:i32<0>, Constant:i32<0>, Constant:i32<0>, Constant:i32<0>,
Constant:i32<0>, Constant:i32<0>, Constant:i32<0>, Constant:i32<0>,
Constant:i32<0>, Constant:i32<0>, Constant:i32<0>, Constant:i32<0>,
Constant:i32<0>, Constant:i32<0>
          t14: i32 = Constant<0>
          t14: i32 = Constant<0>
          t14: i32 = Constant<0>
          t14: i32 = Constant<0>
          t14: i32 = Constant<0>
          t14: i32 = Constant<0>
          t14: i32 = Constant<0>
          t14: i32 = Constant<0>
          t14: i32 = Constant<0>
          t14: i32 = Constant<0>
          t14: i32 = Constant<0>
          t14: i32 = Constant<0>
          t14: i32 = Constant<0>
          t14: i32 = Constant<0>
          t14: i32 = Constant<0>
          t14: i32 = Constant<0>
    t30: i64 = Constant<0>
  t17: v8i16 = undef
  t25: v8i16 = bitcast t24
    t24: v2i64,ch = load<(load 16 from constant-pool)> t0, t27, undef:i64
      t27: i64 = X86ISD::Wrapper TargetConstantPool:i64<<8 x i16> <i16 1, i16
1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>> 0
        t26: i64 = TargetConstantPool<<8 x i16> <i16 1, i16 1, i16 1, i16 1,
i16 1, i16 1, i16 1, i16 1>> 0
      t22: i64 = undef
In function: foo
clang-7: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 7.0.0 (trunk 332600)
Target: x86_64-unknown-linux-gnu
...


Here is IR reproducer:
================= fine.ll =============
define void @foo()#0 {
  %1 = tail call <8 x i16> @llvm.x86.avx512.mask.pmov.qw.512(<8 x i64> undef,
<8 x i16> <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>, i8 1)
  %2 = tail call i32 @goo(<8 x i16> %1)
  ret void
}

declare i32 @goo(<8 x i16>)

declare <8 x i16> @llvm.x86.avx512.mask.pmov.qw.512(<8 x i64>, <8 x i16>, i8)

attributes #0 = { "target-features"="+avx512f" }
=======================================

>>> llc fine.ll
LLVM ERROR: Cannot select: t26: v8i16 = vselect t35, undef:v8i16, t22
  t35: v8i16 = extract_subvector t34, Constant:i64<0>
    t34: v16i16 = truncate t33
      t33: v16i32 = vselect t29, t31, t32
        t29: v16i1 = insert_subvector undef:v16i1, t16, Constant:i64<0>
          t28: v16i1 = undef
          t16: v8i1 = bitcast Constant:i8<1>
            t5: i8 = Constant<1>
          t27: i64 = Constant<0>
        t31: v16i32 = BUILD_VECTOR Constant:i32<-1>, Constant:i32<-1>,
Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>,
Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>,
Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>,
Constant:i32<-1>, Constant:i32<-1>
          t30: i32 = Constant<-1>
          t30: i32 = Constant<-1>
          t30: i32 = Constant<-1>
          t30: i32 = Constant<-1>
          t30: i32 = Constant<-1>
          t30: i32 = Constant<-1>
          t30: i32 = Constant<-1>
          t30: i32 = Constant<-1>
          t30: i32 = Constant<-1>
          t30: i32 = Constant<-1>
          t30: i32 = Constant<-1>
          t30: i32 = Constant<-1>
          t30: i32 = Constant<-1>
          t30: i32 = Constant<-1>
          t30: i32 = Constant<-1>
          t30: i32 = Constant<-1>
        t32: v16i32 = BUILD_VECTOR Constant:i32<0>, Constant:i32<0>,
Constant:i32<0>, Constant:i32<0>, Constant:i32<0>, Constant:i32<0>,
Constant:i32<0>, Constant:i32<0>, Constant:i32<0>, Constant:i32<0>,
Constant:i32<0>, Constant:i32<0>, Constant:i32<0>, Constant:i32<0>,
Constant:i32<0>, Constant:i32<0>
          t11: i32 = Constant<0>
          t11: i32 = Constant<0>
          t11: i32 = Constant<0>
          t11: i32 = Constant<0>
          t11: i32 = Constant<0>
          t11: i32 = Constant<0>
          t11: i32 = Constant<0>
          t11: i32 = Constant<0>
          t11: i32 = Constant<0>
          t11: i32 = Constant<0>
          t11: i32 = Constant<0>
          t11: i32 = Constant<0>
          t11: i32 = Constant<0>
          t11: i32 = Constant<0>
          t11: i32 = Constant<0>
          t11: i32 = Constant<0>
    t27: i64 = Constant<0>
  t14: v8i16 = undef
  t22: v8i16 = bitcast t21
    t21: v2i64,ch = load<(load 16 from constant-pool)> t0, t24, undef:i64
      t24: i64 = X86ISD::Wrapper TargetConstantPool:i64<<8 x i16> <i16 1, i16
1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>> 0
        t23: i64 = TargetConstantPool<<8 x i16> <i16 1, i16 1, i16 1, i16 1,
i16 1, i16 1, i16 1, i16 1>> 0
      t19: i64 = undef
In function: foo

-- 
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/20180517/1cd23628/attachment-0001.html>


More information about the llvm-bugs mailing list