[llvm-bugs] [Bug 34699] New: [knl] runfail on release, compfail on debug after "Loop Vectorization" in "X86 DAG->DAG"

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 22 02:44:47 PDT 2017


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

            Bug ID: 34699
           Summary: [knl] runfail on release, compfail on debug after
                    "Loop Vectorization" in "X86 DAG->DAG"
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            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 with runfail on release and compfail on debug with assert
"Index out of range" after "Loop Vectorization" pass on O2, knl :
Here is compfail reproducer:
================= nice.c ==============
typedef struct struct_a
{
    int * buffer_1, * buffer_2, * buffer_3, * buffer_4, * buffer_5, * buffer_6;
    long flag;
    long value;
} A;

typedef struct struct_b
{
    A * begin, * end;
} B;

void foo (B * b)
{
    A * a;
    for (a = b -> begin; a != b -> end; a++)
        if (a -> value)
            a -> flag = 1;
        else
            a -> flag = 0;
}
============================================

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


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

>>> clang -c -march=knl -O2 nice.c
clang-6.0: .../llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1490:
llvm::SDValue llvm::SelectionDAG::getVectorShuffle(llvm::EVT, const
llvm::SDLoc&, llvm::SDValue, llvm::SDValue, llvm::ArrayRef<int>): Assertion
`llvm::all_of(Mask, [&](int M) { return M < (NElts * 2); }) && "Index out of
range"' failed.
#0 0x0000000003f8c931 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
.../llvm/lib/Support/Unix/Signals.inc:398:0
#1 0x0000000003f8c9c2 PrintStackTraceSignalHandler(void*)
.../llvm/lib/Support/Unix/Signals.inc:462:0
#2 0x0000000003f8aeae llvm::sys::RunSignalHandlers()
.../llvm/lib/Support/Signals.cpp:49:0
#3 0x0000000003f8c2c9 SignalHandler(int)
.../llvm/lib/Support/Unix/Signals.inc:252:0
#4 0x00007f64f456d5e0 __restore_rt (/lib64/libpthread.so.0+0xf5e0)
#5 0x00007f64f315f1f7 __GI_raise (/lib64/libc.so.6+0x351f7)
#6 0x00007f64f31608e8 __GI_abort (/lib64/libc.so.6+0x368e8)
#7 0x00007f64f3158266 __assert_fail_base (/lib64/libc.so.6+0x2e266)
#8 0x00007f64f3158312 (/lib64/libc.so.6+0x2e312)
#9 0x0000000004c00db8 llvm::SelectionDAG::getVectorShuffle(llvm::EVT,
llvm::SDLoc const&, llvm::SDValue, llvm::SDValue, llvm::ArrayRef<int>)
.../llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1493:0
#10 0x0000000004b39eb0 (anonymous
namespace)::DAGCombiner::createBuildVecShuffle(llvm::SDLoc const&,
llvm::SDNode*, llvm::ArrayRef<int>, llvm::SDValue, llvm::SDValue, unsigned int)
.../llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:14406:0
#11 0x0000000004b3b054 (anonymous
namespace)::DAGCombiner::reduceBuildVecToShuffle(llvm::SDNode*)
.../llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:14554:0
#12 0x0000000004b3cd3a (anonymous
namespace)::DAGCombiner::visitBUILD_VECTOR(llvm::SDNode*)
.../llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:14751:0
#13 0x0000000004adc5dd (anonymous namespace)::DAGCombiner::visit(llvm::SDNode*)
.../llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1591:0
#14 0x0000000004adc739 (anonymous
namespace)::DAGCombiner::combine(llvm::SDNode*)
.../llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1608:0
#15 0x0000000004adbaa6 (anonymous
namespace)::DAGCombiner::Run(llvm::CombineLevel)
.../llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1456:0
#16 0x0000000004b4e167 llvm::SelectionDAG::Combine(llvm::CombineLevel,
llvm::AAResults*, llvm::CodeGenOpt::Level)
.../llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:17497:0
#17 0x0000000004c47097 llvm::SelectionDAGISel::CodeGenAndEmitDAG()
.../llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:744:0
#18 0x0000000004c468e2
llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction,
true, false, void>, false, true>,
llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, true,
false, void>, false, true>, bool&)
.../llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:666:0
#19 0x0000000004c4becb
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
.../llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1611:0
#20 0x0000000004c455a3
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&)
.../llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:467:0
#21 0x0000000002df0c92 (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
.../llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:178:0
#22 0x000000000346f81f
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
.../llvm/lib/CodeGen/MachineFunctionPass.cpp:62:0
#23 0x00000000038b3b46 llvm::FPPassManager::runOnFunction(llvm::Function&)
.../llvm/lib/IR/LegacyPassManager.cpp:1514:0
#24 0x00000000038b3cd9 llvm::FPPassManager::runOnModule(llvm::Module&)
.../llvm/lib/IR/LegacyPassManager.cpp:1535:0
#25 0x00000000038b4065 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
.../llvm/lib/IR/LegacyPassManager.cpp:1591:0
#26 0x00000000038b4756 llvm::legacy::PassManagerImpl::run(llvm::Module&)
.../llvm/lib/IR/LegacyPassManager.cpp:1694:0
#27 0x00000000038b4997 llvm::legacy::PassManager::run(llvm::Module&)
.../llvm/lib/IR/LegacyPassManager.cpp:1726:0
#28 0x000000000421b491 (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
.../llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:794:0
#29 0x000000000421da93 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
.../llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:1145:0
#30 0x0000000004d275ab
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
.../llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:295:0
#31 0x0000000005994dda clang::ParseAST(clang::Sema&, bool, bool)
.../llvm/tools/clang/lib/Parse/ParseAST.cpp:161:0
#32 0x0000000004842b82 clang::ASTFrontendAction::ExecuteAction()
.../llvm/tools/clang/lib/Frontend/FrontendAction.cpp:1000:0
#33 0x0000000004d253b0 clang::CodeGenAction::ExecuteAction()
.../llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:1025:0
#34 0x00000000048425c3 clang::FrontendAction::Execute()
.../llvm/tools/clang/lib/Frontend/FrontendAction.cpp:901:0
#35 0x00000000047e4cb8
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
.../llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:991:0
#36 0x000000000497922c
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
.../llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:252:0
#37 0x0000000001ff7b45 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) .../llvm/tools/clang/tools/driver/cc1_main.cpp:221:0
#38 0x0000000001fed854 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef) .../llvm/tools/clang/tools/driver/driver.cpp:309:0
#39 0x0000000001fee4dd main .../llvm/tools/clang/tools/driver/driver.cpp:388:0
#40 0x00007f64f314bc05 __libc_start_main (/lib64/libc.so.6+0x21c05)
#41 0x0000000001feb0d9 _start (.../debug_build/bin/clang-6.0+0x1feb0d9)
Stack dump:
0.      Program arguments: .../debug_build/bin/clang-6.0 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name nice.c
-mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu knl
-dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer
-coverage-notes-file .../tests/nice.gcno -resource-dir
.../debug_build/lib/clang/6.0.0 -c-isystem
.../last_debug/projects/openmp/runtime/src -c-isystem . -cxx-isystem
.../last_debug/projects/openmp/runtime/src -cxx-isystem . -internal-isystem
/usr/local/include -internal-isystem .../debug_build/lib/clang/6.0.0/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O2
-fdebug-compilation-dir .../tests -ferror-limit 19 -fmessage-length 189
-fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics
-vectorize-loops -vectorize-slp -o nice.o -x c nice.c
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'nice.c'.
4.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@foo'
clang-6.0: error: unable to execute command: Aborted (core dumped)
clang-6.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 6.0.0 (trunk 313968)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: .../last_debug/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-1a0ee4.c
clang-6.0: note: diagnostic msg: /tmp/nice-1a0ee4.sh
clang-6.0: note: diagnostic msg:

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


>>> clang -c -march=knl -O2 nice.c -mllvm -opt-bisect-limit=53
...
BISECT: running pass (52) Rotate Loops on loop
BISECT: running pass (53) Loop Distribution on function (foo)
BISECT: NOT running pass (54) Loop Vectorization on function (foo)
BISECT: NOT running pass (55) Loop Load Elimination on function (foo)
...
>>> clang -c -march=knl -O2 nice.c -mllvm -opt-bisect-limit=54
...
BISECT: running pass (53) Loop Distribution on function (foo)
BISECT: running pass (54) Loop Vectorization on function (foo)
BISECT: NOT running pass (55) Loop Load Elimination on function (foo)
BISECT: NOT running pass (56) Combine redundant instructions on function (foo)
...
clang-6.0: error: unable to execute command: Aborted (core dumped)
clang-6.0: error: clang frontend command failed due to signal (use -v to see
invocation)
...

Start failing after r311833:
------------------------------------------------------------------------
r311833 | jbhateja | 2017-08-26 21:02:36 +0200 (Sat, 26 Aug 2017) | 15 lines
Changed paths:
   M /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
   M /llvm/trunk/test/CodeGen/X86/shuffle-vs-trunc-512.ll
   M /llvm/trunk/test/CodeGen/X86/vector-shuffle-512-v16.ll
   M /llvm/trunk/test/CodeGen/X86/vector-shuffle-512-v8.ll
   M /llvm/trunk/test/CodeGen/X86/x86-interleaved-access.ll

[DAGCombiner] Extending pattern detection for vector shuffle.

Summary:
If all the operands of a BUILD_VECTOR extract elements from same vector then
split the
vector efficiently based on the maximum vector access index.

This will also fix PR 33784

Reviewers: zvi, delena, RKSimon, thakis

Reviewed By: RKSimon

Subscribers: chandlerc, eladcohen, llvm-commits

Differential Revision: https://reviews.llvm.org/D35788
------------------------------------------------------------------------
Maybe this error is connected with
https://bugs.llvm.org//show_bug.cgi?id=34653,
https://bugs.llvm.org//show_bug.cgi?id=34657 and
https://bugs.llvm.org/show_bug.cgi?id=34698

-- 
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/919b406d/attachment-0001.html>


More information about the llvm-bugs mailing list