[llvm-bugs] [Bug 36865] New: [X86] error in backend: "Cannot select: t203: v8i32 = BUILD_VECTOR MOV32r0:i32, i32" after r327898

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Mar 22 06:52:40 PDT 2018


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

            Bug ID: 36865
           Summary: [X86] error in backend: "Cannot select: t203: v8i32 =
                    BUILD_VECTOR MOV32r0:i32,i32" after r327898
           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 compilation with "Cannot select: t203: v8i32 = BUILD_VECTOR
MOV32r0:i32,i32" in "X86 DAG->DAG Instruction Selection" on haswell:

================= nice.c ==============
unsigned int l, k;
int main () {
  unsigned int i, j, m;
  unsigned int a [40] = {0};
  unsigned int * pl = & l;
  scanf("%u", & m);
  for (i = 1; i < 20; ++i) 
    k += a[i];
  for (j = 38; j > 1; --j) {
    * pl += l;
    a[j] = m - (m * m);
  }
  return 0;
}

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

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

>>> clang nice.c -O2 -march=haswell
fatal error: error in backend: Cannot select: t203: v8i32 = BUILD_VECTOR
MOV32r0:i32,i32, MOV32r0:i32,i32, MOV32r0:i32,i32, MOV32r0:i32,i32,
MOV32r0:i32,i32, MOV32r0:i32,i32,
      MOV32r0:i32,i32, MOV32r0:i32,i32
  t202: i32,i32 = MOV32r0
  t202: i32,i32 = MOV32r0
  t202: i32,i32 = MOV32r0
  t202: i32,i32 = MOV32r0
  t202: i32,i32 = MOV32r0
  t202: i32,i32 = MOV32r0
  t202: i32,i32 = MOV32r0
  t202: i32,i32 = MOV32r0
In function: main
clang-7.0: error: clang frontend command failed with exit code 70 (use -v to
see invocation)
clang version 7.0.0 (trunk 328186)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: .../last_debug/bin
clang-7.0: note: diagnostic msg: PLEASE submit a bug report to
https://bugs.llvm.org/ and include the crash backtrace, preprocessed source,
and associated run script.
clang-7.0: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-7.0: note: diagnostic msg: /tmp/nice-e7c2be.c
clang-7.0: note: diagnostic msg: /tmp/nice-e7c2be.sh
clang-7.0: note: diagnostic msg:

********************


>>> clang nice.c -O2 -march=haswell -mllvm -opt-bisect-limit=-1
BISECT: running pass (102) CodeGen Prepare on function (main)
BISECT: running pass (103) X86 DAG->DAG Instruction Selection on function
(main)
fatal error: error in backend: Cannot select: t203: v8i32 = BUILD_VECTOR
MOV32r0:i32,i32, MOV32r0:i32,i32, MOV32r0:i32,i32, MOV32r0:i32,i32,
MOV32r0:i32,i32, MOV32r0:i32,i32,
      MOV32r0:i32,i32, MOV32r0:i32,i32
  t202: i32,i32 = MOV32r0
...

Here is "small" reproducer for llc:
================= fine.ll =============
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: nounwind uwtable
define void @main() #0 {
entry:
  %k = alloca i32, align 4
  %m = alloca i32, align 4
  %a = alloca [100 x i32], align 16
  %0 = bitcast [100 x i32]* %a to i8*
  call void @llvm.memset.p0i8.i64(i8* nonnull align 16 %0, i8 0, i64 400, i1
false)
  %arrayidx = getelementptr inbounds [100 x i32], [100 x i32]* %a, i64 0, i64
34
  %add = load i32, i32* %k
  %1 = load i32, i32* null
  %2 = load i32, i32* undef
  %3 = load i32, i32* undef
  %4 = load i32, i32* %arrayidx
  %5 = load i32, i32* undef
  %6 = load i32, i32* undef
  %7 = load i32, i32* undef
  %8 = load i32, i32* undef
  %9 = load i32, i32* undef
  %10 = load i32, i32* undef
  %11 = load i32, i32* undef
  %12 = load i32, i32* undef
  %13 = load i32, i32* undef
  %14 = load i32, i32* undef
  %15 = load i32, i32* undef
  %16 = load i32, i32* undef
  %add.1 = add i32 %add, %1
  %add.2 = add i32 %add.1, %2
  %add.3 = add i32 %add.2, %3
  %add.4 = add i32 %add.3, %4
  store i32 %add.4, i32* %k
  %17 = load i32, i32* %m
  %mul = mul i32 %17, %17
  %sub = sub i32 %17, %mul
  store i32 %sub, i32* undef
  unreachable
}

; Function Attrs: argmemonly nounwind
declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1) #1

attributes #0 = { nounwind uwtable "target-features"="+avx" }
attributes #1 = { argmemonly nounwind }
=======================================

>>> llc fine.ll
LLVM ERROR: Cannot select: t75: v8i32 = BUILD_VECTOR MOV32r0:i32,i32,
MOV32r0:i32,i32, MOV32r0:i32,i32, MOV32r0:i32,i32, MOV32r0:i32,i32,
MOV32r0:i32,i32, MOV32r0:i32,i32, MOV32r0:i32,i32
  t74: i32,i32 = MOV32r0
  t74: i32,i32 = MOV32r0
  t74: i32,i32 = MOV32r0
  t74: i32,i32 = MOV32r0
  t74: i32,i32 = MOV32r0
  t74: i32,i32 = MOV32r0
  t74: i32,i32 = MOV32r0
  t74: i32,i32 = MOV32r0
In function: main

This error appears after r327898:
------------------------------------------------------------------------
r327898 | niravd | 2018-03-19 21:19:46 +0100 (Mon, 19 Mar 2018) | 4 lines

[DAG, X86] Revert r327197 "Revert r327170, r327171, r327172"

Reland ISel cycle checking improvements after simplifying node id
invariant traversal and correcting typo.
------------------------------------------------------------------------

-- 
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/20180322/2f35ce65/attachment-0001.html>


More information about the llvm-bugs mailing list