Closed gburgessiv closed 6 years ago
rL346589
Forgot to account for legalization of vector types might return a scalar - fix in progress.
not sure if it helped, i tested with O3:
clang -O3 -std=gnu99 -x c -c test5.cc Not a vector MVT! UNREACHABLE executed at /root/llvm/include/llvm/Support/MachineValueType.h:521! Stack dump:
clang-8: error: unable to execute command: Aborted (core dumped) clang-8: error: clang frontend command failed due to signal (use -v to see invocation) clang version 8.0.0 (trunk 346579) (llvm/trunk 346569) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /root/build/bin clang-8: 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-8: note: diagnostic msg:
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang-8: note: diagnostic msg: /tmp/test5-52adf9.c clang-8: note: diagnostic msg: /tmp/test5-52adf9.sh clang-8: note: diagnostic msg:
Extended Description
Bisection pointed to an
unreachable
being hit while we're running the SLP Vectorizer.Repro:
$ $clang -O2 -std=gnu99 -x c repro.c
Full backtrace:
Not a vector MVT! UNREACHABLE executed at ../../include/llvm/Support/MachineValueType.h:521! Stack dump:
0 0x0000000003c8b059 llvm::sys::PrintStackTrace(llvm::raw_ostream&) /path/to/llvm/build/debug/../../lib/Support/Unix/Signals.inc:495:11
1 0x0000000003c8b209 PrintStackTraceSignalHandler(void*) /path/to/llvm/build/debug/../../lib/Support/Unix/Signals.inc:559:1
2 0x0000000003c89486 llvm::sys::RunSignalHandlers() /path/to/llvm/build/debug/../../lib/Support/Signals.cpp:66:5
3 0x0000000003c8b83b SignalHandler(int) /path/to/llvm/build/debug/../../lib/Support/Unix/Signals.inc:358:1
4 0x00007fd5789c50c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x110c0)
5 0x00007fd577770fcf gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x32fcf)
6 0x00007fd5777723fa abort (/lib/x86_64-linux-gnu/libc.so.6+0x343fa)
7 0x0000000003baf170 llvm::install_out_of_memory_new_handler() /path/to/llvm/build/debug/../../lib/Support/ErrorHandling.cpp:193:0
8 0x00000000012a7714 llvm::MVT::getVectorNumElements() const /path/to/llvm/build/debug/../../include/llvm/Support/MachineValueType.h:522:21
9 0x0000000002514144 llvm::X86TTIImpl::getShuffleCost(llvm::TargetTransformInfo::ShuffleKind, llvm::Type, int, llvm::Type) /path/to/llvm/build/debug/../../lib/Target/X86/X86TargetTransformInfo.cpp:878:27
10 0x000000000251cfab llvm::BasicTTIImplBase::getArithmeticReductionCost(unsigned int, llvm::Type*, bool) /path/to/llvm/build/debug/../../include/llvm/CodeGen/BasicTTIImpl.h:1350:35
11 0x0000000002516829 llvm::X86TTIImpl::getArithmeticReductionCost(unsigned int, llvm::Type*, bool) /path/to/llvm/build/debug/../../lib/Target/X86/X86TargetTransformInfo.cpp:2163:3
12 0x000000000250ebd1 llvm::TargetTransformInfo::Model::getArithmeticReductionCost(unsigned int, llvm::Type*, bool) /path/to/llvm/build/debug/../../include/llvm/Analysis/TargetTransformInfo.h:1499:5
13 0x0000000002c5569a llvm::TargetTransformInfo::getArithmeticReductionCost(unsigned int, llvm::Type*, bool) const /path/to/llvm/build/debug/../../lib/Analysis/TargetTransformInfo.cpp:569:7
14 0x0000000003e58cec (anonymous namespace)::HorizontalReduction::getReductionCost(llvm::TargetTransformInfo, llvm::Value, unsigned int) /path/to/llvm/build/debug/../../lib/Transforms/Vectorize/SLPVectorizer.cpp:5861:23
15 0x0000000003e56937 (anonymous namespace)::HorizontalReduction::tryToReduce(llvm::slpvectorizer::BoUpSLP&, llvm::TargetTransformInfo*) /path/to/llvm/build/debug/../../lib/Transforms/Vectorize/SLPVectorizer.cpp:5774:27
16 0x0000000003e52fb2 tryToVectorizeHorReductionOrInstOperands(llvm::PHINode, llvm::Instruction, llvm::BasicBlock, llvm::slpvectorizer::BoUpSLP&, llvm::TargetTransformInfo, llvm::function_ref<bool (llvm::Instruction*, llvm::slpvectorizer::BoUpSLP&)>) /path/to/llvm/build/debug/../../lib/Transforms/Vectorize/SLPVectorizer.cpp:6110:13
17 0x0000000003e52d71 llvm::SLPVectorizerPass::vectorizeRootInstruction(llvm::PHINode, llvm::Value, llvm::BasicBlock, llvm::slpvectorizer::BoUpSLP&, llvm::TargetTransformInfo) /path/to/llvm/build/debug/../../lib/Transforms/Vectorize/SLPVectorizer.cpp:6166:3
18 0x0000000003e4fc55 llvm::SLPVectorizerPass::vectorizeChainsInBlock(llvm::BasicBlock*, llvm::slpvectorizer::BoUpSLP&) /path/to/llvm/build/debug/../../lib/Transforms/Vectorize/SLPVectorizer.cpp:6318:11
19 0x0000000003e4ef13 llvm::SLPVectorizerPass::runImpl(llvm::Function&, llvm::ScalarEvolution, llvm::TargetTransformInfo, llvm::TargetLibraryInfo, llvm::AAResults, llvm::LoopInfo, llvm::DominatorTree, llvm::AssumptionCache, llvm::DemandedBits, llvm::OptimizationRemarkEmitter*) /path/to/llvm/build/debug/../../lib/Transforms/Vectorize/SLPVectorizer.cpp:4645:16
20 0x0000000003e5b074 (anonymous namespace)::SLPVectorizer::runOnFunction(llvm::Function&) /path/to/llvm/build/debug/../../lib/Transforms/Vectorize/SLPVectorizer.cpp:4550:5
21 0x000000000332c3a4 llvm::FPPassManager::runOnFunction(llvm::Function&) /path/to/llvm/build/debug/../../lib/IR/LegacyPassManager.cpp:1644:23
22 0x000000000332c785 llvm::FPPassManager::runOnModule(llvm::Module&) /path/to/llvm/build/debug/../../lib/IR/LegacyPassManager.cpp:1679:16
23 0x000000000332cf97 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /path/to/llvm/build/debug/../../lib/IR/LegacyPassManager.cpp:1744:23
24 0x000000000332ca5b llvm::legacy::PassManagerImpl::run(llvm::Module&) /path/to/llvm/build/debug/../../lib/IR/LegacyPassManager.cpp:1857:16
25 0x000000000332d571 llvm::legacy::PassManager::run(llvm::Module&) /path/to/llvm/build/debug/../../lib/IR/LegacyPassManager.cpp:1888:3
26 0x0000000003fb1c87 (anonymous namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete >) /path/to/llvm/build/debug/../../tools/clang/lib/CodeGen/BackendUtil.cpp:864:3
27 0x0000000003fae9df 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 >) /path/to/llvm/build/debug/../../tools/clang/lib/CodeGen/BackendUtil.cpp:1296:5
28 0x0000000004e91074 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) /path/to/llvm/build/debug/../../tools/clang/lib/CodeGen/CodeGenAction.cpp:293:7
29 0x00000000066ec407 clang::ParseAST(clang::Sema&, bool, bool) /path/to/llvm/build/debug/../../tools/clang/lib/Parse/ParseAST.cpp:177:12
30 0x0000000004878762 clang::ASTFrontendAction::ExecuteAction() /path/to/llvm/build/debug/../../tools/clang/lib/Frontend/FrontendAction.cpp:1019:1
31 0x0000000004e8e580 clang::CodeGenAction::ExecuteAction() /path/to/llvm/build/debug/../../tools/clang/lib/CodeGen/CodeGenAction.cpp:1045:1
32 0x00000000048781a0 clang::FrontendAction::Execute() /path/to/llvm/build/debug/../../tools/clang/lib/Frontend/FrontendAction.cpp:920:7
33 0x00000000047f070f clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /path/to/llvm/build/debug/../../tools/clang/lib/Frontend/CompilerInstance.cpp:968:7
34 0x0000000004a1408b clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /path/to/llvm/build/debug/../../tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:266:8
35 0x0000000001253230 cc1_main(llvm::ArrayRef<char const>, char const, void*) /path/to/llvm/build/debug/../../tools/clang/tools/driver/cc1_main.cpp:218:11
36 0x0000000001245c80 ExecuteCC1Tool(llvm::ArrayRef<char const*>, llvm::StringRef) /path/to/llvm/build/debug/../../tools/clang/tools/driver/driver.cpp:310:5
37 0x00000000012448af main /path/to/llvm/build/debug/../../tools/clang/tools/driver/driver.cpp:382:5
38 0x00007fd57775e2b1 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b1)
39 0x00000000012437aa _start (/path/to/llvm/build/debug/bin/clang-8+0x12437aa)