[llvm] r297232 - [InstCombine] shrink truncated splat shuffle (2nd try)

David Green via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 8 05:10:42 PST 2017


Hello

I have an error which I believe is for you. Compiled with "clang -O3 -target aarch64-linux-gnu -mcpu=cortex-a57 -c reduce.c"

typedef __attribute__((neon_vector_type(8))) unsigned char a;
typedef __attribute__((neon_vector_type(4))) short b;
typedef __attribute__((neon_vector_type(8))) short c;
typedef __attribute__((neon_vector_type(4))) int d;
a f(d e) {
  b g = __builtin_neon_vqrshrn_n_v(e, 3, 17);
  c h = __builtin_shufflevector(g, g, 0, 0, 0, 0, 0, 0, 0, 0);
  a i = __builtin_neon_vmovn_v(h, 16);
  return i;
}

It's been heavily reduced from autogenerated code, so apologies for any weirdness. 


clang-5.0: ../lib/IR/Instructions.cpp:2592: static llvm::CastInst* llvm::CastInst::Create(llvm::Instruction::CastOps, llvm::Value*, llvm::Type*, const llvm::Twine&, llvm::Instruction*): Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed.
#0 0x00007f516f2924ea llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/work/llvm-git/build/bin/../lib/libLLVMSupport.so.5+0xf84ea)
#1 0x00007f516f29050e llvm::sys::RunSignalHandlers() (/work/llvm-git/build/bin/../lib/libLLVMSupport.so.5+0xf650e)
#2 0x00007f516f290672 SignalHandler(int) (/work/llvm-git/build/bin/../lib/libLLVMSupport.so.5+0xf6672)
#3 0x00007f516dcb4cb0 (/lib/x86_64-linux-gnu/libc.so.6+0x36cb0)
#4 0x00007f516dcb4c37 gsignal /build/eglibc-oGUzwX/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007f516dcb8028 abort /build/eglibc-oGUzwX/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007f516dcadbf6 __assert_fail_base /build/eglibc-oGUzwX/eglibc-2.19/assert/assert.c:92:0
#7 0x00007f516dcadca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x00007f516fc344d7 (/work/llvm-git/build/bin/../lib/libLLVMCore.so.5+0x15b4d7)
#9 0x00007f516f8a494f llvm::IRBuilder<llvm::TargetFolder, llvm::IRBuilderCallbackInserter>::CreateCast(llvm::Instruction::CastOps, llvm::Value*, llvm::Type*, llvm::Twine const&) (/work/llvm-git/build/bin/../lib/libLLVMInstCombine.so.5+0x1e94f)
#10 0x00007f516f8e6957 llvm::InstCombiner::visitTrunc(llvm::TruncInst&) (/work/llvm-git/build/bin/../lib/libLLVMInstCombine.so.5+0x60957)
#11 0x00007f516f8b366d llvm::InstCombiner::run() (/work/llvm-git/build/bin/../lib/libLLVMInstCombine.so.5+0x2d66d)
#12 0x00007f516f8b44b3 combineInstructionsOverFunction(llvm::Function&, llvm::InstCombineWorklist&, llvm::AAResults*, llvm::AssumptionCache&, llvm::TargetLibraryInfo&, llvm::DominatorTree&, bool, llvm::LoopInfo*) (/work/llvm-git/build/bin/../lib/libLLVMInstCombine.so.5+0x2e4b3)
#13 0x00007f516f8b488e llvm::InstructionCombiningPass::runOnFunction(llvm::Function&) (/work/llvm-git/build/bin/../lib/libLLVMInstCombine.so.5+0x2e88e)
#14 0x00007f516fc4f383 llvm::FPPassManager::runOnFunction(llvm::Function&) (/work/llvm-git/build/bin/../lib/libLLVMCore.so.5+0x176383)
#15 0x00007f516fc4f42c llvm::FPPassManager::runOnModule(llvm::Module&) (/work/llvm-git/build/bin/../lib/libLLVMCore.so.5+0x17642c)
#16 0x00007f516fc5018f llvm::legacy::PassManagerImpl::run(llvm::Module&) (/work/llvm-git/build/bin/../lib/libLLVMCore.so.5+0x17718f)
#17 0x00007f516e7220fa (anonymous namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/work/llvm-git/build/bin/../lib/libclangCodeGen.so.5+0xb30fa)
#18 0x00007f516e7233e3 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> >) (/work/llvm-git/build/bin/../lib/libclangCodeGen.so.5+0xb43e3)
#19 0x00007f516e8f07cc clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/work/llvm-git/build/bin/../lib/libclangCodeGen.so.5+0x2817cc)
#20 0x00007f516bde1532 clang::ParseAST(clang::Sema&, bool, bool) (/work/llvm-git/build/bin/../lib/../lib/libclangParse.so.5+0x2d532)
#21 0x00007f516e8ef16a clang::CodeGenAction::ExecuteAction() (/work/llvm-git/build/bin/../lib/libclangCodeGen.so.5+0x28016a)
#22 0x00007f516e443fd6 clang::FrontendAction::Execute() (/work/llvm-git/build/bin/../lib/libclangFrontend.so.5+0xc3fd6)
#23 0x00007f516e411996 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/work/llvm-git/build/bin/../lib/libclangFrontend.so.5+0x91996)
#24 0x00007f516e37c624 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/work/llvm-git/build/bin/../lib/libclangFrontendTool.so.5+0x3624)
#25 0x00000000004120a8 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/work/llvm-git/build/bin/clang-5.0+0x4120a8)
#26 0x000000000040cf6a main (/work/llvm-git/build/bin/clang-5.0+0x40cf6a)
#27 0x00007f516dc9ff45 __libc_start_main /build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:321:0
#28 0x000000000040d995 _start (/work/llvm-git/build/bin/clang-5.0+0x40d995)
Stack dump:
0.	Program arguments: /work/llvm-git/build/bin/clang-5.0 -cc1 -triple aarch64--linux-gnu -emit-obj -disable-free -main-file-name reduce.c -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu cortex-a57 -target-feature +neon -target-feature +crc -target-feature +crypto -target-abi aapcs -dwarf-column-info -debugger-tuning=gdb -coverage-notes-file /work/tmp/testing/emp/reduce/reduce.gcno -resource-dir /work/llvm-git/build/lib/clang/5.0.0 -internal-isystem /usr/local/include -internal-isystem /work/llvm-git/build/lib/clang/5.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O3 -fdebug-compilation-dir /work/tmp/testing/emp/reduce -ferror-limit 19 -fmessage-length 88 -fallow-half-arguments-and-returns -fno-signed-char -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o reduce.o -x c reduce.c 
1.	<eof> parser at end of file
2.	Per-module optimization passes
3.	Running pass 'Function Pass Manager' on module 'reduce.c'.
4.	Running pass 'Combine redundant instructions' on function '@f'
clang-5.0: error: unable to execute command: Aborted (core dumped)
clang-5.0: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 5.0.0 (http://llvm.org/git/clang.git 98183555eb52a2527e1e2b1952d493a5fc25085e) (http://llvm.org/git/llvm.git 4d6542726b49c649928255ead9f753e55a5c87f3)
Target: aarch64--linux-gnu
Thread model: posix
InstalledDir: /work/llvm-git/build/bin
clang-5.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-5.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-5.0: note: diagnostic msg: /tmp/reduce-73e99f.c
clang-5.0: note: diagnostic msg: /tmp/reduce-73e99f.sh
clang-5.0: note: diagnostic msg: 

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


Cheers
Dave


More information about the llvm-commits mailing list