Issue 179135
Summary Polly BlockGenerator::generateScalarStores crashes when compiling libde265
Labels new issue
Assignees
Reporter jaschiu
    Hi, when using my LLVM 21.1.8 toolchain to compile libde265, I get this stacktrace:

```
clang-21: /tmp/portage/llvm-core/polly-21.1.8/work/polly/lib/CodeGen/BlockGenerators.cpp:783: auto polly::BlockGenerator::generateScalarStores(ScopStmt &, LoopToScevMapT &, ValueMapT &, isl_id_to_ast_expr *)::(anonymous class)::operator()() const: Assertion `(!isa<Instruction>(Val) || DT.dominates(cast<Instruction>(Val)->getParent(), Builder.GetInsertBlock())) && "Domination violation"' 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: /usr/lib/llvm/21/bin/clang-21 -cc1 -triple x86_64-pc-linux-gnu -O3 -emit-llvm-bc -flto=full -flto-unit -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name fallback-dct.cc -mrelocation-model pic -pic-level 2 -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu znver4 -target-feature +prfchw -target-feature -cldemote -target-feature +avx -target-feature +aes -target-feature +sahf -target-feature +pclmul -target-feature -xop -target-feature +crc32 -target-feature -amx-fp8 -target-feature +xsaves -target-feature -avx512fp16 -target-feature -usermsr -target-feature -sm4 -target-feature -egpr -target-feature +sse4.1 -target-feature +avx512ifma -target-feature +xsave -target-feature +sse4.2 -target-feature -tsxldtrk -target-feature -sm3 -target-feature -ptwrite -target-feature -widekl -target-feature -movrs -target-feature +invpcid -target-feature +64bit -target-feature +xsavec -target-feature -avx10.1-512 -target-feature +avx512vpopcntdq -target-feature +cmov -target-feature -avx512vp2intersect -target-feature +avx512cd -target-feature +movbe -target-feature -avxvnniint8 -target-feature -ccmp -target-feature -amx-int8 -target-feature -kl -target-feature -avx10.1-256 -target-feature +evex512 -target-feature -avxvnni -target-feature -rtm -target-feature +adx -target-feature +avx2 -target-feature -hreset -target-feature -movdiri -target-feature -serialize -target-feature -sha512 -target-feature +vpclmulqdq -target-feature +avx512vl -target-feature -uintr -target-feature -cf -target-feature +clflushopt -target-feature -raoint -target-feature -cmpccxadd -target-feature +bmi -target-feature -amx-tile -target-feature +sse -target-feature -avx10.2-256 -target-feature +gfni -target-feature -avxvnniint16 -target-feature -amx-fp16 -target-feature -zu -target-feature -ndd -target-feature +xsaveopt -target-feature +rdrnd -target-feature +avx512f -target-feature -amx-bf16 -target-feature +avx512bf16 -target-feature +avx512vnni -target-feature -push2pop2 -target-feature +cx8 -target-feature +avx512bw -target-feature +sse3 -target-feature +pku -target-feature -nf -target-feature -amx-tf32 -target-feature -amx-avx512 -target-feature +fsgsbase -target-feature +clzero -target-feature +mwaitx -target-feature -lwp -target-feature +lzcnt -target-feature +sha -target-feature -movdir64b -target-feature -ppx -target-feature +wbnoinvd -target-feature -enqcmd -target-feature -amx-transpose -target-feature -avx10.2-512 -target-feature -avxneconvert -target-feature -tbm -target-feature -pconfig -target-feature -amx-complex -target-feature +ssse3 -target-feature +cx16 -target-feature +bmi2 -target-feature +fma -target-feature +popcnt -target-feature -avxifma -target-feature +f16c -target-feature +avx512bitalg -target-feature +rdpru -target-feature +clwb -target-feature +mmx -target-feature +sse2 -target-feature +rdseed -target-feature +avx512vbmi2 -target-feature -prefetchi -target-feature -amx-movrs -target-feature +rdpid -target-feature -fma4 -target-feature +avx512vbmi -target-feature +shstk -target-feature +vaes -target-feature -waitpkg -target-feature -sgx -target-feature +fxsr -target-feature +avx512dq -target-feature +sse4a -debugger-tuning=gdb -fdebug-compilation-dir=/tmp/portage/media-libs/libde265-1.0.16/work/libde265-1.0.16-abi_x86_64.amd64/libde265 -fcoverage-compilation-dir=/tmp/portage/media-libs/libde265-1.0.16/work/libde265-1.0.16-abi_x86_64.amd64/libde265 -D _GLIBCXX_ASSERTIONS -D _LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE -D HAVE_CONFIG_H -D LIBDE265_EXPORTS -D DE265_LOG_ERROR -D PIC -Werror=odr -Werror=strict-aliasing -Werror=return-type -Werror=unused-result -Werror=reorder -fdeprecated-macro -ferror-limit 19 -fopenmp -stack-protector 2 -fstack-clash-protection -fcf-protection=full -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -vectorize-loops -vectorize-slp -load LLVMPolly.so -fpass-plugin=LLVMPolly.so -mllvm -polly -mllvm -polly-vectorizer=stripmine -mllvm -polly-omp-backend=LLVM -mllvm -polly-parallel -mllvm -polly-num-threads=17 -mllvm -polly-scheduling=dynamic -D__GCC_HAVE_DWARF2_CFI_ASM=1 -x c++ fallback-dct-a8e975.cpp
1.      <eof> parser at end of file
2.      Optimizer
3.      Running pass "function<eager-inv>(float2int,lower-constant-intrinsics,chr,polly::CodePreparationPass,polly::FunctionToScopPassAdaptor<llvm::PassManager<Scop, ScopAnalysisManager, ScopStandardAnalysisResults &, SPMUpdater &>>,sroa<modify-cfg>,early-cse<memssa>,speculative-execution<only-if-divergent-target>,jump-threading,correlated-propagation,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-hoist-loads-stores-with-cond-faulting;no-sink-common-insts;speculate-blocks;simplify-cond-branch;no-speculate-unpredictables>,instcombine<max-iterations=1;no-verify-fixpoint>,aggressive-instcombine,libcalls-shrinkwrap,tailcallelim,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-hoist-loads-stores-with-cond-faulting;no-sink-common-insts;speculate-blocks;simplify-cond-branch;no-speculate-unpredictables>,reassociate,constraint-elimination,loop-mssa(loop-instsimplify,loop-simplifycfg,licm<no-allowspeculation>,loop-rotate<header-duplication;no-prepare-for-lto>,licm<allowspeculation>,simple-loop-unswitch<nontrivial;trivial>),simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-hoist-loads-stores-with-cond-faulting;no-sink-common-insts;speculate-blocks;simplify-cond-branch;no-speculate-unpredictables>,instcombine<max-iterations=1;no-verify-fixpoint>,loop(loop-idiom,indvars,extra-simple-loop-unswitch-passes,loop-deletion,loop-unroll-full),sroa<modify-cfg>,vector-combine,mldst-motion<no-split-footer-bb>,gvn<>,sccp,bdce,instcombine<max-iterations=1;no-verify-fixpoint>,jump-threading,correlated-propagation,adce,memcpyopt,dse,move-auto-init,loop-mssa(licm<allowspeculation>),coro-elide,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;hoist-common-insts;no-hoist-loads-stores-with-cond-faulting;sink-common-insts;speculate-blocks;simplify-cond-branch;no-speculate-unpredictables>,instcombine<max-iterations=1;no-verify-fixpoint>,loop(loop-rotate<header-duplication;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 "fallback-dct-a8e975.cpp"
4.      Running pass "polly::FunctionToScopPassAdaptor<llvm::PassManager<Scop, ScopAnalysisManager, ScopStandardAnalysisResults &, SPMUpdater &>>" on function "_Z33transform_bypass_rdpcm_v_fallbackPiPKsi"
 #0 0x000079fc46eed31a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm/21/bin/../lib64/libLLVM.so.21.1+0x28ed31a)
 #1 0x000079fc46eebf7d llvm::sys::RunSignalHandlers() (/usr/lib/llvm/21/bin/../lib64/libLLVM.so.21.1+0x28ebf7d)
 #2 0x000079fc46eecb84 (/usr/lib/llvm/21/bin/../lib64/libLLVM.so.21.1+0x28ecb84)
 #3 0x000079fc44052070 (/usr/lib64/libc.so.6+0x42070)
 #4 0x000079fc440b200b pthread_kill (/usr/lib64/libc.so.6+0xa200b)
 #5 0x000079fc44051f46 raise (/usr/lib64/libc.so.6+0x41f46)
 #6 0x000079fc44034f55 abort (/usr/lib64/libc.so.6+0x24f55)
 #7 0x000079fc44034ebb __assert_perror_fail (/usr/lib64/libc.so.6+0x24ebb)
 #8 0x000079fc4176c056 (/usr/lib/llvm/21/bin/../lib64/../lib64/LLVMPolly.so+0x16c056)
 #9 0x000079fc4176c6d2 polly::BlockGenerator::generateConditionalExecution(polly::ScopStmt&, isl::set const&, llvm::StringRef, std::function<void ()> const&) (/usr/lib/llvm/21/bin/../lib64/../lib64/LLVMPolly.so+0x16c6d2)
