[Mlir-commits] [mlir] [mlir][LLVM] Delete `getFixedVectorType` and `getScalableVectorType` (PR #135051)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Apr 14 21:36:25 PDT 2025


Sterling-Augustine wrote:

I have tracked down a crash in the slp vectorizer to this PR. Unfortunately, it is deep inside some highly complex private code when optimizing with thinlto. I'm working on a reduced testcase, but until then, here is the stack trace of the failure.

```
1.	Running pass "function<eager-inv>(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;>,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-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;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 "blaze-out/k8-opt/bin/spanner/storage/internal/_objs/block_format/block_data.pic.o"
2.	Running pass "slp-vectorizer" on function "_ZN7spanner7storage15RLVectorBuilderImE8ByteSizeENS0_9SizeBoundE"
 #0 0x00005646f63e1c9a llvm::sys::RunSignalHandlers() /proc/self/cwd/third_party/llvm/llvm-project/llvm/lib/Support/Signals.cpp:106:18
 #1 0x00005646f63a4ff6 (anonymous namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long) /proc/self/cwd/third_party/llvm/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:73:5
 #2 0x00005646f63a4ff6 CrashRecoverySignalHandler(int) /proc/self/cwd/third_party/llvm/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:390:51
 #3 0x00007f6f6c107e80 __restore_rt (/usr/grte/v5/lib64/libpthread.so.0+0x14e80)
 #4 0x00005646f5688a98 llvm::slpvectorizer::BoUpSLP::getOperandEntry(llvm::slpvectorizer::BoUpSLP::TreeEntry const*, unsigned int) const /proc/self/cwd/third_party/llvm/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:12356:16
 #5 0x00005646f566c33d llvm::slpvectorizer::BoUpSLP::getOperandEntry(llvm::slpvectorizer::BoUpSLP::TreeEntry*, unsigned int) /proc/self/cwd/third_party/llvm/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:3129:9
 #6 0x00005646f566c33d llvm::slpvectorizer::BoUpSLP::reorderBottomToTop(bool) /proc/self/cwd/third_party/llvm/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:7292:37
 #7 0x00005646f56bc3fa llvm::SLPVectorizerPass::tryToVectorizeList(llvm::ArrayRef<llvm::Value*>, llvm::slpvectorizer::BoUpSLP&, bool) /proc/self/cwd/third_party/llvm/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:21061:9
 #8 0x00005646f56c1693 llvm::function_ref<bool (llvm::ArrayRef<llvm::Value*>, bool)>::operator()(llvm::ArrayRef<llvm::Value*>, bool) const /proc/self/cwd/third_party/llvm/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:0:12
 #9 0x00005646f56c1693 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&) /proc/self/cwd/third_party/llvm/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:23305:11
#10 0x00005646f56b6d10 llvm::SLPVectorizerPass::vectorizeChainsInBlock(llvm::BasicBlock*, llvm::slpvectorizer::BoUpSLP&) /proc/self/cwd/third_party/llvm/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:23720:30
#11 0x00005646f56b4ea7 llvm::SLPVectorizerPass::runImpl(llvm::Function&, llvm::ScalarEvolution*, llvm::TargetTransformInfo*, llvm::TargetLibraryInfo*, llvm::AAResults*, llvm::LoopInfo*, llvm::DominatorTree*, llvm::AssumptionCache*, llvm::DemandedBits*, llvm::OptimizationRemarkEmitter*) /proc/self/cwd/third_party/llvm/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:20352:16
#12 0x00005646f56b4992 llvm::SLPVectorizerPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /proc/self/cwd/third_party/llvm/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:20280:18
#13 0x00005646f490fc32 llvm::detail::PassModel<llvm::Function, llvm::SLPVectorizerPass, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /proc/self/cwd/third_party/llvm/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:91:5
#14 0x00005646f6224f59 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /proc/self/cwd/third_party/llvm/llvm-project/llvm/include/llvm/IR/PassManagerImpl.h:85:8
#15 0x00005646f14c8212 llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /proc/self/cwd/third_party/llvm/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:91:5
#16 0x00005646f6227a10 llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /proc/self/cwd/third_party/llvm/llvm-project/llvm/lib/IR/PassManager.cpp:129:23
#17 0x00005646f14c45b2 llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /proc/self/cwd/third_party/llvm/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:91:5
#18 0x00005646f6224219 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /proc/self/cwd/third_party/llvm/llvm-project/llvm/include/llvm/IR/PassManagerImpl.h:85:8
#19 0x00005646f1768700 llvm::SmallPtrSetImplBase::~SmallPtrSetImplBase() /proc/self/cwd/third_party/llvm/llvm-project/llvm/include/llvm/ADT/SmallPtrSet.h:86:9
#20 0x00005646f1768700 llvm::PreservedAnalyses::~PreservedAnalyses() /proc/self/cwd/third_party/llvm/llvm-project/llvm/include/llvm/IR/Analysis.h:111:7
#21 0x00005646f1768700 runNewPMPasses(llvm::lto::Config const&, llvm::Module&, llvm::TargetMachine*, unsigned int, bool, llvm::ModuleSummaryIndex*, llvm::ModuleSummaryIndex const*) /proc/self/cwd/third_party/llvm/llvm-project/llvm/lib/LTO/LTOBackend.cpp:356:3
#22 0x00005646f1768700 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&) /proc/self/cwd/third_party/llvm/llvm-project/llvm/lib/LTO/LTOBackend.cpp:395:5
#23 0x00005646f176ad87 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::FunctionImporter::ImportMapTy 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>>*, bool, std::__u::function<llvm::Expected<std::__u::unique_ptr<llvm::CachedFileStream, std::__u::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, std::__u::vector<unsigned char, std::__u::allocator<unsigned char>> const&)::$_1::operator()(llvm::Module&, llvm::TargetMachine*, std::__u::unique_ptr<llvm::ToolOutputFile, std::__u::default_delete<llvm::ToolOutputFile>>) const /proc/self/cwd/third_party/llvm/llvm-project/llvm/lib/LTO/LTOBackend.cpp:633:13
#24 0x00005646f176ac24 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::FunctionImporter::ImportMapTy 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>>*, bool, std::__u::function<llvm::Expected<std::__u::unique_ptr<llvm::CachedFileStream, std::__u::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, std::__u::vector<unsigned char, std::__u::allocator<unsigned char>> const&) /proc/self/cwd/third_party/llvm/llvm-project/llvm/lib/LTO/LTOBackend.cpp:0:10
#25 0x00005646f14b9339 runThinLTOBackend(clang::CompilerInstance&, llvm::ModuleSummaryIndex*, llvm::Module*, std::__u::unique_ptr<llvm::raw_pwrite_stream, std::__u::default_delete<llvm::raw_pwrite_stream>>, std::__u::basic_string<char, std::__u::char_traits<char>, std::__u::allocator<char>>, std::__u::basic_string<char, std::__u::char_traits<char>, std::__u::allocator<char>>, clang::BackendAction) /proc/self/cwd/third_party/llvm/llvm-project/clang/lib/CodeGen/BackendUtil.cpp:1375:11
#26 0x00005646f14b9339 clang::emitBackendOutput(clang::CompilerInstance&, clang::CodeGenOptions&, 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>>, clang::BackendConsumer*) /proc/self/cwd/third_party/llvm/llvm-project/clang/lib/CodeGen/BackendUtil.cpp:1415:9
#27 0x00005646f122e598 llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>::release() /proc/self/cwd/third_party/llvm/llvm-project/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:232:9
#28 0x00005646f122e598 llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>::~IntrusiveRefCntPtr() /proc/self/cwd/third_party/llvm/llvm-project/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:196:27
#29 0x00005646f122e598 clang::CodeGenAction::ExecuteAction() /proc/self/cwd/third_party/llvm/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:1187:3
#30 0x00005646f1cecd01 clang::FrontendAction::Execute() /proc/self/cwd/third_party/llvm/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1231:10
#31 0x00005646f1c66704 llvm::Error::getPtr() const /proc/self/cwd/third_party/llvm/llvm-project/llvm/include/llvm/Support/Error.h:281:12
#32 0x00005646f1c66704 llvm::Error::operator bool() /proc/self/cwd/third_party/llvm/llvm-project/llvm/include/llvm/Support/Error.h:241:16
#33 0x00005646f1c66704 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /proc/self/cwd/third_party/llvm/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:1055:23
#34 0x00005646f122833f clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /proc/self/cwd/third_party/llvm/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:300:25
#35 0x00005646f121de91 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /proc/self/cwd/third_party/llvm/llvm-project/clang/tools/driver/cc1_main.cpp:294:15
#36 0x00005646f121afa9 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) /proc/self/cwd/third_party/llvm/llvm-project/clang/tools/driver/driver.cpp:218:12
#37 0x00005646f1dfed3e 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::operator()() const /proc/self/cwd/third_party/llvm/llvm-project/clang/lib/Driver/Job.cpp:435:30
#38 0x00005646f1dfed3e 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) /proc/self/cwd/third_party/llvm/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:12
#39 0x00005646f63a4dcf llvm::function_ref<void ()>::operator()() const /proc/self/cwd/third_party/llvm/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:0:12
#40 0x00005646f63a4dcf llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) /proc/self/cwd/third_party/llvm/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:426:3
#41 0x00005646f1dfe41a 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 /proc/self/cwd/third_party/llvm/llvm-project/clang/lib/Driver/Job.cpp:435:7
#42 0x00005646f1dc18dd clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const /proc/self/cwd/third_party/llvm/llvm-project/clang/lib/Driver/Compilation.cpp:196:15
#43 0x00005646f1dc1acf clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::__u::pair<int, clang::driver::Command const*>>&, bool) const /proc/self/cwd/third_party/llvm/llvm-project/clang/lib/Driver/Compilation.cpp:251:13
#44 0x00005646f1dde910 llvm::SmallVectorBase<unsigned int>::empty() const /proc/self/cwd/third_party/llvm/llvm-project/llvm/include/llvm/ADT/SmallVector.h:81:46
#45 0x00005646f1dde910 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::__u::pair<int, clang::driver::Command const*>>&) /proc/self/cwd/third_party/llvm/llvm-project/clang/lib/Driver/Driver.cpp:2223:23
#46 0x00005646f121a22f clang_main(int, char**, llvm::ToolContext const&) /proc/self/cwd/third_party/llvm/llvm-project/clang/tools/driver/driver.cpp:402:21
#47 0x00005646f12189b4 main /proc/self/cwd/blaze-out/k8-opt/bin/third_party/llvm/llvm-project/clang/clang-driver.cpp:17:10
#48 0x00007f6f6bf983d4 __libc_start_main (/usr/grte/v5/lib64/libc.so.6+0x613d4)
#49 0x00005646f12188ea _start /usr/grte/v5/debug-src/src/csu/../sysdeps/x86_64/start.S:122:0
clang: error: clang frontend command failed with exit code 139 (use -v to see invocation)
```

https://github.com/llvm/llvm-project/pull/135051


More information about the Mlir-commits mailing list