Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clang 18.1.0 (bba39443eb91) crashes when extending a BF16 subvector to a larger vector on AVX512BF16 #83358

Closed
johnplatts opened this issue Feb 29, 2024 · 3 comments · Fixed by #83720
Assignees
Labels
backend:X86 crash Prefer [crash-on-valid] or [crash-on-invalid]

Comments

@johnplatts
Copy link

Here is the error that occurs in Clang 18.1.0 (++20240221023121+bba39443eb91-1exp120240221023233.52) when an 128-bit BF16 vector resulting from a _mm256_cvtneps_pbh operation is extended to a 512-bit vector:

fatal error: error in backend: Cannot select: 0x55b077581770: v32bf16 = insert_subvector undef:v32bf16, 0x55b0797a8920, Constant:i64<0>, jep_google_highway/hwy/ops/x86_512-inl.h:3789:31 @[ jep_google_highway/hwy/tests/dup128_vec_test.cc:112:12 @[ jep_google_highway/hwy/tests/dup128_vec_test.cc:181:5 ] ]
  0x55b0767bbb30: v32bf16 = undef
  0x55b0797a8920: v8bf16 = llvm.x86.vcvtneps2bf16256 TargetConstant:i64<13501>, 0x55b0772e8670, jep_google_highway/hwy/ops/x86_256-inl.h:6390:45 @[ jep_google_highway/hwy/tests/dup128_vec_test.cc:103:29 @[ jep_google_highway/hwy/tests/dup128_vec_test.cc:181:5 ] ]
    0x55b07807f7d0: i64 = TargetConstant<13501>
    0x55b0772e8670: v8f32,ch = load<(load (s256) from constant-pool)> 0x55b0815e7dd0, 0x55b07aaa9630, undef:i64, jep_google_highway/hwy/ops/x86_256-inl.h:6390:45 @[ jep_google_highway/hwy/tests/dup128_vec_test.cc:103:29 @[ jep_google_highway/hwy/tests/dup128_vec_test.cc:181:5 ] ]
      0x55b07aaa9630: i64 = X86ISD::WrapperRIP TargetConstantPool:i64<<8 x float> <float -1.600000e+01, float -1.500000e+01, float -1.400000e+01, float -1.300000e+01, float -1.200000e+01, float -1.100000e+01, float -1.000000e+01, float -9.000000e+00>> 0
        0x55b07aa9a320: i64 = TargetConstantPool<<8 x float> <float -1.600000e+01, float -1.500000e+01, float -1.400000e+01, float -1.300000e+01, float -1.200000e+01, float -1.100000e+01, float -1.000000e+01, float -9.000000e+00>> 0
      0x55b0775743c0: i64 = undef
  0x55b076ffdee0: i64 = Constant<0>
