[llvm] [Support] Assert that DomTree nodes share parent (PR #101198)

LLVM Continuous Integration via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 10 10:23:29 PDT 2024


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `flang-aarch64-sharedlibs` running on `linaro-flang-aarch64-sharedlibs` while building `llvm` at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/80/builds/1980

Here is the relevant piece of the build log for the reference:
```
Step 5 (build-unified-tree) failure: build (failure)
...
1.120 [4/21/27] Building CXX object openmp/runtime/src/CMakeFiles/omp.dir/kmp_taskdeps.cpp.o
1.312 [4/20/28] Building CXX object openmp/runtime/src/CMakeFiles/omp.dir/kmp_sched.cpp.o
1.332 [4/19/29] Building CXX object openmp/runtime/src/CMakeFiles/omp.dir/thirdparty/ittnotify/ittnotify_static.cpp.o
1.403 [4/18/30] Building CXX object openmp/runtime/src/CMakeFiles/omp.dir/kmp_collapse.cpp.o
1.480 [4/17/31] Building CXX object openmp/libompd/src/CMakeFiles/ompd.dir/omp-debug.cpp.o
1.641 [4/16/32] Building CXX object openmp/runtime/src/CMakeFiles/omp.dir/kmp_lock.cpp.o
1.669 [4/15/33] Building CXX object openmp/libompd/src/CMakeFiles/ompd.dir/omp-icv.cpp.o
1.689 [4/14/34] Building CXX object openmp/runtime/src/CMakeFiles/omp.dir/kmp_csupport.cpp.o
1.876 [4/13/35] Building CXX object openmp/runtime/src/CMakeFiles/omp.dir/z_Linux_util.cpp.o
2.138 [4/12/36] Building CXX object openmp/runtime/src/CMakeFiles/omp.dir/kmp_affinity.cpp.o
FAILED: openmp/runtime/src/CMakeFiles/omp.dir/kmp_affinity.cpp.o 
/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/./bin/clang++ --target=aarch64-unknown-linux-gnu -D_DEBUG -D_GLIBCXX_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Domp_EXPORTS -I/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/runtimes/runtimes-bins/openmp/runtime/src -I/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/llvm-project/openmp/runtime/src -I/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/llvm-project/openmp/runtime/src/i18n -I/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/llvm-project/openmp/runtime/src/include -I/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/llvm-project/openmp/runtime/src/thirdparty/ittnotify -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wall -fcolor-diagnostics -Wcast-qual -Wformat-pedantic -Wimplicit-fallthrough -Wsign-compare -Wno-extra -Wno-pedantic -fno-semantic-interposition -fdata-sections -O3 -DNDEBUG -fPIC   -D _GNU_SOURCE -D _REENTRANT -U_GLIBCXX_ASSERTIONS -UNDEBUG -std=c++17 -fno-exceptions -fno-rtti -Wno-covered-switch-default -Wno-frame-address -Wno-strict-aliasing -Wno-switch -Wno-uninitialized -Wno-return-type-c-linkage -Wno-cast-qual -Wno-int-to-void-pointer-cast -MD -MT openmp/runtime/src/CMakeFiles/omp.dir/kmp_affinity.cpp.o -MF openmp/runtime/src/CMakeFiles/omp.dir/kmp_affinity.cpp.o.d -o openmp/runtime/src/CMakeFiles/omp.dir/kmp_affinity.cpp.o -c /home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/llvm-project/openmp/runtime/src/kmp_affinity.cpp
clang++: ../llvm-project/llvm/include/llvm/Support/GenericDomTree.h:401: DomTreeNodeBase<NodeT> *llvm::DominatorTreeBase<llvm::BasicBlock, false>::getNode(const NodeT *) const [NodeT = llvm::BasicBlock, IsPostDom = false]: Assertion `(!BB || Parent == NodeTrait::getParent(const_cast<NodeT *>(BB))) && "cannot get DomTreeNode of block with different parent"' 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: /home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/./bin/clang++ --target=aarch64-unknown-linux-gnu -D_DEBUG -D_GLIBCXX_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Domp_EXPORTS -I/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/runtimes/runtimes-bins/openmp/runtime/src -I/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/llvm-project/openmp/runtime/src -I/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/llvm-project/openmp/runtime/src/i18n -I/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/llvm-project/openmp/runtime/src/include -I/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/llvm-project/openmp/runtime/src/thirdparty/ittnotify -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wall -fcolor-diagnostics -Wcast-qual -Wformat-pedantic -Wimplicit-fallthrough -Wsign-compare -Wno-extra -Wno-pedantic -fno-semantic-interposition -fdata-sections -O3 -DNDEBUG -fPIC -D _GNU_SOURCE -D _REENTRANT -U_GLIBCXX_ASSERTIONS -UNDEBUG -std=c++17 -fno-exceptions -fno-rtti -Wno-covered-switch-default -Wno-frame-address -Wno-strict-aliasing -Wno-switch -Wno-uninitialized -Wno-return-type-c-linkage -Wno-cast-qual -Wno-int-to-void-pointer-cast -MD -MT openmp/runtime/src/CMakeFiles/omp.dir/kmp_affinity.cpp.o -MF openmp/runtime/src/CMakeFiles/omp.dir/kmp_affinity.cpp.o.d -o openmp/runtime/src/CMakeFiles/omp.dir/kmp_affinity.cpp.o -c /home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/llvm-project/openmp/runtime/src/kmp_affinity.cpp
1.	<eof> parser at end of file
2.	Optimizer
3.	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-use-loop-info;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;forward-switch-cond;switch-range-to-icmp;switch-to-lookup;no-keep-loops;hoist-common-insts;sink-common-insts;speculate-blocks;simplify-cond-branch;no-speculate-unpredictables>,slp-vectorizer,vector-combine,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop-unroll<O3>,transform-warning,sroa<preserve-cfg>,infer-alignment,instcombine<max-iterations=1;no-use-loop-info;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;no-sink-common-insts;speculate-blocks;simplify-cond-branch;speculate-unpredictables>)" on module "/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/llvm-project/openmp/runtime/src/kmp_affinity.cpp"
4.	Running pass "slp-vectorizer" on function "_ZN14kmp_topology_t12canonicalizeEiiii"
 #0 0x0000ffff93482398 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/bin/../lib/libLLVMSupport.so.20.0git+0x184398)
 #1 0x0000ffff9348015c llvm::sys::RunSignalHandlers() (/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/bin/../lib/libLLVMSupport.so.20.0git+0x18215c)
 #2 0x0000ffff934816f0 llvm::sys::CleanupOnSignal(unsigned long) (/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/bin/../lib/libLLVMSupport.so.20.0git+0x1836f0)
 #3 0x0000ffff933bea4c CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #4 0x0000ffff9841b598 (linux-vdso.so.1+0x598)
 #5 0x0000ffff92f08d78 raise /build/glibc-Q8DG8B/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #6 0x0000ffff92ef5aac abort /build/glibc-Q8DG8B/glibc-2.31/stdlib/abort.c:81:7
 #7 0x0000ffff92f02490 __assert_fail_base /build/glibc-Q8DG8B/glibc-2.31/assert/assert.c:89:7
 #8 0x0000ffff92f024f4 (/lib/aarch64-linux-gnu/libc.so.6+0x2d4f4)
 #9 0x0000ffff937d36a4 llvm::DominatorTreeBase<llvm::BasicBlock, false>::getNode(llvm::BasicBlock const*) const (/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/bin/../lib/libLLVMCore.so.20.0git+0x2016a4)
#10 0x0000ffff940a678c llvm::ScalarEvolution::getOperandsToCreate(llvm::Value*, llvm::SmallVectorImpl<llvm::Value*>&) (/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/bin/../lib/libLLVMAnalysis.so.20.0git+0x36178c)
#11 0x0000ffff94096b04 llvm::ScalarEvolution::createSCEVIter(llvm::Value*) (/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/bin/../lib/libLLVMAnalysis.so.20.0git+0x351b04)
#12 0x0000ffff93fb0c6c llvm::getPointersDiff(llvm::Type*, llvm::Value*, llvm::Type*, llvm::Value*, llvm::DataLayout const&, llvm::ScalarEvolution&, bool, bool) (/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/bin/../lib/libLLVMAnalysis.so.20.0git+0x26bc6c)
#13 0x0000ffff95dfd9f0 llvm::slpvectorizer::BoUpSLP::canFormVector(llvm::ArrayRef<llvm::StoreInst*>, llvm::SmallVector<unsigned int, 4u>&) const (/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/bin/../lib/libLLVMVectorize.so.20.0git+0xda9f0)
#14 0x0000ffff95dfdf84 llvm::slpvectorizer::BoUpSLP::findExternalStoreUsersReorderIndices(llvm::slpvectorizer::BoUpSLP::TreeEntry*) const (/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/bin/../lib/libLLVMVectorize.so.20.0git+0xdaf84)
#15 0x0000ffff95df5b88 llvm::slpvectorizer::BoUpSLP::reorderTopToBottom() (/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/bin/../lib/libLLVMVectorize.so.20.0git+0xd2b88)
#16 0x0000ffff95e3e36c llvm::SLPVectorizerPass::vectorizeStoreChain(llvm::ArrayRef<llvm::Value*>, llvm::slpvectorizer::BoUpSLP&, unsigned int, unsigned int, unsigned int&) (/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/bin/../lib/libLLVMVectorize.so.20.0git+0x11b36c)
#17 0x0000ffff95e40788 llvm::SLPVectorizerPass::vectorizeStores(llvm::ArrayRef<llvm::StoreInst*>, llvm::slpvectorizer::BoUpSLP&, llvm::DenseSet<std::tuple<llvm::Value*, llvm::Value*, llvm::Value*, llvm::Value*, unsigned int>, llvm::DenseMapInfo<std::tuple<llvm::Value*, llvm::Value*, llvm::Value*, llvm::Value*, unsigned int>, void>>&)::$_0::operator()(std::set<std::pair<unsigned int, int>, llvm::SLPVectorizerPass::vectorizeStores(llvm::ArrayRef<llvm::StoreInst*>, llvm::slpvectorizer::BoUpSLP&, llvm::DenseSet<std::tuple<llvm::Value*, llvm::Value*, llvm::Value*, llvm::Value*, unsigned int>, llvm::DenseMapInfo<std::tuple<llvm::Value*, llvm::Value*, llvm::Value*, llvm::Value*, unsigned int>, void>>&)::StoreDistCompare, std::allocator<std::pair<unsigned int, int>>> const&) const SLPVectorizer.cpp:0:0
#18 0x0000ffff95e3f510 llvm::SLPVectorizerPass::vectorizeStores(llvm::ArrayRef<llvm::StoreInst*>, llvm::slpvectorizer::BoUpSLP&, llvm::DenseSet<std::tuple<llvm::Value*, llvm::Value*, llvm::Value*, llvm::Value*, unsigned int>, llvm::DenseMapInfo<std::tuple<llvm::Value*, llvm::Value*, llvm::Value*, llvm::Value*, unsigned int>, void>>&) (/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/bin/../lib/libLLVMVectorize.so.20.0git+0x11c510)
#19 0x0000ffff95e3ae3c llvm::SLPVectorizerPass::vectorizeStoreChains(llvm::slpvectorizer::BoUpSLP&) (/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/bin/../lib/libLLVMVectorize.so.20.0git+0x117e3c)
#20 0x0000ffff95e39824 llvm::SLPVectorizerPass::runImpl(llvm::Function&, llvm::ScalarEvolution*, llvm::TargetTransformInfo*, llvm::TargetLibraryInfo*, llvm::AAResults*, llvm::LoopInfo*, llvm::DominatorTree*, llvm::AssumptionCache*, llvm::DemandedBits*, llvm::OptimizationRemarkEmitter*) (/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/bin/../lib/libLLVMVectorize.so.20.0git+0x116824)
#21 0x0000ffff95e38e8c llvm::SLPVectorizerPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/bin/../lib/libLLVMVectorize.so.20.0git+0x115e8c)
#22 0x0000ffff938ae300 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/bin/../lib/libLLVMCore.so.20.0git+0x2dc300)
#23 0x0000ffff938b2a38 llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/bin/../lib/libLLVMCore.so.20.0git+0x2e0a38)
#24 0x0000ffff938ad094 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/bin/../lib/libLLVMCore.so.20.0git+0x2db094)
#25 0x0000ffff9711eee0 (anonymous namespace)::EmitAssemblyHelper::RunOptimizationPipeline(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>&, std::unique_ptr<llvm::ToolOutputFile, std::default_delete<llvm::ToolOutputFile>>&, clang::BackendConsumer*) BackendUtil.cpp:0:0
#26 0x0000ffff97114278 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::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) (/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/bin/../lib/libclangCodeGen.so.20.0git+0xef278)
#27 0x0000ffff97510284 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/bin/../lib/libclangCodeGen.so.20.0git+0x4eb284)
#28 0x0000ffff90301708 clang::ParseAST(clang::Sema&, bool, bool) (/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/bin/../lib/../lib/libclangParse.so.20.0git+0x39708)

```

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


More information about the llvm-commits mailing list