[llvm-bugs] [Bug 34698] New: [m32][knl] error in backend in "DAG->DAG" after "Unroll loops"

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 22 02:04:11 PDT 2017


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

            Bug ID: 34698
           Summary: [m32][knl] error in backend in "DAG->DAG" after
                    "Unroll loops"
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Windows NT
            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 "fatal error: error in backend: Cannot
select:" after "Unroll loops on loop" on m32 ,O2, knl:

================= nice.c ==============
void foo (int a[], double b[],  int n)
{
    int i;
    for (i = 0; i < n; i++)
        if (b[i] > 0)
            a[i] = 1;
}
============================================

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

>>> clang -m32 -c -O1 -march=knl nice.c

>>> clang -m32 -c -O2 -march=knl nice.c
fatal error: error in backend: Cannot select: 0x1f63c40: v16i1 =
insert_subvector 0x1f62f40, 0x1f63830, Constant:i32<0>
  0x1f62f40: v16i1 = BUILD_VECTOR TargetConstant:i8<0>, TargetConstant:i8<0>,
TargetConstant:i8<0>, TargetConstant:i8<0>, TargetConstant:i8<0>,
TargetConstant:i8<0>, TargetConstant:i8<0>, T
argetConstant:i8<0>, TargetConstant:i8<0>, TargetConstant:i8<0>,
TargetConstant:i8<0>, TargetConstant:i8<0>, TargetConstant:i8<0>,
TargetConstant:i8<0>, TargetConstant:i8<0>, TargetConstant
:i8<0>
    0x1f62e08: i8 = TargetConstant<0>
    0x1f62e08: i8 = TargetConstant<0>
    0x1f62e08: i8 = TargetConstant<0>
    0x1f62e08: i8 = TargetConstant<0>
    0x1f62e08: i8 = TargetConstant<0>
    0x1f62e08: i8 = TargetConstant<0>
    0x1f62e08: i8 = TargetConstant<0>
    0x1f62e08: i8 = TargetConstant<0>
    0x1f62e08: i8 = TargetConstant<0>
    0x1f62e08: i8 = TargetConstant<0>
    0x1f62e08: i8 = TargetConstant<0>
    0x1f62e08: i8 = TargetConstant<0>
    0x1f62e08: i8 = TargetConstant<0>
    0x1f62e08: i8 = TargetConstant<0>
    0x1f62e08: i8 = TargetConstant<0>
    0x1f62e08: i8 = TargetConstant<0>
  0x1f63830: v8i1 = X86ISD::CMPM 0x1f6fa38, 0x1f6a390, Constant:i8<1>
    0x1f6fa38: v8f64 = bitcast 0x1f633b8
      0x1f633b8: 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>
        0x1f6f690: i32 = Constant<0>
        0x1f6f690: i32 = Constant<0>
        0x1f6f690: i32 = Constant<0>
        0x1f6f690: i32 = Constant<0>
        0x1f6f690: i32 = Constant<0>
        0x1f6f690: i32 = Constant<0>
        0x1f6f690: i32 = Constant<0>
        0x1f6f690: i32 = Constant<0>
        0x1f6f690: i32 = Constant<0>
        0x1f6f690: i32 = Constant<0>
        0x1f6f690: i32 = Constant<0>
        0x1f6f690: i32 = Constant<0>
        0x1f6f690: i32 = Constant<0>
        0x1f6f690: i32 = Constant<0>
        0x1f6f690: i32 = Constant<0>
        0x1f6f690: i32 = Constant<0>
    0x1f6a390: v8f64,ch =
load<LD64[%88](align=4)(tbaa=<0x1e47d08>)(alias.scope=<0x1f38d70>)> 0x1f637c8,
0x1f6a328, undef:i32
      0x1f6a328: i32 = add 0x1f6ef40, Constant:i32<448>
        0x1f6ef40: i32 = add 0x1f6f5c0, 0x1f63010
          0x1f6f5c0: i32,ch = CopyFromReg 0x1e8bbb0, Register:i32 %vreg23
            0x1f6f2e8: i32 = Register %vreg23
          0x1f63010: i32 = shl 0x1f6f898, Constant:i8<1>
            0x1f6f898: i32,ch = CopyFromReg 0x1e8bbb0, Register:i32 %vreg5
              0x1f6f0e0: i32 = Register %vreg5
            0x1f6f830: i8 = Constant<1>
        0x1f6a2c0: i32 = Constant<448>
      0x1f6f1b0: i32 = undef
    0x1f6f830: i8 = Constant<1>
  0x1f6f690: i32 = Constant<0>
In function: foo
clang version 6.0.0 (trunk 311833) (llvm/trunk 313740)
Target: i386-unknown-linux-gnu
Thread model: posix
InstalledDir: .../build_release/bin
clang-6.0: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-6.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-6.0: note: diagnostic msg: /tmp/nice-238b57.c
clang-6.0: note: diagnostic msg: /tmp/nice-238b57.sh
clang-6.0: note: diagnostic msg:

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

>>> clang -m32 -c -O2 -march=knl nice.c -mllvm -opt-bisect-limit=60
...
BISECT: running pass (59) Combine redundant instructions on function (foo)
BISECT: running pass (60) Unroll loops on loop
BISECT: NOT running pass (61) Unroll loops on loop
BISECT: NOT running pass (62) Combine redundant instructions on function (foo)
...
>>> clang -m32 -c -O2 -march=knl nice.c -mllvm -opt-bisect-limit=61
...
BISECT: running pass (60) Unroll loops on loop
BISECT: running pass (61) Unroll loops on loop
BISECT: NOT running pass (62) Combine redundant instructions on function (foo)
BISECT: NOT running pass (63) Loop Invariant Code Motion on loop
...
fatal error: error in backend: ...
...

This test starts failing after r306792:
------------------------------------------------------------------------
r306792 | djasper | 2017-06-30 08:32:21 +0200 (Fri, 30 Jun 2017) | 4 lines
Changed paths:
   M /llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
   M
/llvm/trunk/test/Transforms/LoopVectorize/AArch64/loop-vectorization-factors.ll
   M /llvm/trunk/test/Transforms/LoopVectorize/AArch64/reduction-small-size.ll
   M /llvm/trunk/test/Transforms/LoopVectorize/ARM/gcc-examples.ll
   M /llvm/trunk/test/Transforms/LoopVectorize/X86/fp64_to_uint32-cost-model.ll
   M /llvm/trunk/test/Transforms/LoopVectorize/X86/gcc-examples.ll
   M /llvm/trunk/test/Transforms/LoopVectorize/X86/masked_load_store.ll
   M /llvm/trunk/test/Transforms/LoopVectorize/X86/no_fpmath.ll
   M /llvm/trunk/test/Transforms/LoopVectorize/X86/no_fpmath_with_hotness.ll
   M /llvm/trunk/test/Transforms/LoopVectorize/X86/reduction-crash.ll
   M
/llvm/trunk/test/Transforms/LoopVectorize/X86/vectorization-remarks-loopid-dbg.ll
   M /llvm/trunk/test/Transforms/LoopVectorize/X86/vectorization-remarks.ll

Revert "r306473 - re-commit r306336: Enable vectorizer-maximize-bandwidth by
default."

This still breaks PPC tests we have. I'll forward reproduction
instructions to dehao.
------------------------------------------------------------------------
Maybe this error is connected with https://bugs.llvm.org//show_bug.cgi?id=34653
and https://bugs.llvm.org//show_bug.cgi?id=34657

-- 
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/20170922/4f260d12/attachment.html>


More information about the llvm-bugs mailing list