[clang] [CIR] vector-saturating-left vqshl_*/ vqshlu_* (PR #203168)
Andrzej WarzyĆski via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 11 02:58:02 PDT 2026
banach-space wrote:
> @banach-space loally everything is working fine, here it says test failure on vmaxnv thats not even part of the diff ?
I've tested your branch locally and for this example:
```c
#include <arm_neon.h>
uint16_t test_vqshlh_u16(uint16_t a, int16_t b) {
return vqshlh_u16(a, b);
}
```
I also hit an error:
```bash
$ bin/clang -cc1 -internal-isystem /llvm-project/build/cir-release/lib/clang/23/include -nostdsysteminc -triple arm64-none-linux-gnu -target-feature +neon -o - -fclangir -emit-llvm -disable-O0-optnone file.c
clang: /llvm-project/llvm/lib/IR/Instructions.cpp:3094: static CastInst *llvm::CastInst::Create(Instruction::CastOps, Value *, Type *, const Twine &, InsertPosition): Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and dumped files.
Stack dump:
0. Program arguments: bin/clang -cc1 -internal-isystem /lvm-project/build/cir-release/lib/clang/23/include -nostdsysteminc -triple arm64-none-linux-gnu -target-feature +neon -o - -fclangir -emit-llvm -disable-O0-optnone file.c
1. <eof> parser at end of file
#0 0x0000c3b57f5e0c24 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (bin/clang+0x55c0c24)
#1 0x0000c3b57f5de018 llvm::sys::RunSignalHandlers() (bin/clang+0x55be018)
#2 0x0000c3b57f5e1b44 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x0000c3b57f5e18c8 SignalHandlerTerminate(int, siginfo_t*, void*) Signals.cpp:0:0
#4 0x0000e6ed1e091a60 (linux-vdso.so.1+0xa60)
#5 0x0000e6ed1daa7608 __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#6 0x0000e6ed1da5cb3c raise ./signal/../sysdeps/posix/raise.c:27:6
#7 0x0000e6ed1da47e00 abort ./stdlib/abort.c:81:7
#8 0x0000e6ed1da55cc0 __assert_fail_base ./assert/assert.c:93:7
#9 0x0000e6ed1da55d30 __assert_perror_fail ./assert/assert-perr.c:31:1
#10 0x0000c3b57f0492b8 llvm::CastInst::Create(llvm::Instruction::CastOps, llvm::Value*, llvm::Type*, llvm::Twine const&, llvm::InsertPosition) (bin/clang+0x50292b8)
#11 0x0000c3b57e392d78 llvm::IRBuilderBase::CreateCast(llvm::Instruction::CastOps, llvm::Value*, llvm::Type*, llvm::Twine const&, llvm::MDNode*, llvm::FMFSource) AArch64ISelLowering.cpp:0:0
#12 0x0000c3b5816a2f80 convertOperationImpl(mlir::Operation&, llvm::IRBuilderBase&, mlir::LLVM::ModuleTranslation&) LLVMToLLVMIRTranslation.cpp:0:0
#13 0x0000c3b5819fbde0 mlir::LLVM::ModuleTranslation::convertOperationImpl(mlir::Operation&, llvm::IRBuilderBase&, bool) (bin/clang+0x79dbde0)
#14 0x0000c3b5819fc888 mlir::LLVM::ModuleTranslation::convertBlockImpl(mlir::Block&, bool, llvm::IRBuilderBase&, bool) (bin/clang+0x79dc888)
#15 0x0000c3b581a0104c mlir::LLVM::ModuleTranslation::convertOneFunction(mlir::LLVM::LLVMFuncOp) (bin/clang+0x79e104c)
#16 0x0000c3b581a0427c mlir::LLVM::ModuleTranslation::convertFunctions() (bin/clang+0x79e427c)
#17 0x0000c3b581a07550 mlir::translateModuleToLLVMIR(mlir::Operation*, llvm::LLVMContext&, llvm::StringRef, bool, llvm::vfs::FileSystem*) (bin/clang+0x79e7550)
#18 0x0000c3b58085a2ac cir::direct::lowerDirectlyFromCIRToLLVMIR(mlir::ModuleOp, llvm::LLVMContext&, llvm::StringRef, llvm::vfs::FileSystem*) (bin/clang+0x683a2ac)
#19 0x0000c3b58079c64c cir::CIRGenConsumer::HandleTranslationUnit(clang::ASTContext&) CIRGenAction.cpp:0:0
#20 0x0000c3b58341cf48 clang::ParseAST(clang::Sema&, bool, bool) (bin/clang+0x93fcf48)
#21 0x0000c3b580425450 clang::FrontendAction::Execute() (bin/clang+0x6405450)
#22 0x0000c3b5803950e8 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (bin/clang+0x63750e8)
#23 0x0000c3b580518ce8 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (bin/clang+0x64f8ce8)
#24 0x0000c3b57e2801d8 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (bin/clang+0x42601d8)
#25 0x0000c3b57e27c888 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) driver.cpp:0:0
#26 0x0000c3b57e27b69c clang_main(int, char**, llvm::ToolContext const&) (bin/clang+0x425b69c)
#27 0x0000c3b57e28b4cc main (bin/clang+0x426b4cc)
#28 0x0000e6ed1da484c4 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#29 0x0000e6ed1da48598 call_init ./csu/../csu/libc-start.c:128:20
#30 0x0000e6ed1da48598 __libc_start_main ./csu/../csu/libc-start.c:347:5
#31 0x0000c3b57e27a230 _start (bin/clang+0x425a230)
Aborted (core dumped)
```
> here it says test failure on vmaxnv thats not even part of the diff ?
The note about `vmaxnv` is bogus - it's basically where LIT got stuck. But before that, you get a proper compilation error.
https://github.com/llvm/llvm-project/pull/203168
More information about the cfe-commits
mailing list