Issue 181546
Summary [SLP][REVEC][X86] Assertion "Expected item in MinBWs."' failed.
Labels new issue
Assignees
Reporter Andarwinux
    https://rust.godbolt.org/z/x9G9q6rGx

with assertions:
```
clang: /root/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:20933: llvm::Value* llvm::slpvectorizer::BoUpSLP::vectorizeTree(llvm::slpvectorizer::BoUpSLP::TreeEntry*): Assertion `(It != MinBWs.end() || getOperandEntry(E, 0)->isGather() || getOperandEntry(E, 1)->isGather() || MinBWs.contains(getOperandEntry(E, 0)) || MinBWs.contains(getOperandEntry(E, 1))) && "Expected item in MinBWs."' failed.
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: /opt/compiler-explorer/clang-assertions-trunk/bin/clang -g -o /app/output.s -mllvm --x86-asm-syntax=intel -fno-verbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -O3 -march=znver5 -fprofile-generate -mllvm -slp-revec -mllvm -inline-threshold=349 <source>
1.	<eof> parser at end of file
2.	Optimizer
3.	Running pass "function<eager-inv>(drop-unnecessary-assumes,float2int,lower-constant-intrinsics,chr,loop(loop-rotate<header-duplication;no-prepare-for-lto>,loop-deletion),loop-distribute,inject-tli-mappings,loop-vectorize<no-interleave-forced-only;no-vectorize-forced-only;>,drop-unnecessary-assumes,infer-alignment,loop-load-elim,instcombine<max-iterations=1;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;forward-switch-cond;switch-range-to-icmp;switch-to-arithmetic;switch-to-lookup;no-keep-loops;hoist-common-insts;no-hoist-loads-stores-with-cond-faulting;sink-common-insts;speculate-blocks;simplify-cond-branch;no-speculate-unpredictables>,slp-vectorizer,vector-combine,instcombine<max-iterations=1;no-verify-fixpoint>,loop-unroll<O3>,transform-warning,sroa<preserve-cfg>,infer-alignment,instcombine<max-iterations=1;no-verify-fixpoint>,loop-mssa(licm<allowspeculation>),alignment-from-assumptions,loop-sink,instsimplify,div-rem-pairs,tailcallelim,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;switch-to-arithmetic;no-switch-to-lookup;keep-loops;no-hoist-common-insts;hoist-loads-stores-with-cond-faulting;no-sink-common-insts;speculate-blocks;simplify-cond-branch;speculate-unpredictables>)" on module "<source>"
4.	Running pass "slp-vectorizer" on function "svt_av1_inv_txfm2d_add_8x8_sse4_1"
 #0 0x00000000043ccce8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x43ccce8)
 #1 0x00000000043ca144 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x43ca144)
 #2 0x000000000430a3c8 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x0000745b97642520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x0000745b976969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x0000745b97642476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x0000745b976287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x0000745b9762871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #8 0x0000745b97639e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #9 0x00000000060a35de llvm::slpvectorizer::BoUpSLP::vectorizeTree(llvm::slpvectorizer::BoUpSLP::TreeEntry*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x60a35de)
#10 0x00000000060a299b llvm::slpvectorizer::BoUpSLP::vectorizeTree(llvm::slpvectorizer::BoUpSLP::TreeEntry*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x60a299b)
#11 0x00000000060c1f24 llvm::slpvectorizer::BoUpSLP::vectorizeTree(llvm::SmallDenseSet<llvm::Value*, 4u, llvm::DenseMapInfo<llvm::Value*, void>> const&, llvm::Instruction*, llvm::ArrayRef<std::tuple<llvm::Value*, unsigned int, bool>>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x60c1f24)
#12 0x00000000060c6254 llvm::slpvectorizer::BoUpSLP::vectorizeTree() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x60c6254)
#13 0x00000000060e7104 llvm::SLPVectorizerPass::tryToVectorizeList(llvm::ArrayRef<llvm::Value*>, llvm::slpvectorizer::BoUpSLP&, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x60e7104)
#14 0x00000000060eb79c bool tryToVectorizeSequence<llvm::Value>(llvm::SmallVectorImpl<llvm::Value*>&, llvm::function_ref<bool (llvm::Value*, llvm::Value*)>, llvm::function_ref<bool (llvm::ArrayRef<llvm::Value*>, llvm::Value*)>, llvm::function_ref<bool (llvm::ArrayRef<llvm::Value*>, bool)>, bool, llvm::slpvectorizer::BoUpSLP&) (.constprop.0) SLPVectorizer.cpp:0:0
#15 0x00000000060eca2c llvm::SLPVectorizerPass::vectorizeChainsInBlock(llvm::BasicBlock*, llvm::slpvectorizer::BoUpSLP&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x60eca2c)
#16 0x00000000060f4966 llvm::SLPVectorizerPass::runImpl(llvm::Function&, llvm::ScalarEvolution*, llvm::TargetTransformInfo*, llvm::TargetLibraryInfo*, llvm::AAResults*, llvm::LoopInfo*, llvm::DominatorTree*, llvm::AssumptionCache*, llvm::DemandedBits*, llvm::OptimizationRemarkEmitter*) (.part.0) SLPVectorizer.cpp:0:0
#17 0x00000000060f57eb llvm::SLPVectorizerPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x60f57eb)
#18 0x00000000055e1b5e llvm::detail::PassModel<llvm::Function, llvm::SLPVectorizerPass, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x55e1b5e)
#19 0x0000000003d00961 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3d00961)
#20 0x000000000129bb5e llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x129bb5e)
#21 0x0000000003cfef1a llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3cfef1a)
#22 0x000000000129be0e llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x129be0e)
#23 0x0000000003cfe8d1 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x3cfe8d1)
#24 0x0000000004693b6c (anonymous namespace)::EmitAssemblyHelper::RunOptimizationPipeline(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>&, std::unique_ptr<llvm::ToolOutputFile, std::default_delete<llvm::ToolOutputFile>>&, clang::BackendConsumer*) BackendUtil.cpp:0:0
#25 0x0000000004697438 clang::emitBackendOutput(clang::CompilerInstance&, clang::CodeGenOptions&, 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*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4697438)
#26 0x0000000004d44667 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4d44667)
#27 0x0000000006b6bd5c clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x6b6bd5c)
#28 0x0000000004d44ac8 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4d44ac8)
#29 0x0000000005042b95 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x5042b95)
#30 0x0000000004fc202e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4fc202e)
#31 0x000000000513e25d clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x513e25d)
#32 0x0000000000de942e cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xde942e)
#33 0x0000000000ddfdfa ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) driver.cpp:0:0
#34 0x0000000000ddff7d int llvm::function_ref<int (llvm::SmallVectorImpl<char const*>&)>::callback_fn<clang_main(int, char**, llvm::ToolContext const&)::'lambda'(llvm::SmallVectorImpl<char const*>&)>(long, llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#35 0x0000000004db8599 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#36 0x000000000430a864 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x430a864)
#37 0x0000000004db8baf clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#38 0x0000000004d79532 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4d79532)
#39 0x0000000004d7a4de clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4d7a4de)
#40 0x0000000004d81795 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0x4d81795)
#41 0x0000000000de57a1 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xde57a1)
#42 0x0000000000c9f604 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xc9f604)
#43 0x0000745b97629d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#44 0x0000745b97629e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#45 0x0000000000ddf895 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+0xddf895)
clang: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134
```
without assertions:
```
fatal error: error in backend: Cannot select: 0x120723c0: v16i32 = sign_extend 0x11fd8e90, example.c:214:28 @[ example.c:355:9 ]
  0x11fd8e90: v4i32 = bitcast 0x12033400, example.c:214:28 @[ example.c:355:9 ]
    0x12033400: v2i64 = extract_subvector 0x12033550, Constant:i64<0>, example.c:214:28 @[ example.c:355:9 ]
      0x12033550: v4i64 = X86ISD::VPERMV3 0x122e7f80, 0x12033470, 0x122e8140, example.c:189:14 @[ example.c:355:9 ]
 0x122e7f80: v4i64 = bitcast 0x12364470, example.c:189:14 @[ example.c:355:9 ]
          0x12364470: v8i32 = extract_subvector 0x122e8450, Constant:i64<0>, example.c:189:14 @[ example.c:355:9 ]
 0x122e8450: v16i32 = sub nsw 0x11fd8bf0, 0x12034190, example.c:191:14 @[ example.c:355:9 ]
              0x11fd8bf0: v16i32 = X86ISD::VSRAI 0x12364cc0, TargetConstant:i8<12>, example.c:165:14 @[ example.c:355:9 ]
 0x12364cc0: v16i32 = bitcast 0x124969c0, example.c:164:14 @[ example.c:355:9 ]
                  0x124969c0: v8i64 = X86ISD::SHUF128 0x12119a10, 0x12496800, TargetConstant:i8<-28>, example.c:164:14 @[ example.c:355:9 ]


              0x12034190: v16i32 = X86ISD::VSRAI 0x12364c50, TargetConstant:i8<12>, example.c:181:14 @[ example.c:355:9 ]
 0x12364c50: v16i32 = add 0x122e7e30, 0x12496fe0, example.c:180:14 @[ example.c:355:9 ]
                  0x122e7e30: v16i32 = add 0x122e7730, 0x122e7650, example.c:179:14 @[ example.c:355:9 ]


 0x12496fe0: v16i32,ch = X86ISD::VBROADCAST_LOAD<(load (s32) from constant-pool)> 0x12021300, 0x12080290, example.c:144:14 @[ example.c:355:9 ]

        0x12033470: v4i64,ch = load<(load (s256) from constant-pool)> 0x12021300, 0x120334e0, undef:i64, example.c:189:14 @[ example.c:355:9 ]
 0x120334e0: i64 = X86ISD::WrapperRIP TargetConstantPool:i64<<4 x i64> <i64 1, i64 5, i64 4, i64 0>> 0
        0x122e8140: v4i64 = bitcast 0x123644e0, example.c:189:14 @[ example.c:355:9 ]
          0x123644e0: v8i32 = extract_subvector 0x122e7960, Constant:i64<0>, example.c:189:14 @[ example.c:355:9 ]
            0x122e7960: v16i32 = add nsw 0x12034190, 0x11fd8bf0, example.c:189:14 @[ example.c:355:9 ]
              0x12034190: v16i32 = X86ISD::VSRAI 0x12364c50, TargetConstant:i8<12>, example.c:181:14 @[ example.c:355:9 ]
                0x12364c50: v16i32 = add 0x122e7e30, 0x12496fe0, example.c:180:14 @[ example.c:355:9 ]
 0x122e7e30: v16i32 = add 0x122e7730, 0x122e7650, example.c:179:14 @[ example.c:355:9 ]


                  0x12496fe0: v16i32,ch = X86ISD::VBROADCAST_LOAD<(load (s32) from constant-pool)> 0x12021300, 0x12080290, example.c:144:14 @[ example.c:355:9 ]

 0x11fd8bf0: v16i32 = X86ISD::VSRAI 0x12364cc0, TargetConstant:i8<12>, example.c:165:14 @[ example.c:355:9 ]
                0x12364cc0: v16i32 = bitcast 0x124969c0, example.c:164:14 @[ example.c:355:9 ]
 0x124969c0: v8i64 = X86ISD::SHUF128 0x12119a10, 0x12496800, TargetConstant:i8<-28>, example.c:164:14 @[ example.c:355:9 ]


In function: svt_av1_inv_txfm2d_add_8x8_sse4_1
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: /opt/compiler-explorer/clang-trunk/bin/clang -g -o /app/output.s -mllvm --x86-asm-syntax=intel -fno-verbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -O3 -march=znver5 -fprofile-generate -mllvm -slp-revec -mllvm -inline-threshold=349 <source>
1.	<eof> parser at end of file
2.	Code generation
3.	Running pass 'Function Pass Manager' on module '<source>'.
4.	Running pass 'X86 DAG->DAG Instruction Selection' on function '@svt_av1_inv_txfm2d_add_8x8_sse4_1'
 #0 0x0000000003df8838 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3df8838)
 #1 0x0000000003df622c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3df622c)
 #2 0x0000000003d396f3 llvm::CrashRecoveryContext::HandleExit(int) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3d396f3)
 #3 0x0000000003deda8e llvm::sys::Process::Exit(int, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+0x3deda8e)
 #4 0x0000000000ded5cb <truncated>Please see the issue for the entire body.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to