[PATCH] D159205: [SLP]Try to vectorize scalars, being vectorized already, but do not need to be scheduled.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 20 05:32:48 PDT 2023


ABataev added a comment.

In D159205#4648704 <https://reviews.llvm.org/D159205#4648704>, @bgraur wrote:

> Heads-up: this revision is causing a crash in the LTO compiler backend.
>
> Here's the stack trace:
>
>    #3 0x000055b7d3018588 llvm::slpvectorizer::BoUpSLP::vectorizeTree(llvm::slpvectorizer::BoUpSLP::TreeEntry*) (build/clang+0x8818588)
>    #4 0x000055b7d30184dd llvm::slpvectorizer::BoUpSLP::vectorizeOperand(llvm::slpvectorizer::BoUpSLP::TreeEntry*, unsigned int) (build/clang+0x88184dd)
>    #5 0x000055b7d30186d2 llvm::slpvectorizer::BoUpSLP::vectorizeTree(llvm::slpvectorizer::BoUpSLP::TreeEntry*) (build/clang+0x88186d2)
>    #6 0x000055b7d3017cda llvm::slpvectorizer::BoUpSLP::vectorizeOperand(llvm::slpvectorizer::BoUpSLP::TreeEntry*, unsigned int) (build/clang+0x8817cda)
>    #7 0x000055b7d30186d2 llvm::slpvectorizer::BoUpSLP::vectorizeTree(llvm::slpvectorizer::BoUpSLP::TreeEntry*) (build/clang+0x88186d2)
>    #8 0x000055b7d3017cda llvm::slpvectorizer::BoUpSLP::vectorizeOperand(llvm::slpvectorizer::BoUpSLP::TreeEntry*, unsigned int) (build/clang+0x8817cda)
>    #9 0x000055b7d30186d2 llvm::slpvectorizer::BoUpSLP::vectorizeTree(llvm::slpvectorizer::BoUpSLP::TreeEntry*) (build/clang+0x88186d2)
>   #10 0x000055b7d3017cda llvm::slpvectorizer::BoUpSLP::vectorizeOperand(llvm::slpvectorizer::BoUpSLP::TreeEntry*, unsigned int) (build/clang+0x8817cda)
>   #11 0x000055b7d3019acd llvm::slpvectorizer::BoUpSLP::vectorizeTree(llvm::slpvectorizer::BoUpSLP::TreeEntry*) (build/clang+0x8819acd)
>   #12 0x000055b7d301d763 llvm::slpvectorizer::BoUpSLP::vectorizeTree(llvm::MapVector<llvm::Value*, llvm::SmallVector<llvm::Instruction*, 2u>, llvm::DenseMap<llvm::Value*, unsigned int, llvm::DenseMapInfo<llvm::Value*, void>, llvm::detail::DenseMapPair<llvm::Value*, unsigned int>>, llvm::SmallVector<std::__u::pair<llvm::Value*, llvm::SmallVector<llvm::Instruction*, 2u>>, 0u>> const&, llvm::SmallVectorImpl<std::__u::pair<llvm::Value*, llvm::Value*>>&, llvm::Instruction*) (build/clang+0x881d763)
>   #13 0x000055b7d301d597 llvm::slpvectorizer::BoUpSLP::vectorizeTree() (build/clang+0x881d597)
>   #14 0x000055b7d302bd9e llvm::SLPVectorizerPass::tryToVectorizeList(llvm::ArrayRef<llvm::Value*>, llvm::slpvectorizer::BoUpSLP&, bool) (build/clang+0x882bd9e)
>   #15 0x000055b7d3030735 bool tryToVectorizeSequence<llvm::Value>(llvm::SmallVectorImpl<llvm::Value*>&, llvm::function_ref<bool (llvm::Value*, llvm::Value*)>, llvm::function_ref<bool (llvm::Value*, llvm::Value*)>, llvm::function_ref<bool (llvm::ArrayRef<llvm::Value*>, bool)>, bool, llvm::slpvectorizer::BoUpSLP&) (build/clang+0x8830735)
>   #16 0x000055b7d302777f llvm::SLPVectorizerPass::vectorizeChainsInBlock(llvm::BasicBlock*, llvm::slpvectorizer::BoUpSLP&) (build/clang+0x882777f)
>   #17 0x000055b7d3025e1d llvm::SLPVectorizerPass::runImpl(llvm::Function&, llvm::ScalarEvolution*, llvm::TargetTransformInfo*, llvm::TargetLibraryInfo*, llvm::AAResults*, llvm::LoopInfo*, llvm::DominatorTree*, llvm::AssumptionCache*, llvm::DemandedBits*, llvm::OptimizationRemarkEmitter*) (build/clang+0x8825e1d)
>   #18 0x000055b7d3025726 llvm::SLPVectorizerPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (build/clang+0x8825726)
>   #19 0x000055b7d212edb2 llvm::detail::PassModel<llvm::Function, llvm::SLPVectorizerPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (build/clang+0x792edb2)
>   #20 0x000055b7d3755cf5 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (build/clang+0x8f55cf5)
>   #21 0x000055b7cf116812 llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (build/clang+0x4916812)
>   #22 0x000055b7d3758029 llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (build/clang+0x8f58029)
>   #23 0x000055b7cf111a32 llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (build/clang+0x4911a32)
>   #24 0x000055b7d37551f5 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (build/clang+0x8f551f5)
>   #25 0x000055b7cf5b9f5e llvm::lto::opt(llvm::lto::Config const&, llvm::TargetMachine*, unsigned int, llvm::Module&, bool, llvm::ModuleSummaryIndex*, llvm::ModuleSummaryIndex const*, std::__u::vector<unsigned char, std::__u::allocator<unsigned char>> const&) (build/clang+0x4db9f5e)
>   #26 0x000055b7cf5bc4e5 llvm::lto::thinBackend(llvm::lto::Config const&, unsigned int, std::__u::function<llvm::Expected<std::__u::unique_ptr<llvm::CachedFileStream, std::__u::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, llvm::Module&, llvm::ModuleSummaryIndex const&, llvm::DenseMap<llvm::StringRef, std::__u::unordered_set<unsigned long, std::__u::hash<unsigned long>, std::__u::equal_to<unsigned long>, std::__u::allocator<unsigned long>>, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, std::__u::unordered_set<unsigned long, std::__u::hash<unsigned long>, std::__u::equal_to<unsigned long>, std::__u::allocator<unsigned long>>>> const&, llvm::DenseMap<unsigned long, llvm::GlobalValueSummary*, llvm::DenseMapInfo<unsigned long, void>, llvm::detail::DenseMapPair<unsigned long, llvm::GlobalValueSummary*>> const&, llvm::MapVector<llvm::StringRef, llvm::BitcodeModule, llvm::DenseMap<llvm::StringRef, unsigned int, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, unsigned int>>, llvm::SmallVector<std::__u::pair<llvm::StringRef, llvm::BitcodeModule>, 0u>>*, std::__u::vector<unsigned char, std::__u::allocator<unsigned char>> const&)::$_0::operator()(llvm::Module&, llvm::TargetMachine*, std::__u::unique_ptr<llvm::ToolOutputFile, std::__u::default_delete<llvm::ToolOutputFile>>) const (build/clang+0x4dbc4e5)
>   #27 0x000055b7cf5bc418 llvm::lto::thinBackend(llvm::lto::Config const&, unsigned int, std::__u::function<llvm::Expected<std::__u::unique_ptr<llvm::CachedFileStream, std::__u::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, llvm::Module&, llvm::ModuleSummaryIndex const&, llvm::DenseMap<llvm::StringRef, std::__u::unordered_set<unsigned long, std::__u::hash<unsigned long>, std::__u::equal_to<unsigned long>, std::__u::allocator<unsigned long>>, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, std::__u::unordered_set<unsigned long, std::__u::hash<unsigned long>, std::__u::equal_to<unsigned long>, std::__u::allocator<unsigned long>>>> const&, llvm::DenseMap<unsigned long, llvm::GlobalValueSummary*, llvm::DenseMapInfo<unsigned lng, void>, llvm::detail::DenseMapPair<unsigned long, llvm::GlobalValueSummary*>> const&, llvm::MapVector<llvm::StringRef, llvm::BitcodeModule, llvm::DenseMap<llvm::StringRef, unsigned int, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, unsigned int>>, llvm::SmallVector<std::__u::pair<llvm::StringRef, llvm::BitcodeModule>, 0u>>*, std::__u::vector<unsigned char, std::__u::allocator<unsigned char>> const&) (build/clang+0x4dbc418)
>   #28 0x000055b7cf1070c8 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::__u::unique_ptr<llvm::raw_pwrite_stream, std::__u::default_delete<llvm::raw_pwrite_stream>>) (build/clang+0x49070c8)
>   #29 0x000055b7cf103423 clang::CodeGenAction::ExecuteAction() (build/clang+0x4903423)
>   #30 0x000055b7cfc78bba clang::FrontendAction::Execute() (build/clang+0x5478bba)
>   #31 0x000055b7cfbebe94 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (build/clang+0x53ebe94)
>   #32 0x000055b7cedad069 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (build/clang+0x45ad069)
>   #33 0x000055b7ceda1705 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (build/clang+0x45a1705)
>   #34 0x000055b7ced9f424 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) (build/clang+0x459f424)
>   #35 0x000055b7cfd7f31e void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::__u::optional<llvm::StringRef>>, std::__u::basic_string<char, std::__u::char_traits<char>, std::__u::allocator<char>>*, bool*) const::$_0>(long) (build/clang+0x557f31e)
>   #36 0x000055b7d38b2fcf llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (build/clang+0x90b2fcf)
>   #37 0x000055b7cfd7eabb clang::driver::CC1Command::Execute(llvm::ArrayRef<std::__u::optional<llvm::StringRef>>, std::__u::basic_string<char, std::__u::char_traits<char>, std::__u::allocator<char>>*, bool*) const (build/clang+0x557eabb)
>   #38 0x000055b7cfd3e734 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (build/clang+0x553e734)
>   #39 0x000055b7cfd3ec8f clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::__u::pair<int, clang::driver::Command const*>>&, bool) const (build/clang+0x553ec8f)
>   #40 0x000055b7cfd5dff0 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::__u::pair<int, clang::driver::Command const*>>&) (build/clang+0x555dff0)
>   #41 0x000055b7ced9e891 clang_main(int, char**, llvm::ToolContext const&) (build/clang+0x459e891)
>   #42 0x000055b7ced9b3c4 main (build/clang+0x459b3c4)
>   #43 0x00007f29fdd91633 __libc_start_main
>   #44 0x000055b7ced9b32a _start (build/clang+0x459b32a)
>   clang: error: clang frontend command failed with exit code 139 (use -v to see invocation)
>
> @ABataev : coming up with a reduced reproducer might take some time, could you please revert to green until then?

Hi, could you provide top most part of the crash report? I have the idea what's the cause but I need to confirm it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D159205/new/

https://reviews.llvm.org/D159205



More information about the llvm-commits mailing list