<div dir="ltr">Should be fixed with:<br><a href="https://reviews.llvm.org/rL297280" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>rL297280</a></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 8, 2017 at 7:40 AM, Sanjay Patel <span dir="ltr"><<a href="mailto:spatel@rotateright.com" target="_blank">spatel@rotateright.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yes, that's my fault - forgot to handle the case where the shuffle result does not have the same size as the input vector. Fix coming shortly. Thanks for letting me know!<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 8, 2017 at 6:10 AM, David Green <span dir="ltr"><<a href="mailto:David.Green@arm.com" target="_blank">David.Green@arm.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello<br>
<br>
I have an error which I believe is for you. Compiled with "clang -O3 -target aarch64-linux-gnu -mcpu=cortex-a57 -c reduce.c"<br>
<br>
typedef __attribute__((neon_vector_typ<wbr>e(8))) unsigned char a;<br>
typedef __attribute__((neon_vector_typ<wbr>e(4))) short b;<br>
typedef __attribute__((neon_vector_typ<wbr>e(8))) short c;<br>
typedef __attribute__((neon_vector_typ<wbr>e(4))) int d;<br>
a f(d e) {<br>
  b g = __builtin_neon_vqrshrn_n_v(e, 3, 17);<br>
  c h = __builtin_shufflevector(g, g, 0, 0, 0, 0, 0, 0, 0, 0);<br>
  a i = __builtin_neon_vmovn_v(h, 16);<br>
  return i;<br>
}<br>
<br>
It's been heavily reduced from autogenerated code, so apologies for any weirdness.<br>
<br>
<br>
clang-5.0: ../lib/IR/Instructions.cpp:259<wbr>2: static llvm::CastInst* llvm::CastInst::Create(llvm::I<wbr>nstruction::CastOps, llvm::Value*, llvm::Type*, const llvm::Twine&, llvm::Instruction*): Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed.<br>
#0 0x00007f516f2924ea llvm::sys::PrintStackTrace(llv<wbr>m::raw_ostream&) (/work/llvm-git/build/bin/../l<wbr>ib/libLLVMSupport.so.5+0xf84ea<wbr>)<br>
#1 0x00007f516f29050e llvm::sys::RunSignalHandlers() (/work/llvm-git/build/bin/../l<wbr>ib/libLLVMSupport.so.5+0xf650e<wbr>)<br>
#2 0x00007f516f290672 SignalHandler(int) (/work/llvm-git/build/bin/../l<wbr>ib/libLLVMSupport.so.5+0xf6672<wbr>)<br>
#3 0x00007f516dcb4cb0 (/lib/x86_64-linux-gnu/libc.so<wbr>.6+0x36cb0)<br>
#4 0x00007f516dcb4c37 gsignal /build/eglibc-oGUzwX/eglibc-2.<wbr>19/signal/../nptl/sysdeps/unix<wbr>/sysv/linux/raise.c:56:0<br>
#5 0x00007f516dcb8028 abort /build/eglibc-oGUzwX/eglibc-2.<wbr>19/stdlib/abort.c:91:0<br>
#6 0x00007f516dcadbf6 __assert_fail_base /build/eglibc-oGUzwX/eglibc-2.<wbr>19/assert/assert.c:92:0<br>
#7 0x00007f516dcadca2 (/lib/x86_64-linux-gnu/libc.so<wbr>.6+0x2fca2)<br>
#8 0x00007f516fc344d7 (/work/llvm-git/build/bin/../l<wbr>ib/libLLVMCore.so.5+0x15b4d7)<br>
#9 0x00007f516f8a494f llvm::IRBuilder<llvm::TargetFo<wbr>lder, llvm::IRBuilderCallbackInserte<wbr>r>::CreateCast(llvm::<wbr>Instruction::CastOps, llvm::Value*, llvm::Type*, llvm::Twine const&) (/work/llvm-git/build/bin/../l<wbr>ib/libLLVMInstCombine.so.5+0x1<wbr>e94f)<br>
#10 0x00007f516f8e6957 llvm::InstCombiner::visitTrunc<wbr>(llvm::TruncInst&) (/work/llvm-git/build/bin/../l<wbr>ib/libLLVMInstCombine.so.5+0x6<wbr>0957)<br>
#11 0x00007f516f8b366d llvm::InstCombiner::run() (/work/llvm-git/build/bin/../l<wbr>ib/libLLVMInstCombine.so.5+0x2<wbr>d66d)<br>
#12 0x00007f516f8b44b3 combineInstructionsOverFunctio<wbr>n(llvm::Function&, llvm::InstCombineWorklist&, llvm::AAResults*, llvm::AssumptionCache&, llvm::TargetLibraryInfo&, llvm::DominatorTree&, bool, llvm::LoopInfo*) (/work/llvm-git/build/bin/../l<wbr>ib/libLLVMInstCombine.so.5+0x2<wbr>e4b3)<br>
#13 0x00007f516f8b488e llvm::InstructionCombiningPass<wbr>::runOnFunction(llvm::<wbr>Function&) (/work/llvm-git/build/bin/../l<wbr>ib/libLLVMInstCombine.so.5+0x2<wbr>e88e)<br>
#14 0x00007f516fc4f383 llvm::FPPassManager::runOnFunc<wbr>tion(llvm::Function&) (/work/llvm-git/build/bin/../l<wbr>ib/libLLVMCore.so.5+0x176383)<br>
#15 0x00007f516fc4f42c llvm::FPPassManager::runOnModu<wbr>le(llvm::Module&) (/work/llvm-git/build/bin/../l<wbr>ib/libLLVMCore.so.5+0x17642c)<br>
#16 0x00007f516fc5018f llvm::legacy::PassManagerImpl:<wbr>:run(llvm::Module&) (/work/llvm-git/build/bin/../l<wbr>ib/libLLVMCore.so.5+0x17718f)<br>
#17 0x00007f516e7220fa (anonymous namespace)::EmitAssemblyHelper<wbr>::EmitAssembly(clang::BackendA<wbr>ction, std::unique_ptr<llvm::raw_pwri<wbr>te_stream, std::default_delete<llvm::raw_<wbr>pwrite_stream> >) (/work/llvm-git/build/bin/../l<wbr>ib/libclangCodeGen.so.5+0xb30f<wbr>a)<br>
#18 0x00007f516e7233e3 clang::EmitBackendOutput(clang<wbr>::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_pwri<wbr>te_stream, std::default_delete<llvm::raw_<wbr>pwrite_stream> >) (/work/llvm-git/build/bin/../l<wbr>ib/libclangCodeGen.so.5+0xb43e<wbr>3)<br>
#19 0x00007f516e8f07cc clang::BackendConsumer::Handle<wbr>TranslationUnit(clang::ASTCont<wbr>ext&) (/work/llvm-git/build/bin/../l<wbr>ib/libclangCodeGen.so.5+0x2817<wbr>cc)<br>
#20 0x00007f516bde1532 clang::ParseAST(clang::Sema&, bool, bool) (/work/llvm-git/build/bin/../l<wbr>ib/../lib/libclangParse.so.5+0<wbr>x2d532)<br>
#21 0x00007f516e8ef16a clang::CodeGenAction::ExecuteA<wbr>ction() (/work/llvm-git/build/bin/../l<wbr>ib/libclangCodeGen.so.5+0x2801<wbr>6a)<br>
#22 0x00007f516e443fd6 clang::FrontendAction::Execute<wbr>() (/work/llvm-git/build/bin/../l<wbr>ib/libclangFrontend.so.5+0xc3f<wbr>d6)<br>
#23 0x00007f516e411996 clang::CompilerInstance::Execu<wbr>teAction(clang::FrontendAction<wbr>&) (/work/llvm-git/build/bin/../l<wbr>ib/libclangFrontend.so.5+0x919<wbr>96)<br>
#24 0x00007f516e37c624 clang::ExecuteCompilerInvocati<wbr>on(clang::CompilerInstance*) (/work/llvm-git/build/bin/../l<wbr>ib/libclangFrontendTool.so.5+0<wbr>x3624)<br>
#25 0x00000000004120a8 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/work/llvm-git/build/bin/clan<wbr>g-5.0+0x4120a8)<br>
#26 0x000000000040cf6a main (/work/llvm-git/build/bin/clan<wbr>g-5.0+0x40cf6a)<br>
#27 0x00007f516dc9ff45 __libc_start_main /build/eglibc-oGUzwX/eglibc-2.<wbr>19/csu/libc-start.c:321:0<br>
#28 0x000000000040d995 _start (/work/llvm-git/build/bin/clan<wbr>g-5.0+0x40d995)<br>
Stack dump:<br>
0.      Program arguments: /work/llvm-git/build/bin/clang<wbr>-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/r<wbr>educe.gcno -resource-dir /work/llvm-git/build/lib/clang<wbr>/5.0.0 -internal-isystem /usr/local/include -internal-isystem /work/llvm-git/build/lib/clang<wbr>/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-ret<wbr>urns -fno-signed-char -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o reduce.o -x c reduce.c<br>
1.      <eof> parser at end of file<br>
2.      Per-module optimization passes<br>
3.      Running pass 'Function Pass Manager' on module 'reduce.c'.<br>
4.      Running pass 'Combine redundant instructions' on function '@f'<br>
clang-5.0: error: unable to execute command: Aborted (core dumped)<br>
clang-5.0: error: clang frontend command failed due to signal (use -v to see invocation)<br>
clang version 5.0.0 (<a href="http://llvm.org/git/clang.git" rel="noreferrer" target="_blank">http://llvm.org/git/clang.git</a> 98183555eb52a2527e1e2b1952d493<wbr>a5fc25085e) (<a href="http://llvm.org/git/llvm.git" rel="noreferrer" target="_blank">http://llvm.org/git/llvm.git</a> 4d6542726b49c649928255ead9f753<wbr>e55a5c87f3)<br>
Target: aarch64--linux-gnu<br>
Thread model: posix<br>
InstalledDir: /work/llvm-git/build/bin<br>
clang-5.0: note: diagnostic msg: PLEASE submit a bug report to <a href="http://llvm.org/bugs/" rel="noreferrer" target="_blank">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and associated run script.<br>
clang-5.0: note: diagnostic msg:<br>
********************<br>
<br>
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:<br>
Preprocessed source(s) and associated run script(s) are located at:<br>
clang-5.0: note: diagnostic msg: /tmp/reduce-73e99f.c<br>
clang-5.0: note: diagnostic msg: /tmp/reduce-73e99f.sh<br>
clang-5.0: note: diagnostic msg:<br>
<br>
********************<br>
<br>
<br>
Cheers<br>
Dave</blockquote></div><br></div>
</div></div></blockquote></div><br></div>