Issue |
150933
|
Summary |
Crash in clang when compiling 4x4x4 vector.matrix.multiply intrinsic
|
Labels |
clang
|
Assignees |
|
Reporter |
superlopuh
|
For this input:
```
; ModuleID = 'LLVMDialectModule'
source_filename = "LLVMDialectModule"
define void @matmul(ptr noalias %0, ptr noalias %1, ptr noalias %2) {
%4 = getelementptr float, ptr %1, i64 0
%5 = load <16 x float>, ptr %4, align 4
%6 = getelementptr float, ptr %2, i64 0
%7 = load <16 x float>, ptr %6, align 4
%8 = call <16 x float> @llvm.matrix.multiply.v16f32.v16f32.v16f32(<16 x float> %5, <16 x float> %7, i32 4, i32 4, i32 4)
%9 = getelementptr float, ptr %0, i64 0
store <16 x float> %8, ptr %9, align 4
ret void
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <16 x float> @llvm.matrix.multiply.v16f32.v16f32.v16f32(<16 x float>, <16 x float>, i32 immarg, i32 immarg, i32 immarg) #0
attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
!llvm.module.flags = !{!0}
!0 = !{i32 2, !"Debug Info Version", i32 3}
```
I get the following crash:
```
❯ clang-20 -S -target x86_64-unknown-linux-gnu -o build/matmul_rowmaj/4x4x4/vector_intrinsic.x86.S build/matmul_rowmaj/4x4x4/vector_intrinsic.ll 13:37:18
warning: overriding the module target triple with x86_64-unknown-linux-gnu [-Woverride-module]
fatal error: error in backend: Do not know how to split the result of this operator!
PLEASE submit a bug report to https://github.com/Homebrew/homebrew-core/issues and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: clang-20 -S -target x86_64-unknown-linux-gnu -o build/matmul_rowmaj/4x4x4/vector_intrinsic.x86.S build/matmul_rowmaj/4x4x4/vector_intrinsic.ll
1. Code generation
2. Running pass 'Function Pass Manager' on module 'build/matmul_rowmaj/4x4x4/vector_intrinsic.ll'.
3. Running pass 'X86 DAG->DAG Instruction Selection' on function '@matmul'
#0 0x0000000117df0dc0 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/homebrew/Cellar/llvm/20.1.8/lib/libLLVM.dylib+0x3d90dc0)
#1 0x0000000114177090 llvm::sys::CleanupOnSignal(unsigned long) (/opt/homebrew/Cellar/llvm/20.1.8/lib/libLLVM.dylib+0x117090)
#2 0x0000000117dcb874 (anonymous namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long) (/opt/homebrew/Cellar/llvm/20.1.8/lib/libLLVM.dylib+0x3d6b874)
#3 0x0000000117dcb820 llvm::CrashRecoveryContext::HandleExit(int) (/opt/homebrew/Cellar/llvm/20.1.8/lib/libLLVM.dylib+0x3d6b820)
#4 0x0000000117df027c llvm::sys::Process::Exit(int, bool) (/opt/homebrew/Cellar/llvm/20.1.8/lib/libLLVM.dylib+0x3d9027c)
#5 0x000000010223d2a8 std::__1::deque<llvm::Region*, std::__1::allocator<llvm::Region*>>::~deque[abi:nn190102]() (/opt/homebrew/Cellar/llvm/20.1.8/bin/clang-20+0x10000d2a8)
#6 0x0000000117dceeac llvm::report_fatal_error(llvm::Twine const&, bool) (/opt/homebrew/Cellar/llvm/20.1.8/lib/libLLVM.dylib+0x3d6eeac)
#7 0x0000000117dced70 llvm::report_fatal_error(llvm::Twine const&, bool) (/opt/homebrew/Cellar/llvm/20.1.8/lib/libLLVM.dylib+0x3d6ed70)
#8 0x0000000114959ba4 llvm::DAGTypeLegalizer::SplitVectorResult(llvm::SDNode*, unsigned int) (/opt/homebrew/Cellar/llvm/20.1.8/lib/libLLVM.dylib+0x8f9ba4)
#9 0x000000011493f940 llvm::DAGTypeLegalizer::run() (/opt/homebrew/Cellar/llvm/20.1.8/lib/libLLVM.dylib+0x8df940)
#10 0x0000000114943b90 llvm::SelectionDAG::LegalizeTypes() (/opt/homebrew/Cellar/llvm/20.1.8/lib/libLLVM.dylib+0x8e3b90)
#11 0x0000000114a6fcdc llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/homebrew/Cellar/llvm/20.1.8/lib/libLLVM.dylib+0xa0fcdc)
#12 0x0000000114a6de60 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/homebrew/Cellar/llvm/20.1.8/lib/libLLVM.dylib+0xa0de60)
#13 0x0000000114a6c0a0 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/homebrew/Cellar/llvm/20.1.8/lib/libLLVM.dylib+0xa0c0a0)
#14 0x0000000114a6a954 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/homebrew/Cellar/llvm/20.1.8/lib/libLLVM.dylib+0xa0a954)
#15 0x00000001145c943c llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/opt/homebrew/Cellar/llvm/20.1.8/lib/libLLVM.dylib+0x56943c)
#16 0x00000001143274e0 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/homebrew/Cellar/llvm/20.1.8/lib/libLLVM.dylib+0x2c74e0)
#17 0x0000000114333118 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/homebrew/Cellar/llvm/20.1.8/lib/libLLVM.dylib+0x2d3118)
#18 0x000000011432985c llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/homebrew/Cellar/llvm/20.1.8/lib/libLLVM.dylib+0x2c985c)
#19 0x0000000107bbce8c clang::emitBackendOutput(clang::CompilerInstance&, clang::CodeGenOptions&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::__1::unique_ptr<llvm::raw_pwrite_stream, std::__1::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) (/opt/homebrew/Cellar/llvm/20.1.8/lib/libclang-cpp.dylib+0x1204e8c)
#20 0x0000000107ea88bc clang::CodeGenAction::ExecuteAction() (/opt/homebrew/Cellar/llvm/20.1.8/lib/libclang-cpp.dylib+0x14f08bc)
#21 0x0000000108473ee0 clang::FrontendAction::Execute() (/opt/homebrew/Cellar/llvm/20.1.8/lib/libclang-cpp.dylib+0x1abbee0)
#22 0x000000010840d1e8 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/homebrew/Cellar/llvm/20.1.8/lib/libclang-cpp.dylib+0x1a551e8)
#23 0x00000001084a6cc8 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/homebrew/Cellar/llvm/20.1.8/lib/libclang-cpp.dylib+0x1aeecc8)
#24 0x0000000102235370 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/homebrew/Cellar/llvm/20.1.8/bin/clang-20+0x100005370)
#25 0x0000000102233564 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) (/opt/homebrew/Cellar/llvm/20.1.8/bin/clang-20+0x100003564)
#26 0x000000010813dea0 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::__1::optional<llvm::StringRef>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*, bool*) const::$_0>(long) (/opt/homebrew/Cellar/llvm/20.1.8/lib/libclang-cpp.dylib+0x1785ea0)
#27 0x00000001140d12fc llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/homebrew/Cellar/llvm/20.1.8/lib/libLLVM.dylib+0x712fc)
#28 0x000000010813db4c clang::driver::CC1Command::Execute(llvm::ArrayRef<std::__1::optional<llvm::StringRef>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*, bool*) const (/opt/homebrew/Cellar/llvm/20.1.8/lib/libclang-cpp.dylib+0x1785b4c)
#29 0x0000000108108a84 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/homebrew/Cellar/llvm/20.1.8/lib/libclang-cpp.dylib+0x1750a84)
#30 0x0000000108124914 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*>>&) (/opt/homebrew/Cellar/llvm/20.1.8/lib/libclang-cpp.dylib+0x176c914)
#31 0x0000000102232548 clang_main(int, char**, llvm::ToolContext const&) (/opt/homebrew/Cellar/llvm/20.1.8/bin/clang-20+0x100002548)
#32 0x000000010223d19c main (/opt/homebrew/Cellar/llvm/20.1.8/bin/clang-20+0x10000d19c)
#33 0x0000000192d4eb98
clang-20: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Homebrew clang version 20.1.8
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/homebrew/Cellar/llvm/20.1.8/bin
clang-20: note: diagnostic msg: Error generating preprocessed source(s) - no preprocessable inputs.
```
Am I using it wrong? Is it a problem with the target triple I'm providing?
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs