[llvm-bugs] [Bug 39615] New: UNREACHABLE: "Not a vector MVT!" in X86TTIImpl

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 9 19:24:23 PST 2018


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

            Bug ID: 39615
           Summary: UNREACHABLE: "Not a vector MVT!" in X86TTIImpl
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: george.burgess.iv at gmail.com
                CC: llvm-bugs at lists.llvm.org

Bisection pointed to an `unreachable` being hit while we're running the SLP
Vectorizer.

Repro:

```
int a, b, g, h, i;
__int128 c, d, e, f;

void gcm_HashMult_sftw() {
  for (; h; h++) {
    f = b = g * c ^ a * f ^ g * e ^ b * d;
    g = i;
  }
}
```

$ $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.      Program arguments: /path/to/llvm/build/debug/bin/clang-8 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name gcm-a8cff7.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 -resource-dir
/path/to/llvm/build/debug/lib/clang/8.0.0 -internal-isystem /usr/local/include
-internal-isystem /path/to/llvm/build/debug/lib/clang/8.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O2
-std=gnu99 -fdebug-compilation-dir /path/to/llvm/gbiv_creduce -ferror-limit 19
-fmessage-length 0 -fobjc-runtime=gcc -fdiagnostics-show-option
-vectorize-loops -vectorize-slp -o /tmp/gcm-a8cff7-4dc836.o -x c gcm-a8cff7.c
-faddrsig 
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'Function Pass Manager' on module 'gcm-a8cff7.c'.
4.      Running pass 'SLP Vectorizer' on function '@gcm_HashMult_sftw'
#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<llvm::X86TTIImpl>::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<llvm::X86TTIImpl>::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<llvm::raw_pwrite_stream> >)
/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<llvm::raw_pwrite_stream> >)
/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)

-- 
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/20181110/d85613c9/attachment-0001.html>


More information about the llvm-bugs mailing list