[llvm] [SLP]Support LShr as base for copyable elements (PR #153393)
Mikael Holmen via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 1 03:46:13 PDT 2025
mikaelholmen wrote:
> > Hi @alexey-bataev
> > Another crash here with this patch: `opt -passes=slp-vectorizer bbi-109672.ll -S -o /dev/null`
> > Result:
> > ```
> > opt: ../lib/Transforms/Vectorize/SLPVectorizer.cpp:20853: auto llvm::slpvectorizer::BoUpSLP::BlockScheduling::tryScheduleBundle(ArrayRef<Value *>, BoUpSLP *, const InstructionsState &, const EdgeInfo &)::(anonymous class)::operator()(bool, ScheduleBundle &) const: Assertion `Picked->isReady() && "must be ready to schedule"' failed.
> > PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
> > Stack dump:
> > 0. Program arguments: build-all/bin/opt -passes=slp-vectorizer bbi-109672.ll -S -o /dev/null
> > 1. Running pass "function(slp-vectorizer)" on module "bbi-109672.ll"
> > 2. Running pass "slp-vectorizer" on function "main"
> > #0 0x0000556b1173f286 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (build-all/bin/opt+0x47ee286)
> > #1 0x0000556b1173c815 llvm::sys::RunSignalHandlers() (build-all/bin/opt+0x47eb815)
> > #2 0x0000556b11740409 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
> > #3 0x00007f448d3bb990 __restore_rt (/lib64/libpthread.so.0+0x12990)
> > #4 0x00007f448ad5b52f raise (/lib64/libc.so.6+0x4e52f)
> > #5 0x00007f448ad2ee65 abort (/lib64/libc.so.6+0x21e65)
> > #6 0x00007f448ad2ed39 _nl_load_domain.cold.0 (/lib64/libc.so.6+0x21d39)
> > #7 0x00007f448ad53e86 (/lib64/libc.so.6+0x46e86)
> > #8 0x0000556b1327ae22 llvm::slpvectorizer::BoUpSLP::BlockScheduling::tryScheduleBundle(llvm::ArrayRef<llvm::Value*>, llvm::slpvectorizer::BoUpSLP*, (anonymous namespace)::InstructionsState const&, llvm::slpvectorizer::BoUpSLP::EdgeInfo const&)::$_1::operator()(bool, llvm::slpvectorizer::BoUpSLP::ScheduleBundle&) const SLPVectorizer.cpp:0:0
> > #9 0x0000556b131df805 llvm::slpvectorizer::BoUpSLP::buildTreeRec(llvm::ArrayRef<llvm::Value*>, unsigned int, llvm::slpvectorizer::BoUpSLP::EdgeInfo const&, unsigned int) (build-all/bin/opt+0x628e805)
> > #10 0x0000556b131dcf36 llvm::slpvectorizer::BoUpSLP::buildTreeRec(llvm::ArrayRef<llvm::Value*>, unsigned int, llvm::slpvectorizer::BoUpSLP::EdgeInfo const&, unsigned int) (build-all/bin/opt+0x628bf36)
> > #11 0x0000556b131dcb46 llvm::slpvectorizer::BoUpSLP::buildTreeRec(llvm::ArrayRef<llvm::Value*>, unsigned int, llvm::slpvectorizer::BoUpSLP::EdgeInfo const&, unsigned int) (build-all/bin/opt+0x628bb46)
> > #12 0x0000556b131fc1ae llvm::slpvectorizer::BoUpSLP::transformNodes() (build-all/bin/opt+0x62ab1ae)
> > #13 0x0000556b1328b819 (anonymous namespace)::HorizontalReduction::tryToReduce(llvm::slpvectorizer::BoUpSLP&, llvm::DataLayout const&, llvm::TargetTransformInfo*, llvm::TargetLibraryInfo const&, llvm::AssumptionCache*) SLPVectorizer.cpp:0:0
> > #14 0x0000556b1324b367 llvm::SLPVectorizerPass::vectorizeHorReduction(llvm::PHINode*, llvm::Instruction*, llvm::BasicBlock*, llvm::slpvectorizer::BoUpSLP&, llvm::SmallVectorImpl<llvm::WeakTrackingVH>&) (build-all/bin/opt+0x62fa367)
> > #15 0x0000556b1324ca02 llvm::SLPVectorizerPass::vectorizeRootInstruction(llvm::PHINode*, llvm::Instruction*, llvm::BasicBlock*, llvm::slpvectorizer::BoUpSLP&) (build-all/bin/opt+0x62fba02)
> > #16 0x0000556b13240f9c llvm::SLPVectorizerPass::vectorizeChainsInBlock(llvm::BasicBlock*, llvm::slpvectorizer::BoUpSLP&) (build-all/bin/opt+0x62eff9c)
> > #17 0x0000556b1323db86 llvm::SLPVectorizerPass::runImpl(llvm::Function&, llvm::ScalarEvolution*, llvm::TargetTransformInfo*, llvm::TargetLibraryInfo*, llvm::AAResults*, llvm::LoopInfo*, llvm::DominatorTree*, llvm::AssumptionCache*, llvm::DemandedBits*, llvm::OptimizationRemarkEmitter*) (build-all/bin/opt+0x62ecb86)
> > #18 0x0000556b1323d0f7 llvm::SLPVectorizerPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (build-all/bin/opt+0x62ec0f7)
> > #19 0x0000556b12c0d63d llvm::detail::PassModel<llvm::Function, llvm::SLPVectorizerPass, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) PassBuilderPipelines.cpp:0:0
> > #20 0x0000556b119594d5 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (build-all/bin/opt+0x4a084d5)
> > #21 0x0000556b12c0977d llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) PassBuilderPipelines.cpp:0:0
> > #22 0x0000556b1195e08e llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (build-all/bin/opt+0x4a0d08e)
> > #23 0x0000556b12b98e1d llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) NewPMDriver.cpp:0:0
> > #24 0x0000556b119581c5 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (build-all/bin/opt+0x4a071c5)
> > #25 0x0000556b12b91c64 llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::PassPlugin>, llvm::ArrayRef<std::function<void (llvm::PassBuilder&)>>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool, bool, bool) (build-all/bin/opt+0x5c40c64)
> > #26 0x0000556b116e0a78 optMain (build-all/bin/opt+0x478fa78)
> > #27 0x00007f448ad477e5 __libc_start_main (/lib64/libc.so.6+0x3a7e5)
> > #28 0x0000556b116de4ae _start (build-all/bin/opt+0x478d4ae)
> > Abort (core dumped)
> > ```
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > I've tested against latest trunk [673750f](https://github.com/llvm/llvm-project/commit/673750feea3a5506ec7cc6271596856dcebe88c4) and it still crashes there.
> > [bbi-109672.ll.gz](https://github.com/user-attachments/files/21834949/bbi-109672.ll.gz)
>
> Must be fixed in [2824b3c](https://github.com/llvm/llvm-project/commit/2824b3c00efe79873bc1cbe8181c8c65da134996)
Yep, thanks!
https://github.com/llvm/llvm-project/pull/153393
More information about the llvm-commits
mailing list