In function: _ZN3hwy11N_AVX3_ZEN423TestDup128VecFromValuesclINS_10bfloat16_tENS0_4SimdIS3_Lm32ELi0EEEEEvT_T0_
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: /usr/bin/clang++-18 -DHWY_STATIC_DEFINE -DTOOLCHAIN_MISS_ASM_HWCAP_H -I/home/jplatts/jepprojects/hwy_bf16_avx3_zen4_021724/jep_google_highway -isystem /home/jplatts/jepprojects/hwy_bf16_avx3_zen4_021724/hwy_clang18_zen4_build/googletest-src/googletest/include -isystem /home/jplatts/jepprojects/hwy_bf16_avx3_zen4_021724/hwy_clang18_zen4_build/googletest-src/googletest -march=znver4 -DHWY_DISABLED_TARGETS=6917529027641114559 -DHWY_WANT_AVX3_ZEN4=1 -DHWY_COMPILE_ONLY_STATIC=1 -O2 -g -DNDEBUG -fPIE -fvisibility=hidden -fvisibility-inlines-hidden -Wno-builtin-macro-redefined -D__DATE__=\"redacted\" -D__TIMESTAMP__=\"redacted\" -D__TIME__=\"redacted\" -fmerge-all-constants -Wall -Wextra -Wconversion -Wsign-conversion -Wvla -Wnon-virtual-dtor -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wfor-loop-analysis -Wgnu-redeclared-enum -Winfinite-recursion -Wself-assign -Wstring-conversion -Wtautological-overlap-compare -Wthread-safety-analysis -Wundefined-func-template -fno-cxx-exceptions -fno-slp-vectorize -fno-vectorize -fdiagnostics-show-option -fcolor-diagnostics -Wc++2a-extensions -fmath-errno -fno-exceptions -Wno-psabi -Werror -DHWY_IS_TEST=1 -std=c++17 -MD -MT CMakeFiles/dup128_vec_test.dir/hwy/tests/dup128_vec_test.cc.o -MF CMakeFiles/dup128_vec_test.dir/hwy/tests/dup128_vec_test.cc.o.d -o CMakeFiles/dup128_vec_test.dir/hwy/tests/dup128_vec_test.cc.o -c /home/jplatts/jepprojects/hwy_bf16_avx3_zen4_021724/jep_google_highway/hwy/tests/dup128_vec_test.cc
1.	<eof> parser at end of file
2.	Code generation
3.	Running pass 'Function Pass Manager' on module '/home/jplatts/jepprojects/hwy_bf16_avx3_zen4_021724/jep_google_highway/hwy/tests/dup128_vec_test.cc'.
4.	Running pass 'X86 DAG->DAG Instruction Selection' on function '@_ZN3hwy11N_AVX3_ZEN423TestDup128VecFromValuesclINS_10bfloat16_tENS0_4SimdIS3_Lm32ELi0EEEEEvT_T0_'
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  libLLVM-18.so.1    0x00007f396ed866d6 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 54
1  libLLVM-18.so.1    0x00007f396ed84690 llvm::sys::RunSignalHandlers() + 80
2  libLLVM-18.so.1    0x00007f396ecd60ee
3  libLLVM-18.so.1    0x00007f396ecd60ab
4  libLLVM-18.so.1    0x00007f396ed80f47 llvm::sys::Process::Exit(int, bool) + 39
5  clang++-18         0x000055b075544143
6  libLLVM-18.so.1    0x00007f396ece3932 llvm::report_fatal_error(llvm::Twine const&, bool) + 274
7  libLLVM-18.so.1    0x00007f396f5e59b0 llvm::SelectionDAGISel::isOrEquivalentToAdd(llvm::SDNode const*) const + 0
8  libLLVM-18.so.1    0x00007f396f5e4e38 llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) + 16168
9  libLLVM-18.so.1    0x00007f3971a67313
10 libLLVM-18.so.1    0x00007f396f5dc5df llvm::SelectionDAGISel::DoInstructionSelection() + 431
11 libLLVM-18.so.1    0x00007f396f5dbcc1 llvm::SelectionDAGISel::CodeGenAndEmitDAG() + 1441
12 libLLVM-18.so.1    0x00007f396f5dade2 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 4354
13 libLLVM-18.so.1    0x00007f396f5d8f9e llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 1726
14 libLLVM-18.so.1    0x00007f3971a5d11f
15 libLLVM-18.so.1    0x00007f396f146e34 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 852
16 libLLVM-18.so.1    0x00007f396eeccdff llvm::FPPassManager::runOnFunction(llvm::Function&) + 687
17 libLLVM-18.so.1    0x00007f396eed26f3 llvm::FPPassManager::runOnModule(llvm::Module&) + 51
18 libLLVM-18.so.1    0x00007f396eecd4f4 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1012
19 libclang-cpp.so.18 0x00007f39773bfe0e clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) + 7710
20 libclang-cpp.so.18 0x00007f397774f062 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 1538
21 libclang-cpp.so.18 0x00007f397637fd56 clang::ParseAST(clang::Sema&, bool, bool) + 614
22 libclang-cpp.so.18 0x00007f39781b0625 clang::FrontendAction::Execute() + 85
23 libclang-cpp.so.18 0x00007f3978129c14 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 708
24 libclang-cpp.so.18 0x00007f397822adce clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 750
25 clang++-18         0x000055b075543d65 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 4069
26 clang++-18         0x000055b075541165
27 libclang-cpp.so.18 0x00007f3977de1f79
28 libLLVM-18.so.1    0x00007f396ecd608c llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) + 140
29 libclang-cpp.so.18 0x00007f3977de190e clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const + 366
30 libclang-cpp.so.18 0x00007f3977da9ea1 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const + 897
31 libclang-cpp.so.18 0x00007f3977daa0ee clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const + 142
32 libclang-cpp.so.18 0x00007f3977dc66cd clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) + 333
33 clang++-18         0x000055b075540ad4 clang_main(int, char**, llvm::ToolContext const&) + 11172
34 clang++-18         0x000055b07554dbf6 main + 102
35 libc.so.6          0x00007f396d829d90
36 libc.so.6          0x00007f396d829e40 __libc_start_main + 128
37 clang++-18         0x000055b07553dbd5 _start + 37
clang++-18: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Ubuntu clang version 18.1.0 (++20240221023121+bba39443eb91-1~exp1~20240221023233.52)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang++-18: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++-18: note: diagnostic msg: /tmp/dup128_vec_test-cfb5fa.cpp
clang++-18: note: diagnostic msg: /tmp/dup128_vec_test-cfb5fa.sh
clang++-18: note: diagnostic msg: 

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

