[llvm] [SLP] NFC. Replace TreeEntry::setOperandsInOrder with VLOperands. (PR #113880)

Han-Kuan Chen via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 6 00:24:59 PST 2024


HanKuanChen wrote:

> Hi, I'm getting a crash after this when building 510.parest_r from SPEC CPU 2017:
> 
> ```
> Assertion failed: (isa<To>(Val) && "cast<Ty>() argument of incompatible type!"), function cast, file Casting.h, line 578.
> PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
> Stack dump:
> 0.	Program arguments: /Users/luke/Developer/llvm-project/build.release/bin/ld.lld --sysroot=/Users/luke/Developer/riscv64-linux-gnu --hash-style=gnu --eh-frame-hdr -m elf64lriscv -X -pie -dynamic-linker /lib/ld-linux-riscv64-lp64d.so.1 ... -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /Users/luke/Developer/riscv64-linux-gnu/lib/crtendS.o /Users/luke/Developer/riscv64-linux-gnu/lib/crtn.o -march=rva23u64 -O3
> 1.	Running pass "function<eager-inv>(loop-mssa(licm<allowspeculation>),gvn<>,memcpyopt,dse,move-auto-init,mldst-motion<no-split-footer-bb>,loop(indvars,loop-deletion,loop-unroll-full),loop-distribute,loop-vectorize<no-interleave-forced-only;no-vectorize-forced-only;>,infer-alignment,loop-unroll<O3>,transform-warning,sroa<preserve-cfg>,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>,sccp,instcombine<max-iterations=1;no-verify-fixpoint>,bdce,slp-vectorizer,vector-combine,infer-alignment,instcombine<max-iterations=1;no-verify-fixpoint>,loop-mssa(licm<allowspeculation>),alignment-from-assumptions,jump-threading)" on module "ld-temp.o"
> 2.	Running pass "slp-vectorizer" on function "_ZNK6dealii7FE_PolyINS_24TensorProductPolynomialsILi3EEELi3ELi3EE8get_dataENS_11UpdateFlagsERKNS_7MappingILi3ELi3EEERKNS_10QuadratureILi3EEE"
>  #0 0x0000000102f62368 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x102e32368)
>  #1 0x0000000102f60330 llvm::sys::RunSignalHandlers() (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x102e30330)
>  #2 0x0000000102f62a0c SignalHandler(int) (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x102e32a0c)
>  #3 0x000000018d545a24 (/usr/lib/system/libsystem_platform.dylib+0x18046da24)
>  #4 0x000000018d515cc0 (/usr/lib/system/libsystem_pthread.dylib+0x18043dcc0)
>  #5 0x000000018d421a40 (/usr/lib/system/libsystem_c.dylib+0x180349a40)
>  #6 0x000000018d420d30 (/usr/lib/system/libsystem_c.dylib+0x180348d30)
>  #7 0x0000000101c99414 llvm::slpvectorizer::BoUpSLP::TreeEntry::setOperand(llvm::ArrayRef<llvm::Value*>, llvm::slpvectorizer::BoUpSLP const&, bool) (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x101b69414)
>  #8 0x0000000101c8de6c llvm::slpvectorizer::BoUpSLP::buildTree_rec(llvm::ArrayRef<llvm::Value*>, unsigned int, llvm::slpvectorizer::BoUpSLP::EdgeInfo const&, unsigned int) (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x101b5de6c)
>  #9 0x0000000101c8f4a4 llvm::slpvectorizer::BoUpSLP::buildTree_rec(llvm::ArrayRef<llvm::Value*>, unsigned int, llvm::slpvectorizer::BoUpSLP::EdgeInfo const&, unsigned int) (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x101b5f4a4)
> #10 0x0000000101cd0a68 llvm::SLPVectorizerPass::vectorizeStoreChain(llvm::ArrayRef<llvm::Value*>, llvm::slpvectorizer::BoUpSLP&, unsigned int, unsigned int, unsigned int&) (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x101ba0a68)
> #11 0x0000000101cd2ba4 llvm::SLPVectorizerPass::vectorizeStores(llvm::ArrayRef<llvm::StoreInst*>, llvm::slpvectorizer::BoUpSLP&, llvm::DenseSet<std::__1::tuple<llvm::Value*, llvm::Value*, llvm::Value*, llvm::Value*, unsigned int>, llvm::DenseMapInfo<std::__1::tuple<llvm::Value*, llvm::Value*, llvm::Value*, llvm::Value*, unsigned int>, void>>&)::$_0::operator()(std::__1::set<std::__1::pair<unsigned int, int>, llvm::SLPVectorizerPass::vectorizeStores(llvm::ArrayRef<llvm::StoreInst*>, llvm::slpvectorizer::BoUpSLP&, llvm::DenseSet<std::__1::tuple<llvm::Value*, llvm::Value*, llvm::Value*, llvm::Value*, unsigned int>, llvm::DenseMapInfo<std::__1::tuple<llvm::Value*, llvm::Value*, llvm::Value*, llvm::Value*, unsigned int>, void>>&)::StoreDistCompare, std::__1::allocator<std::__1::pair<unsigned int, int>>> const&) const (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x101ba2ba4)
> #12 0x0000000101cd1d7c llvm::SLPVectorizerPass::vectorizeStores(llvm::ArrayRef<llvm::StoreInst*>, llvm::slpvectorizer::BoUpSLP&, llvm::DenseSet<std::__1::tuple<llvm::Value*, llvm::Value*, llvm::Value*, llvm::Value*, unsigned int>, llvm::DenseMapInfo<std::__1::tuple<llvm::Value*, llvm::Value*, llvm::Value*, llvm::Value*, unsigned int>, void>>&) (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x101ba1d7c)
> #13 0x0000000101ccdcb8 llvm::SLPVectorizerPass::vectorizeStoreChains(llvm::slpvectorizer::BoUpSLP&) (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x101b9dcb8)
> #14 0x0000000101cccc1c llvm::SLPVectorizerPass::runImpl(llvm::Function&, llvm::ScalarEvolution*, llvm::TargetTransformInfo*, llvm::TargetLibraryInfo*, llvm::AAResults*, llvm::LoopInfo*, llvm::DominatorTree*, llvm::AssumptionCache*, llvm::DemandedBits*, llvm::OptimizationRemarkEmitter*) (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x101b9cc1c)
> #15 0x0000000101ccc298 llvm::SLPVectorizerPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x101b9c298)
> #16 0x0000000102d9fe78 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x102c6fe78)
> #17 0x0000000102da42e8 llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x102c742e8)
> #18 0x0000000102d9f0a4 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x102c6f0a4)
> #19 0x00000001011bacec llvm::lto::opt(llvm::lto::Config const&, llvm::TargetMachine*, unsigned int, llvm::Module&, bool, llvm::ModuleSummaryIndex*, llvm::ModuleSummaryIndex const*, std::__1::vector<unsigned char, std::__1::allocator<unsigned char>> const&) (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x10108acec)
> #20 0x00000001011bb944 llvm::lto::backend(llvm::lto::Config const&, std::__1::function<llvm::Expected<std::__1::unique_ptr<llvm::CachedFileStream, std::__1::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, unsigned int, llvm::Module&, llvm::ModuleSummaryIndex&) (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x10108b944)
> #21 0x00000001011a4ccc llvm::lto::LTO::runRegularLTO(std::__1::function<llvm::Expected<std::__1::unique_ptr<llvm::CachedFileStream, std::__1::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>) (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x101074ccc)
> #22 0x00000001011a4040 llvm::lto::LTO::run(std::__1::function<llvm::Expected<std::__1::unique_ptr<llvm::CachedFileStream, std::__1::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, llvm::FileCache) (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x101074040)
> #23 0x00000001001fba34 lld::elf::BitcodeCompiler::compile() (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x1000cba34)
> #24 0x0000000100187cc8 void lld::elf::LinkerDriver::compileBitcodeFiles<llvm::object::ELFType<(llvm::endianness)1, true>>(bool) (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x100057cc8)
> #25 0x000000010016aac4 void lld::elf::LinkerDriver::link<llvm::object::ELFType<(llvm::endianness)1, true>>(llvm::opt::InputArgList&) (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x10003aac4)
> #26 0x0000000100157784 lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x100027784)
> #27 0x0000000100154968 lld::elf::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x100024968)
> #28 0x00000001005070e0 lld::unsafeLldMain(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, llvm::ArrayRef<lld::DriverDef>, bool) (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x1003d70e0)
> #29 0x0000000100131ee0 lld_main(int, char**, llvm::ToolContext const&) (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x100001ee0)
> #30 0x0000000100132624 main (/Users/luke/Developer/llvm-project/build.release/bin/lld+0x100002624)
> #31 0x000000018d1950e0 
> ```
> 
> This is with an LTO build at -O3 on rva23u64

Do you have a test?

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


More information about the llvm-commits mailing list