#10 0x000079fc4176bce5 polly::BlockGenerator::generateScalarStores(polly::ScopStmt&, llvm::DenseMap<llvm::Loop const*, llvm::SCEV const*, llvm::DenseMapInfo<llvm::Loop const*, void>, llvm::detail::DenseMapPair<llvm::Loop const*, llvm::SCEV const*>>&, llvm::DenseMap<llvm::AssertingVH<llvm::Value>, llvm::AssertingVH<llvm::Value>, llvm::DenseMapInfo<llvm::AssertingVH<llvm::Value>, void>, llvm::detail::DenseMapPair<llvm::AssertingVH<llvm::Value>, llvm::AssertingVH<llvm::Value>>>&, isl_id_to_ast_expr*) (/usr/lib/llvm/21/bin/../lib64/../lib64/LLVMPolly.so+0x16bce5)
#11 0x000079fc41774e15 polly::BlockGenerator::copyBB(polly::ScopStmt&, llvm::BasicBlock*, llvm::DenseMap<llvm::AssertingVH<llvm::Value>, llvm::AssertingVH<llvm::Value>, llvm::DenseMapInfo<llvm::AssertingVH<llvm::Value>, void>, llvm::detail::DenseMapPair<llvm::AssertingVH<llvm::Value>, llvm::AssertingVH<llvm::Value>>>&, llvm::DenseMap<llvm::Loop const*, llvm::SCEV const*, llvm::DenseMapInfo<llvm::Loop const*, void>, llvm::detail::DenseMapPair<llvm::Loop const*, llvm::SCEV const*>>&, isl_id_to_ast_expr*) (/usr/lib/llvm/21/bin/../lib64/../lib64/LLVMPolly.so+0x174e15)
#12 0x000079fc4178ae15 polly::IslNodeBuilder::createUser(isl_ast_node*) (/usr/lib/llvm/21/bin/../lib64/../lib64/LLVMPolly.so+0x18ae15)
#13 0x000079fc4178eae1 polly::IslNodeBuilder::createForSequential(isl::ast_node_for, bool) (/usr/lib/llvm/21/bin/../lib64/../lib64/LLVMPolly.so+0x18eae1)
#14 0x000079fc4178a2eb polly::IslNodeBuilder::createMark(isl_ast_node*) (/usr/lib/llvm/21/bin/../lib64/../lib64/LLVMPolly.so+0x18a2eb)
#15 0x000079fc4178eae1 polly::IslNodeBuilder::createForSequential(isl::ast_node_for, bool) (/usr/lib/llvm/21/bin/../lib64/../lib64/LLVMPolly.so+0x18eae1)
#16 0x000079fc4178a5fa polly::IslNodeBuilder::createFor(isl_ast_node*) (/usr/lib/llvm/21/bin/../lib64/../lib64/LLVMPolly.so+0x18a5fa)
#17 0x000079fc4178aa2d polly::IslNodeBuilder::createIf(isl_ast_node*) (/usr/lib/llvm/21/bin/../lib64/../lib64/LLVMPolly.so+0x18aa2d)
#18 0x000079fc4178af18 polly::IslNodeBuilder::createBlock(isl_ast_node*) (/usr/lib/llvm/21/bin/../lib64/../lib64/LLVMPolly.so+0x18af18)
#19 0x000079fc4178a3c3 polly::IslNodeBuilder::createMark(isl_ast_node*) (/usr/lib/llvm/21/bin/../lib64/../lib64/LLVMPolly.so+0x18a3c3)
#20 0x000079fc4178eae1 polly::IslNodeBuilder::createForSequential(isl::ast_node_for, bool) (/usr/lib/llvm/21/bin/../lib64/../lib64/LLVMPolly.so+0x18eae1)
#21 0x000079fc4178a5fa polly::IslNodeBuilder::createFor(isl_ast_node*) (/usr/lib/llvm/21/bin/../lib64/../lib64/LLVMPolly.so+0x18a5fa)
#22 0x000079fc4178d354 polly::IslNodeBuilder::createForParallel(isl_ast_node*) (/usr/lib/llvm/21/bin/../lib64/../lib64/LLVMPolly.so+0x18d354)
#23 0x000079fc4178a3c3 polly::IslNodeBuilder::createMark(isl_ast_node*) (/usr/lib/llvm/21/bin/../lib64/../lib64/LLVMPolly.so+0x18a3c3)
#24 0x000079fc4178af18 polly::IslNodeBuilder::createBlock(isl_ast_node*) (/usr/lib/llvm/21/bin/../lib64/../lib64/LLVMPolly.so+0x18af18)
#25 0x000079fc41797dc6 (/usr/lib/llvm/21/bin/../lib64/../lib64/LLVMPolly.so+0x197dc6)
#26 0x000079fc417984f8 polly::CodeGenerationPass::run(polly::Scop&, llvm::AnalysisManager<polly::Scop, polly::ScopStandardAnalysisResults&>&, polly::ScopStandardAnalysisResults&, polly::SPMUpdater&) (/usr/lib/llvm/21/bin/../lib64/../lib64/LLVMPolly.so+0x1984f8)
#27 0x000079fc417c463d (/usr/lib/llvm/21/bin/../lib64/../lib64/LLVMPolly.so+0x1c463d)
#28 0x000079fc41768fa6 llvm::PassManager<polly::Scop, llvm::AnalysisManager<polly::Scop, polly::ScopStandardAnalysisResults&>, polly::ScopStandardAnalysisResults&, polly::SPMUpdater&>::run(polly::Scop&, llvm::AnalysisManager<polly::Scop, polly::ScopStandardAnalysisResults&>&, polly::ScopStandardAnalysisResults&, polly::SPMUpdater&) (/usr/lib/llvm/21/bin/../lib64/../lib64/LLVMPolly.so+0x168fa6)
#29 0x000079fc417c61ed (/usr/lib/llvm/21/bin/../lib64/../lib64/LLVMPolly.so+0x1c61ed)
#30 0x000079fc471ba5c1 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/usr/lib/llvm/21/bin/../lib64/libLLVM.so.21.1+0x2bba5c1)
#31 0x000079fc4a03b1a1 (/usr/lib/llvm/21/bin/../lib64/libLLVM.so.21.1+0x5a3b1a1)
#32 0x000079fc471c0a28 llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/lib/llvm/21/bin/../lib64/libLLVM.so.21.1+0x2bc0a28)
#33 0x000079fc4a03d8b1 (/usr/lib/llvm/21/bin/../lib64/libLLVM.so.21.1+0x5a3d8b1)
#34 0x000079fc471b6f74 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/lib/llvm/21/bin/../lib64/libLLVM.so.21.1+0x2bb6f74)
#35 0x000079fc4dd72b88 (/usr/lib/llvm/21/bin/../lib64/libclang-cpp.so.21.1+0x2b72b88)
#36 0x000079fc4dd696df 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*) (/usr/lib/llvm/21/bin/../lib64/libclang-cpp.so.21.1+0x2b696df)
#37 0x000079fc4e1a68c2 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/usr/lib/llvm/21/bin/../lib64/libclang-cpp.so.21.1+0x2fa68c2)
#38 0x000079fc4c524a19 clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/llvm/21/bin/../lib64/libclang-cpp.so.21.1+0x1324a19)
#39 0x000079fc4ecb548f clang::FrontendAction::Execute() (/usr/lib/llvm/21/bin/../lib64/libclang-cpp.so.21.1+0x3ab548f)
#40 0x000079fc4ec06a10 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/llvm/21/bin/../lib6<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