Here are the diagnostic files for the above error:
dup128_vec_test_clang18_error.zip

@github-actions github-actions bot added the clang Clang issues not falling into any other category label Feb 29, 2024
@johnplatts johnplatts changed the title Clang 18.1.0 (bba39443eb91) crashes when combining BF16 subvectors on AVX512BF16 Clang 18.1.0 (bba39443eb91) crashes when extending a BF16 subvector to a larger vector on AVX512BF16 Feb 29, 2024
@EugeneZelenko EugeneZelenko added backend:X86 crash Prefer [crash-on-valid] or [crash-on-invalid] llvm:SelectionDAG SelectionDAGISel as well and removed clang Clang issues not falling into any other category labels Feb 29, 2024
@llvmbot
Copy link
Member

llvmbot commented Feb 29, 2024

@llvm/issue-subscribers-backend-x86

Author: John Platts (johnplatts)

Here is the error that occurs in Clang 18.1.0 (++20240221023121+bba39443eb91-1~exp1~20240221023233.52) when an 128-bit BF16 vector resulting from a _mm256_cvtneps_pbh operation is extended to a 512-bit vector: ``` fatal error: error in backend: Cannot select: 0x55b077581770: v32bf16 = insert_subvector undef:v32bf16, 0x55b0797a8920, Constant:i64<0>, jep_google_highway/hwy/ops/x86_512-inl.h:3789:31 @[ jep_google_highway/hwy/tests/dup128_vec_test.cc:112:12 @[ jep_google_highway/hwy/tests/dup128_vec_test.cc:181:5 ] ] 0x55b0767bbb30: v32bf16 = undef 0x55b0797a8920: v8bf16 = llvm.x86.vcvtneps2bf16256 TargetConstant:i64<13501>, 0x55b0772e8670, jep_google_highway/hwy/ops/x86_256-inl.h:6390:45 @[ jep_google_highway/hwy/tests/dup128_vec_test.cc:103:29 @[ jep_google_highway/hwy/tests/dup128_vec_test.cc:181:5 ] ] 0x55b07807f7d0: i64 = TargetConstant<13501> 0x55b0772e8670: v8f32,ch = load<(load (s256) from constant-pool)> 0x55b0815e7dd0, 0x55b07aaa9630, undef:i64, jep_google_highway/hwy/ops/x86_256-inl.h:6390:45 @[ jep_google_highway/hwy/tests/dup128_vec_test.cc:103:29 @[ jep_google_highway/hwy/tests/dup128_vec_test.cc:181:5 ] ] 0x55b07aaa9630: i64 = X86ISD::WrapperRIP TargetConstantPool:i64<<8 x float> <float -1.600000e+01, float -1.500000e+01, float -1.400000e+01, float -1.300000e+01, float -1.200000e+01, float -1.100000e+01, float -1.000000e+01, float -9.000000e+00>> 0 0x55b07aa9a320: i64 = TargetConstantPool<<8 x float> <float -1.600000e+01, float -1.500000e+01, float -1.400000e+01, float -1.300000e+01, float -1.200000e+01, float -1.100000e+01, float -1.000000e+01, float -9.000000e+00>> 0 0x55b0775743c0: i64 = undef 0x55b076ffdee0: i64 = Constant<0> In function: _ZN3hwy11N_AVX3_ZEN423TestDup128VecFromValuesclINS_10bfloat16_tENS0_4SimdIS3_Lm32ELi0EEEEEvT_T0_ PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script. Stack dump: 0. Program arguments: /usr/bin/clang++-18 -DHWY_STATIC_DEFINE -DTOOLCHAIN_MISS_ASM_HWCAP_H -I/home/jplatts/jepprojects/hwy_bf16_avx3_zen4_021724/jep_google_highway -isystem /home/jplatts/jepprojects/hwy_bf16_avx3_zen4_021724/hwy_clang18_zen4_build/googletest-src/googletest/include -isystem /home/jplatts/jepprojects/hwy_bf16_avx3_zen4_021724/hwy_clang18_zen4_build/googletest-src/googletest -march=znver4 -DHWY_DISABLED_TARGETS=6917529027641114559 -DHWY_WANT_AVX3_ZEN4=1 -DHWY_COMPILE_ONLY_STATIC=1 -O2 -g -DNDEBUG -fPIE -fvisibility=hidden -fvisibility-inlines-hidden -Wno-builtin-macro-redefined -D__DATE__=\"redacted\" -D__TIMESTAMP__=\"redacted\" -D__TIME__=\"redacted\" -fmerge-all-constants -Wall -Wextra -Wconversion -Wsign-conversion -Wvla -Wnon-virtual-dtor -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wfor-loop-analysis -Wgnu-redeclared-enum -Winfinite-recursion -Wself-assign -Wstring-conversion -Wtautological-overlap-compare -Wthread-safety-analysis -Wundefined-func-template -fno-cxx-exceptions -fno-slp-vectorize -fno-vectorize -fdiagnostics-show-option -fcolor-diagnostics -Wc++2a-extensions -fmath-errno -fno-exceptions -Wno-psabi -Werror -DHWY_IS_TEST=1 -std=c++17 -MD -MT CMakeFiles/dup128_vec_test.dir/hwy/tests/dup128_vec_test.cc.o -MF CMakeFiles/dup128_vec_test.dir/hwy/tests/dup128_vec_test.cc.o.d -o CMakeFiles/dup128_vec_test.dir/hwy/tests/dup128_vec_test.cc.o -c /home/jplatts/jepprojects/hwy_bf16_avx3_zen4_021724/jep_google_highway/hwy/tests/dup128_vec_test.cc 1. <eof> parser at end of file 2. Code generation 3. Running pass 'Function Pass Manager' on module '/home/jplatts/jepprojects/hwy_bf16_avx3_zen4_021724/jep_google_highway/hwy/tests/dup128_vec_test.cc'. 4. Running pass 'X86 DAG->DAG Instruction Selection' on function '@_ZN3hwy11N_AVX3_ZEN423TestDup128VecFromValuesclINS_10bfloat16_tENS0_4SimdIS3_Lm32ELi0EEEEEvT_T0_' Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it): 0 libLLVM-18.so.1 0x00007f396ed866d6 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 54 1 libLLVM-18.so.1 0x00007f396ed84690 llvm::sys::RunSignalHandlers() + 80 2 libLLVM-18.so.1 0x00007f396ecd60ee 3 libLLVM-18.so.1 0x00007f396ecd60ab 4 libLLVM-18.so.1 0x00007f396ed80f47 llvm::sys::Process::Exit(int, bool) + 39 5 clang++-18 0x000055b075544143 6 libLLVM-18.so.1 0x00007f396ece3932 llvm::report_fatal_error(llvm::Twine const&, bool) + 274 7 libLLVM-18.so.1 0x00007f396f5e59b0 llvm::SelectionDAGISel::isOrEquivalentToAdd(llvm::SDNode const*) const + 0 8 libLLVM-18.so.1 0x00007f396f5e4e38 llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) + 16168 9 libLLVM-18.so.1 0x00007f3971a67313 10 libLLVM-18.so.1 0x00007f396f5dc5df llvm::SelectionDAGISel::DoInstructionSelection() + 431 11 libLLVM-18.so.1 0x00007f396f5dbcc1 llvm::SelectionDAGISel::CodeGenAndEmitDAG() + 1441 12 libLLVM-18.so.1 0x00007f396f5dade2 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 4354 13 libLLVM-18.so.1 0x00007f396f5d8f9e llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 1726 14 libLLVM-18.so.1 0x00007f3971a5d11f 15 libLLVM-18.so.1 0x00007f396f146e34 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 852 16 libLLVM-18.so.1 0x00007f396eeccdff llvm::FPPassManager::runOnFunction(llvm::Function&) + 687 17 libLLVM-18.so.1 0x00007f396eed26f3 llvm::FPPassManager::runOnModule(llvm::Module&) + 51 18 libLLVM-18.so.1 0x00007f396eecd4f4 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1012 19 libclang-cpp.so.18 0x00007f39773bfe0e clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) + 7710 20 libclang-cpp.so.18 0x00007f397774f062 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 1538 21 libclang-cpp.so.18 0x00007f397637fd56 clang::ParseAST(clang::Sema&, bool, bool) + 614 22 libclang-cpp.so.18 0x00007f39781b0625 clang::FrontendAction::Execute() + 85 23 libclang-cpp.so.18 0x00007f3978129c14 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 708 24 libclang-cpp.so.18 0x00007f397822adce clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 750 25 clang++-18 0x000055b075543d65 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 4069 26 clang++-18 0x000055b075541165 27 libclang-cpp.so.18 0x00007f3977de1f79 28 libLLVM-18.so.1 0x00007f396ecd608c llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) + 140 29 libclang-cpp.so.18 0x00007f3977de190e clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const + 366 30 libclang-cpp.so.18 0x00007f3977da9ea1 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const + 897 31 libclang-cpp.so.18 0x00007f3977daa0ee clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const + 142 32 libclang-cpp.so.18 0x00007f3977dc66cd clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) + 333 33 clang++-18 0x000055b075540ad4 clang_main(int, char**, llvm::ToolContext const&) + 11172 34 clang++-18 0x000055b07554dbf6 main + 102 35 libc.so.6 0x00007f396d829d90 36 libc.so.6 0x00007f396d829e40 __libc_start_main + 128 37 clang++-18 0x000055b07553dbd5 _start + 37 clang++-18: error: clang frontend command failed with exit code 70 (use -v to see invocation) Ubuntu clang version 18.1.0 (++20240221023121+bba39443eb91-1~exp1~20240221023233.52) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin clang++-18: note: diagnostic msg: ********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++-18: note: diagnostic msg: /tmp/dup128_vec_test-cfb5fa.cpp
clang++-18: note: diagnostic msg: /tmp/dup128_vec_test-cfb5fa.sh
clang++-18: note: diagnostic msg:



Here are the diagnostic files for the above error:
[dup128_vec_test_clang18_error.zip](https://github.com/llvm/llvm-project/files/14441055/dup128_vec_test_clang18_error.zip)

</details>

@johnplatts
Copy link
Author

Here is the error that occurs when compiling another test program with Clang 18.1.0 (++20240221023121+bba39443eb91-1exp120240221023233.52) when an 128-bit BF16 vector resulting from a _mm256_cvtneps_pbh operation is extended to a 512-bit vector:

fatal error: error in backend: Cannot select: 0x55cb416c3a50: v32bf16 = insert_subvector undef:v32bf16, 0x55cb416c33c0, Constant:i64<0>
  0x55cb416c3510: v32bf16 = undef
  0x55cb416c33c0: v8bf16 = llvm.x86.vcvtneps2bf16256 TargetConstant:i64<13501>, 0x55cb416c3b30
    0x55cb416c2f60: i64 = TargetConstant<13501>
    0x55cb416c3b30: v8f32,ch = load<(load (s256) from constant-pool)> 0x55cb418ea4f0, 0x55cb416c3040, undef:i64
      0x55cb416c3040: i64 = X86ISD::WrapperRIP TargetConstantPool:i64<<8 x float> <float -9.000000e+00, float -1.000000e+01, float -1.100000e+01, float -1.200000e+01, float -1.300000e+01, float -1.400000e+01, float -1.500000e+01, float -1.600000e+01>> 0
        0x55cb416c2fd0: i64 = TargetConstantPool<<8 x float> <float -9.000000e+00, float -1.000000e+01, float -1.100000e+01, float -1.200000e+01, float -1.300000e+01, float -1.400000e+01, float -1.500000e+01, float -1.600000e+01>> 0
      0x55cb416c3ac0: i64 = undef
  0x55cb416c3970: i64 = Constant<0>
In function: _Z27BF16BroadcastedBlkIotaNeg16v
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: clang++-18 -O2 -mavx512bf16 -mavx512vl -c -o bf16_broadcast_blk_iota_neg16_snippet_022824_clang18.o bf16_broadcast_blk_iota_neg16_snippet_022824.cpp
1.	<eof> parser at end of file
2.	Code generation
3.	Running pass 'Function Pass Manager' on module 'bf16_broadcast_blk_iota_neg16_snippet_022824.cpp'.
4.	Running pass 'X86 DAG->DAG Instruction Selection' on function '@_Z27BF16BroadcastedBlkIotaNeg16v'
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  libLLVM-18.so.1    0x00007f42a1d866d6 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 54
1  libLLVM-18.so.1    0x00007f42a1d84690 llvm::sys::RunSignalHandlers() + 80
2  libLLVM-18.so.1    0x00007f42a1cd60ee
3  libLLVM-18.so.1    0x00007f42a1cd60ab
4  libLLVM-18.so.1    0x00007f42a1d80f47 llvm::sys::Process::Exit(int, bool) + 39
5  clang++-18         0x000055cb4028a143
6  libLLVM-18.so.1    0x00007f42a1ce3932 llvm::report_fatal_error(llvm::Twine const&, bool) + 274
7  libLLVM-18.so.1    0x00007f42a25e59b0 llvm::SelectionDAGISel::isOrEquivalentToAdd(llvm::SDNode const*) const + 0
8  libLLVM-18.so.1    0x00007f42a25e4e38 llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) + 16168
9  libLLVM-18.so.1    0x00007f42a4a67313
10 libLLVM-18.so.1    0x00007f42a25dc5df llvm::SelectionDAGISel::DoInstructionSelection() + 431
11 libLLVM-18.so.1    0x00007f42a25dbcc1 llvm::SelectionDAGISel::CodeGenAndEmitDAG() + 1441
12 libLLVM-18.so.1    0x00007f42a25dade2 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 4354
13 libLLVM-18.so.1    0x00007f42a25d8f9e llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 1726
14 libLLVM-18.so.1    0x00007f42a4a5d11f
15 libLLVM-18.so.1    0x00007f42a2146e34 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 852
16 libLLVM-18.so.1    0x00007f42a1eccdff llvm::FPPassManager::runOnFunction(llvm::Function&) + 687
17 libLLVM-18.so.1    0x00007f42a1ed26f3 llvm::FPPassManager::runOnModule(llvm::Module&) + 51
18 libLLVM-18.so.1    0x00007f42a1ecd4f4 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1012
19 libclang-cpp.so.18 0x00007f42aa3bfe0e clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) + 7710
20 libclang-cpp.so.18 0x00007f42aa74f062 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 1538
21 libclang-cpp.so.18 0x00007f42a937fd56 clang::ParseAST(clang::Sema&, bool, bool) + 614
22 libclang-cpp.so.18 0x00007f42ab1b0625 clang::FrontendAction::Execute() + 85
23 libclang-cpp.so.18 0x00007f42ab129c14 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 708
24 libclang-cpp.so.18 0x00007f42ab22adce clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 750
25 clang++-18         0x000055cb40289d65 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 4069
26 clang++-18         0x000055cb40287165
27 libclang-cpp.so.18 0x00007f42aade1f79
28 libLLVM-18.so.1    0x00007f42a1cd608c llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) + 140
29 libclang-cpp.so.18 0x00007f42aade190e clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const + 366
30 libclang-cpp.so.18 0x00007f42aada9ea1 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const + 897
31 libclang-cpp.so.18 0x00007f42aadaa0ee clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const + 142
32 libclang-cpp.so.18 0x00007f42aadc66cd clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) + 333
33 clang++-18         0x000055cb40286ad4 clang_main(int, char**, llvm::ToolContext const&) + 11172
34 clang++-18         0x000055cb40293bf6 main + 102
35 libc.so.6          0x00007f42a0829d90
36 libc.so.6          0x00007f42a0829e40 __libc_start_main + 128
37 clang++-18         0x000055cb40283bd5 _start + 37
clang++-18: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Ubuntu clang version 18.1.0 (++20240221023121+bba39443eb91-1~exp1~20240221023233.52)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang++-18: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++-18: note: diagnostic msg: /tmp/bf16_broadcast_blk_iota_neg16_snippet_022824-a7e69c.cpp
clang++-18: note: diagnostic msg: /tmp/bf16_broadcast_blk_iota_neg16_snippet_022824-a7e69c.sh
clang++-18: note: diagnostic msg: 

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

Here are the diagnostic files for the above error:
clang18_bf16_broadcast_blk_err_022824.zip

@phoebewang
Copy link
Contributor

Thanks @johnplatts for reporting the issue! I can reproduce it locally and will take a look.

phoebewang added a commit to phoebewang/llvm-project that referenced this issue Mar 3, 2024
phoebewang added a commit to phoebewang/llvm-project that referenced this issue Mar 3, 2024
@EugeneZelenko EugeneZelenko removed the llvm:SelectionDAG SelectionDAGISel as well label Mar 4, 2024
llvmbot pushed a commit to llvmbot/llvm-project that referenced this issue Mar 4, 2024
llvmbot pushed a commit to llvmbot/llvm-project that referenced this issue Mar 8, 2024
llvmbot pushed a commit to llvmbot/llvm-project that referenced this issue Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:X86 crash Prefer [crash-on-valid] or [crash-on-invalid]
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants