<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="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_<wbr>type(8))) unsigned char a;<br>
typedef __attribute__((neon_vector_<wbr>type(4))) short b;<br>
typedef __attribute__((neon_vector_<wbr>type(8))) short c;<br>
typedef __attribute__((neon_vector_<wbr>type(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:<wbr>2592: static llvm::CastInst* llvm::CastInst::Create(llvm::<wbr>Instruction::CastOps, llvm::Value*, llvm::Type*, const llvm::Twine&, llvm::Instruction*): Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed.<br>
#0 0x00007f516f2924ea llvm::sys::PrintStackTrace(<wbr>llvm::raw_ostream&) (/work/llvm-git/build/bin/../<wbr>lib/libLLVMSupport.so.5+<wbr>0xf84ea)<br>
#1 0x00007f516f29050e llvm::sys::RunSignalHandlers() (/work/llvm-git/build/bin/../<wbr>lib/libLLVMSupport.so.5+<wbr>0xf650e)<br>
#2 0x00007f516f290672 SignalHandler(int) (/work/llvm-git/build/bin/../<wbr>lib/libLLVMSupport.so.5+<wbr>0xf6672)<br>
#3 0x00007f516dcb4cb0 (/lib/x86_64-linux-gnu/libc.<wbr>so.6+0x36cb0)<br>
#4 0x00007f516dcb4c37 gsignal /build/eglibc-oGUzwX/eglibc-2.<wbr>19/signal/../nptl/sysdeps/<wbr>unix/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.<wbr>so.6+0x2fca2)<br>
#8 0x00007f516fc344d7 (/work/llvm-git/build/bin/../<wbr>lib/libLLVMCore.so.5+0x15b4d7)<br>
#9 0x00007f516f8a494f llvm::IRBuilder<llvm::<wbr>TargetFolder, llvm::<wbr>IRBuilderCallbackInserter>::<wbr>CreateCast(llvm::Instruction::<wbr>CastOps, llvm::Value*, llvm::Type*, llvm::Twine const&) (/work/llvm-git/build/bin/../<wbr>lib/libLLVMInstCombine.so.5+<wbr>0x1e94f)<br>
#10 0x00007f516f8e6957 llvm::InstCombiner::<wbr>visitTrunc(llvm::TruncInst&) (/work/llvm-git/build/bin/../<wbr>lib/libLLVMInstCombine.so.5+<wbr>0x60957)<br>
#11 0x00007f516f8b366d llvm::InstCombiner::run() (/work/llvm-git/build/bin/../<wbr>lib/libLLVMInstCombine.so.5+<wbr>0x2d66d)<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/../<wbr>lib/libLLVMInstCombine.so.5+<wbr>0x2e4b3)<br>
#13 0x00007f516f8b488e llvm::<wbr>InstructionCombiningPass::<wbr>runOnFunction(llvm::Function&) (/work/llvm-git/build/bin/../<wbr>lib/libLLVMInstCombine.so.5+<wbr>0x2e88e)<br>
#14 0x00007f516fc4f383 llvm::FPPassManager::<wbr>runOnFunction(llvm::Function&) (/work/llvm-git/build/bin/../<wbr>lib/libLLVMCore.so.5+0x176383)<br>
#15 0x00007f516fc4f42c llvm::FPPassManager::<wbr>runOnModule(llvm::Module&) (/work/llvm-git/build/bin/../<wbr>lib/libLLVMCore.so.5+0x17642c)<br>
#16 0x00007f516fc5018f llvm::legacy::PassManagerImpl:<wbr>:run(llvm::Module&) (/work/llvm-git/build/bin/../<wbr>lib/libLLVMCore.so.5+0x17718f)<br>
#17 0x00007f516e7220fa (anonymous namespace)::<wbr>EmitAssemblyHelper::<wbr>EmitAssembly(clang::<wbr>BackendAction, std::unique_ptr<llvm::raw_<wbr>pwrite_stream, std::default_delete<llvm::raw_<wbr>pwrite_stream> >) (/work/llvm-git/build/bin/../<wbr>lib/libclangCodeGen.so.5+<wbr>0xb30fa)<br>
#18 0x00007f516e7233e3 clang::EmitBackendOutput(<wbr>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_<wbr>pwrite_stream, std::default_delete<llvm::raw_<wbr>pwrite_stream> >) (/work/llvm-git/build/bin/../<wbr>lib/libclangCodeGen.so.5+<wbr>0xb43e3)<br>
#19 0x00007f516e8f07cc clang::BackendConsumer::<wbr>HandleTranslationUnit(clang::<wbr>ASTContext&) (/work/llvm-git/build/bin/../<wbr>lib/libclangCodeGen.so.5+<wbr>0x2817cc)<br>
#20 0x00007f516bde1532 clang::ParseAST(clang::Sema&, bool, bool) (/work/llvm-git/build/bin/../<wbr>lib/../lib/libclangParse.so.5+<wbr>0x2d532)<br>
#21 0x00007f516e8ef16a clang::CodeGenAction::<wbr>ExecuteAction() (/work/llvm-git/build/bin/../<wbr>lib/libclangCodeGen.so.5+<wbr>0x28016a)<br>
#22 0x00007f516e443fd6 clang::FrontendAction::<wbr>Execute() (/work/llvm-git/build/bin/../<wbr>lib/libclangFrontend.so.5+<wbr>0xc3fd6)<br>
#23 0x00007f516e411996 clang::CompilerInstance::<wbr>ExecuteAction(clang::<wbr>FrontendAction&) (/work/llvm-git/build/bin/../<wbr>lib/libclangFrontend.so.5+<wbr>0x91996)<br>
#24 0x00007f516e37c624 clang::<wbr>ExecuteCompilerInvocation(<wbr>clang::CompilerInstance*) (/work/llvm-git/build/bin/../<wbr>lib/libclangFrontendTool.so.5+<wbr>0x3624)<br>
#25 0x00000000004120a8 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/work/llvm-git/build/bin/<wbr>clang-5.0+0x4120a8)<br>
#26 0x000000000040cf6a main (/work/llvm-git/build/bin/<wbr>clang-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/<wbr>clang-5.0+0x40d995)<br>
Stack dump:<br>
0.      Program arguments: /work/llvm-git/build/bin/<wbr>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/<wbr>reduce.gcno -resource-dir /work/llvm-git/build/lib/<wbr>clang/5.0.0 -internal-isystem /usr/local/include -internal-isystem /work/llvm-git/build/lib/<wbr>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-<wbr>returns -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>