[llvm-bugs] [Bug 35628] New: [SLP] "Replacing out-of-tree value with undef" in SLPVectorizer.cpp

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Dec 11 10:01:55 PST 2017


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

            Bug ID: 35628
           Summary: [SLP] "Replacing out-of-tree value with undef" in
                    SLPVectorizer.cpp
           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 with "Replacing out-of-tree value with undef" assertion in SLP
Vectorizer using debug compiler:

================= nice.c ==============
unsigned int x, y;
void foo(unsigned int*);

int main ()
{
    unsigned int j = 0;
    unsigned int b[27] = {0};
    foo(& j);
    x = b[10];
    for (j = 26; j > 1; j--) 
        x += (b[j]) - (y);
    if (x) 
        x = 0;
    return 0;
}


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

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

>>> clang -O3 -c nice.exe nice.c
clang-6.0: .../llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:3297:
llvm::Value*
llvm::slpvectorizer::BoUpSLP::vectorizeTree(llvm::slpvectorizer::BoUpSLP::ExtraValueToDebugLocsMap&):
Assertion `(getTreeEntry(U) || is_contained(UserIgnoreList, U)) && "Replacing
out-of-tree value with undef"' failed.
#0 0x000000000411f93b llvm::sys::PrintStackTrace(llvm::raw_ostream&)
.../llvm/lib/Support/Unix/Signals.inc:398:0
#1 0x000000000411f9cc PrintStackTraceSignalHandler(void*)
.../llvm/lib/Support/Unix/Signals.inc:462:0
#2 0x000000000411deb2 llvm::sys::RunSignalHandlers()
.../llvm/lib/Support/Signals.cpp:49:0
#3 0x000000000411f2d3 SignalHandler(int)
.../llvm/lib/Support/Unix/Signals.inc:252:0
#4 0x00007f3c68cf15e0 __restore_rt (/lib64/libpthread.so.0+0xf5e0)
#5 0x00007f3c678e31f7 __GI_raise (/lib64/libc.so.6+0x351f7)
#6 0x00007f3c678e48e8 __GI_abort (/lib64/libc.so.6+0x368e8)
#7 0x00007f3c678dc266 __assert_fail_base (/lib64/libc.so.6+0x2e266)
#8 0x00007f3c678dc312 (/lib64/libc.so.6+0x2e312)
#9 0x00000000042a9561
llvm::slpvectorizer::BoUpSLP::vectorizeTree(llvm::MapVector<llvm::Value*,
llvm::SmallVector<llvm::Instruction*, 2u>, llvm::DenseMap<llvm::Value*,
unsigned int, llvm::DenseMapInfo<llvm::Value*>,
llvm::detail::DenseMapPair<llvm::Value*, unsigned int> >,
std::vector<std::pair<llvm::Value*, llvm::SmallVector<llvm::Instruction*, 2u>
>, std::allocator<std::pair<llvm::Value*, llvm::SmallVector<llvm::Instruction*,
2u> > > > >&) .../llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:3292:0
#10 0x00000000042b3778 (anonymous
namespace)::HorizontalReduction::tryToReduce(llvm::slpvectorizer::BoUpSLP&,
llvm::TargetTransformInfo*)
.../llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5331:0
#11 0x00000000042b4c00 tryToVectorizeHorReductionOrInstOperands(llvm::PHINode*,
llvm::Instruction*, llvm::BasicBlock*, llvm::slpvectorizer::BoUpSLP&,
llvm::TargetTransformInfo*, llvm::function_ref<bool (llvm::Instruction*,
llvm::slpvectorizer::BoUpSLP&)>)
.../llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5640:0
#12 0x00000000042b4f75
llvm::SLPVectorizerPass::vectorizeRootInstruction(llvm::PHINode*, llvm::Value*,
llvm::BasicBlock*, llvm::slpvectorizer::BoUpSLP&, llvm::TargetTransformInfo*)
.../llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5698:0
#13 0x00000000042b5b90
llvm::SLPVectorizerPass::vectorizeChainsInBlock(llvm::BasicBlock*,
llvm::slpvectorizer::BoUpSLP&)
.../llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5863:0
#14 0x00000000042ad278 llvm::SLPVectorizerPass::runImpl(llvm::Function&,
llvm::ScalarEvolution*, llvm::TargetTransformInfo*, llvm::TargetLibraryInfo*,
llvm::AAResults*, llvm::LoopInfo*, llvm::DominatorTree*,
llvm::AssumptionCache*, llvm::DemandedBits*, llvm::OptimizationRemarkEmitter*)
.../llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:4211:0
#15 0x00000000042acbca (anonymous
namespace)::SLPVectorizer::runOnFunction(llvm::Function&)
.../llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:4117:0
#16 0x0000000003a074f6 llvm::FPPassManager::runOnFunction(llvm::Function&)
.../llvm/lib/IR/LegacyPassManager.cpp:1520:0
#17 0x0000000003a07689 llvm::FPPassManager::runOnModule(llvm::Module&)
.../llvm/lib/IR/LegacyPassManager.cpp:1541:0
#18 0x0000000003a07a15 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
.../llvm/lib/IR/LegacyPassManager.cpp:1597:0
#19 0x0000000003a08106 llvm::legacy::PassManagerImpl::run(llvm::Module&)
.../llvm/lib/IR/LegacyPassManager.cpp:1700:0
#20 0x0000000003a08347 llvm::legacy::PassManager::run(llvm::Module&)
.../llvm/lib/IR/LegacyPassManager.cpp:1732:0
#21 0x00000000043c107f (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:806:0
#22 0x00000000043c37fe 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:1177:0
#23 0x0000000004eef97d
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
.../llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:294:0
#24 0x0000000005b92250 clang::ParseAST(clang::Sema&, bool, bool)
.../llvm/tools/clang/lib/Parse/ParseAST.cpp:161:0
#25 0x0000000004a0704e clang::ASTFrontendAction::ExecuteAction()
.../llvm/tools/clang/lib/Frontend/FrontendAction.cpp:1000:0
#26 0x0000000004eeda34 clang::CodeGenAction::ExecuteAction()
.../llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:1032:0
#27 0x0000000004a06a8f clang::FrontendAction::Execute()
.../llvm/tools/clang/lib/Frontend/FrontendAction.cpp:901:0
#28 0x00000000049a8390
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
.../llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:992:0
#29 0x0000000004b3f598
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
.../llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:252:0
#30 0x00000000020d88c6 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) .../llvm/tools/clang/tools/driver/cc1_main.cpp:221:0
#31 0x00000000020ce5e4 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef) .../llvm/tools/clang/tools/driver/driver.cpp:309:0
#32 0x00000000020cf26d main .../llvm/tools/clang/tools/driver/driver.cpp:388:0
#33 0x00007f3c678cfc05 __libc_start_main (/lib64/libc.so.6+0x21c05)
#34 0x00000000020cbe69 _start (.../debug_build/bin/clang-6.0+0x20cbe69)
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 x86-64
-dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer
-coverage-notes-file test_dir/nice.gcno -resource-dir
.../debug_build/lib/clang/6.0.0 -c-isystem
.../last_debug/projects/openmp/runtime/src -c-isystem
.../last_release/projects/openmp/runtime/src -c-isystem .../libedit/include
-c-isystem .../last_debug/projects/openmp/runtime/src -c-isystem
.../last_release/projects/openmp/runtime/src -c-isystem .../libedit/include
-c-isystem . -cxx-isystem .../last_debug/projects/openmp/runtime/src
-cxx-isystem .../last_release/projects/openmp/runtime/src -cxx-isystem
.../libedit/include -cxx-isystem .../last_debug/projects/openmp/runtime/src
-cxx-isystem .../last_release/projects/openmp/runtime/src -cxx-isystem
.../libedit/include -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 -O3
-fdebug-compilation-dir test_dir -ferror-limit 19 -fmessage-length 0
-fobjc-runtime=gcc -fdiagnostics-show-option -vectorize-loops -vectorize-slp -o
nice.o -x c nice.c 
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'Function Pass Manager' on module 'nice.c'.
4.      Running pass 'SLP Vectorizer' on function '@main'
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 320346)
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-cbb358.c
clang-6.0: note: diagnostic msg: /tmp/nice-cbb358.sh
clang-6.0: note: diagnostic msg: 

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

-- 
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/20171211/106f9c21/attachment-0001.html>


More information about the llvm-bugs mailing list