Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clang failed with -O3: Assertion `DT.dominates(RHead, LHead) && "No dominance between recurrences used by one SCEV?"' failed. #58811

Closed
TatyanaDoubts opened this issue Nov 4, 2022 · 2 comments
Labels
crash Prefer [crash-on-valid] or [crash-on-invalid] llvm:SCEV Scalar Evolution

Comments

@TatyanaDoubts
Copy link

TatyanaDoubts commented Nov 4, 2022

Godbolt repro: https://godbolt.org/z/sa7vnTsb8
Run clang++ on the following test:
Test.cpp.txt

Backtrace:

clang++: /root/llvm-project/llvm/lib/Analysis/ScalarEvolution.cpp:773: llvm::Optional<int> CompareSCEVComplexity(llvm::EquivalenceClasses<const llvm::SCEV*>&, llvm::EquivalenceClasses<const llvm::Value*>&, const llvm::LoopInfo*, const llvm::SCEV*, const llvm::SCEV*, llvm::DominatorTree&, unsigned int): Assertion `DT.dominates(RHead, LHead) && "No dominance between recurrences used by one SCEV?"' 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: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -gdwarf-4 -g -o /app/output.s -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -O3 <source>
1.	<eof> parser at end of file
2.	Optimizer
  #0 0x00005621c5d4a194 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
  #1 0x00005621c5d47f2c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3fb8f2c)
  #2 0x00005621c5c83188 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
  #3 0x00007f9a06f8b420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
  #4 0x00007f9a06a5800b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
  #5 0x00007f9a06a37859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
  #6 0x00007f9a06a37729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
  #7 0x00007f9a06a48fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
  #8 0x00005621c4cb8eea (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f29eea)
  #9 0x00005621c4cc7441 void std::__merge_adaptive<llvm::SCEV const**, long, llvm::SCEV const**, __gnu_cxx::__ops::_Iter_comp_iter<GroupByComplexity(llvm::SmallVectorImpl<llvm::SCEV const*>&, llvm::LoopInfo*, llvm::DominatorTree&)::'lambda0'(llvm::SCEV const*, llvm::SCEV const*)>>(llvm::SCEV const**, llvm::SCEV const**, llvm::SCEV const**, long, long, llvm::SCEV const**, long, __gnu_cxx::__ops::_Iter_comp_iter<GroupByComplexity(llvm::SmallVectorImpl<llvm::SCEV const*>&, llvm::LoopInfo*, llvm::DominatorTree&)::'lambda0'(llvm::SCEV const*, llvm::SCEV const*)>) ScalarEvolution.cpp:0:0
 #10 0x00005621c4cc75c8 void std::__stable_sort_adaptive<llvm::SCEV const**, llvm::SCEV const**, long, __gnu_cxx::__ops::_Iter_comp_iter<GroupByComplexity(llvm::SmallVectorImpl<llvm::SCEV const*>&, llvm::LoopInfo*, llvm::DominatorTree&)::'lambda0'(llvm::SCEV const*, llvm::SCEV const*)>>(llvm::SCEV const**, llvm::SCEV const**, llvm::SCEV const**, long, __gnu_cxx::__ops::_Iter_comp_iter<GroupByComplexity(llvm::SmallVectorImpl<llvm::SCEV const*>&, llvm::LoopInfo*, llvm::DominatorTree&)::'lambda0'(llvm::SCEV const*, llvm::SCEV const*)>) ScalarEvolution.cpp:0:0
 #11 0x00005621c4cc7aaa GroupByComplexity(llvm::SmallVectorImpl<llvm::SCEV const*>&, llvm::LoopInfo*, llvm::DominatorTree&) ScalarEvolution.cpp:0:0
 #12 0x00005621c4cde51f llvm::ScalarEvolution::getAddExpr(llvm::SmallVectorImpl<llvm::SCEV const*>&, llvm::SCEV::NoWrapFlags, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f4f51f)
 #13 0x00005621c4cdf545 llvm::ScalarEvolution::getAddExpr(llvm::SmallVectorImpl<llvm::SCEV const*>&, llvm::SCEV::NoWrapFlags, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f50545)
 #14 0x00005621c3e9be46 llvm::ScalarEvolution::getAddExpr(llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV::NoWrapFlags, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x210ce46)
 #15 0x00005621c4ce49de llvm::ScalarEvolution::getMinusSCEV(llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV::NoWrapFlags, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f559de)
 #16 0x00005621c4cd8d73 llvm::ScalarEvolution::createSCEV(llvm::Value*) (.part.0) ScalarEvolution.cpp:0:0
 #17 0x00005621c4cda669 llvm::ScalarEvolution::createSCEVIter(llvm::Value*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f4b669)
 #18 0x00005621c4cd1b0f llvm::ScalarEvolution::getRangeRef(llvm::SCEV const*, llvm::ScalarEvolution::RangeSignHint) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f42b0f)
 #19 0x00005621c4ce4970 llvm::ScalarEvolution::getMinusSCEV(llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV::NoWrapFlags, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f55970)
 #20 0x00005621c4cd8d73 llvm::ScalarEvolution::createSCEV(llvm::Value*) (.part.0) ScalarEvolution.cpp:0:0
 #21 0x00005621c4cda669 llvm::ScalarEvolution::createSCEVIter(llvm::Value*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f4b669)
 #22 0x00005621c4cd1b0f llvm::ScalarEvolution::getRangeRef(llvm::SCEV const*, llvm::ScalarEvolution::RangeSignHint) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f42b0f)
 #23 0x00005621c4cd1b1d llvm::ScalarEvolution::getRangeRef(llvm::SCEV const*, llvm::ScalarEvolution::RangeSignHint) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f42b1d)
 #24 0x00005621c4cd0ee5 llvm::ScalarEvolution::getRangeRef(llvm::SCEV const*, llvm::ScalarEvolution::RangeSignHint) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f41ee5)
 #25 0x00005621c4cd0fb7 llvm::ScalarEvolution::getRangeRef(llvm::SCEV const*, llvm::ScalarEvolution::RangeSignHint) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f41fb7)
 #26 0x00005621c4ce4970 llvm::ScalarEvolution::getMinusSCEV(llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV::NoWrapFlags, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f55970)
 #27 0x00005621c4cd95a7 llvm::ScalarEvolution::createSCEV(llvm::Value*) (.part.0) ScalarEvolution.cpp:0:0
 #28 0x00005621c4cda669 llvm::ScalarEvolution::createSCEVIter(llvm::Value*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f4b669)
 #29 0x00005621c4cd1b0f llvm::ScalarEvolution::getRangeRef(llvm::SCEV const*, llvm::ScalarEvolution::RangeSignHint) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f42b0f)
 #30 0x00005621c4cd0ee5 llvm::ScalarEvolution::getRangeRef(llvm::SCEV const*, llvm::ScalarEvolution::RangeSignHint) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f41ee5)
 #31 0x00005621c4ce4970 llvm::ScalarEvolution::getMinusSCEV(llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV::NoWrapFlags, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f55970)
 #32 0x00005621c4cd8d73 llvm::ScalarEvolution::createSCEV(llvm::Value*) (.part.0) ScalarEvolution.cpp:0:0
 #33 0x00005621c4cda669 llvm::ScalarEvolution::createSCEVIter(llvm::Value*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f4b669)
 #34 0x00005621c4cd88ab llvm::ScalarEvolution::createNodeForPHI(llvm::PHINode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f498ab)
 #35 0x00005621c4cd9b8d llvm::ScalarEvolution::createSCEV(llvm::Value*) (.part.0) ScalarEvolution.cpp:0:0
 #36 0x00005621c4cda669 llvm::ScalarEvolution::createSCEVIter(llvm::Value*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f4b669)
 #37 0x00005621c4cd1b0f llvm::ScalarEvolution::getRangeRef(llvm::SCEV const*, llvm::ScalarEvolution::RangeSignHint) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f42b0f)
 #38 0x00005621c4cd1b1d llvm::ScalarEvolution::getRangeRef(llvm::SCEV const*, llvm::ScalarEvolution::RangeSignHint) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f42b1d)
 #39 0x00005621c4ce4970 llvm::ScalarEvolution::getMinusSCEV(llvm::SCEV const*, llvm::SCEV const*, llvm::SCEV::NoWrapFlags, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f55970)
 #40 0x00005621c4cd8d73 llvm::ScalarEvolution::createSCEV(llvm::Value*) (.part.0) ScalarEvolution.cpp:0:0
 #41 0x00005621c4cda669 llvm::ScalarEvolution::createSCEVIter(llvm::Value*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f4b669)
 #42 0x00005621c4cd7f4e llvm::ScalarEvolution::createAddRecFromPHI(llvm::PHINode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f48f4e)
 #43 0x00005621c4cd8806 llvm::ScalarEvolution::createNodeForPHI(llvm::PHINode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f49806)
 #44 0x00005621c4cd9b8d llvm::ScalarEvolution::createSCEV(llvm::Value*) (.part.0) ScalarEvolution.cpp:0:0
 #45 0x00005621c4cda669 llvm::ScalarEvolution::createSCEVIter(llvm::Value*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f4b669)
 #46 0x00005621c4cd88ab llvm::ScalarEvolution::createNodeForPHI(llvm::PHINode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f498ab)
 #47 0x00005621c4cd9b8d llvm::ScalarEvolution::createSCEV(llvm::Value*) (.part.0) ScalarEvolution.cpp:0:0
 #48 0x00005621c4cda669 llvm::ScalarEvolution::createSCEVIter(llvm::Value*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f4b669)
 #49 0x00005621c4cd88ab llvm::ScalarEvolution::createNodeForPHI(llvm::PHINode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f498ab)
 #50 0x00005621c4cd9b8d llvm::ScalarEvolution::createSCEV(llvm::Value*) (.part.0) ScalarEvolution.cpp:0:0
 #51 0x00005621c4cda669 llvm::ScalarEvolution::createSCEVIter(llvm::Value*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f4b669)
 #52 0x00005621c4cd7f4e llvm::ScalarEvolution::createAddRecFromPHI(llvm::PHINode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f48f4e)
 #53 0x00005621c4cd8806 llvm::ScalarEvolution::createNodeForPHI(llvm::PHINode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f49806)
 #54 0x00005621c4cd9b8d llvm::ScalarEvolution::createSCEV(llvm::Value*) (.part.0) ScalarEvolution.cpp:0:0
 #55 0x00005621c4cda669 llvm::ScalarEvolution::createSCEVIter(llvm::Value*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f4b669)
 #56 0x00005621c4cf8a02 llvm::ScalarEvolution::createNodeFromSelectLikePHI(llvm::PHINode*) (.part.0) ScalarEvolution.cpp:0:0
 #57 0x00005621c4cd884a llvm::ScalarEvolution::createNodeForPHI(llvm::PHINode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f4984a)
 #58 0x00005621c4cd9b8d llvm::ScalarEvolution::createSCEV(llvm::Value*) (.part.0) ScalarEvolution.cpp:0:0
 #59 0x00005621c4cda669 llvm::ScalarEvolution::createSCEVIter(llvm::Value*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f4b669)
 #60 0x00005621c4cd88ab llvm::ScalarEvolution::createNodeForPHI(llvm::PHINode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f498ab)
 #61 0x00005621c4cd9b8d llvm::ScalarEvolution::createSCEV(llvm::Value*) (.part.0) ScalarEvolution.cpp:0:0
 #62 0x00005621c4cda669 llvm::ScalarEvolution::createSCEVIter(llvm::Value*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f4b669)
 #63 0x00005621c4cd88ab llvm::ScalarEvolution::createNodeForPHI(llvm::PHINode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f498ab)
 #64 0x00005621c4cd9b8d llvm::ScalarEvolution::createSCEV(llvm::Value*) (.part.0) ScalarEvolution.cpp:0:0
 #65 0x00005621c4cda669 llvm::ScalarEvolution::createSCEVIter(llvm::Value*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f4b669)
 #66 0x00005621c4cd1b0f llvm::ScalarEvolution::getRangeRef(llvm::SCEV const*, llvm::ScalarEvolution::RangeSignHint) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f42b0f)
 #67 0x00005621c4cd13b9 llvm::ScalarEvolution::getRangeRef(llvm::SCEV const*, llvm::ScalarEvolution::RangeSignHint) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f423b9)
 #68 0x00005621c4cd1b1d llvm::ScalarEvolution::getRangeRef(llvm::SCEV const*, llvm::ScalarEvolution::RangeSignHint) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f42b1d)
 #69 0x00005621c4cd11d2 llvm::ScalarEvolution::getRangeRef(llvm::SCEV const*, llvm::ScalarEvolution::RangeSignHint) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f421d2)
 #70 0x00005621c4cd1017 llvm::ScalarEvolution::getRangeRef(llvm::SCEV const*, llvm::ScalarEvolution::RangeSignHint) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f42017)
 #71 0x00005621c4cd0e53 llvm::ScalarEvolution::getRangeRef(llvm::SCEV const*, llvm::ScalarEvolution::RangeSignHint) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f41e53)
 #72 0x00005621c4cd2926 llvm::ScalarEvolution::isKnownNonZero(llvm::SCEV const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x2f43926)
 #73 0x00005621c5ec2330 llvm::SCEVExpander::visitUDivExpr(llvm::SCEVUDivExpr const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4133330)
 #74 0x00005621c5ebfbd3 llvm::SCEVExpander::expand(llvm::SCEV const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4130bd3)
 #75 0x00005621c5ebfec0 llvm::SCEVExpander::expandCodeForImpl(llvm::SCEV const*, llvm::Type*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4130ec0)
 #76 0x00005621c5ec2428 llvm::SCEVExpander::visitMulExpr(llvm::SCEVMulExpr const*)::'lambda'()::operator()() const ScalarEvolutionExpander.cpp:0:0
 #77 0x00005621c5ebe8ca llvm::SCEVExpander::visitMulExpr(llvm::SCEVMulExpr const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x412f8ca)
 #78 0x00005621c5ebfbd3 llvm::SCEVExpander::expand(llvm::SCEV const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4130bd3)
 #79 0x00005621c5ebfec0 llvm::SCEVExpander::expandCodeForImpl(llvm::SCEV const*, llvm::Type*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4130ec0)
 #80 0x00005621c5ec7988 llvm::SCEVExpander::visitAddExpr(llvm::SCEVAddExpr const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4138988)
 #81 0x00005621c5ebfbd3 llvm::SCEVExpander::expand(llvm::SCEV const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4130bd3)
 #82 0x00005621c5ec62a7 llvm::SCEVExpander::visitAddRecExpr(llvm::SCEVAddRecExpr const*) (.part.0) ScalarEvolutionExpander.cpp:0:0
 #83 0x00005621c5ebfbd3 llvm::SCEVExpander::expand(llvm::SCEV const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4130bd3)
 #84 0x00005621c5ebfec0 llvm::SCEVExpander::expandCodeForImpl(llvm::SCEV const*, llvm::Type*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4130ec0)
 #85 0x00005621c5ec79d0 llvm::SCEVExpander::visitAddExpr(llvm::SCEVAddExpr const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x41389d0)
 #86 0x00005621c5ebfbd3 llvm::SCEVExpander::expand(llvm::SCEV const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4130bd3)
 #87 0x00005621c5ebfec0 llvm::SCEVExpander::expandCodeForImpl(llvm::SCEV const*, llvm::Type*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4130ec0)
 #88 0x00005621c5f70a39 CreateStepValue(llvm::SCEV const*, llvm::ScalarEvolution&, llvm::Instruction*, llvm::Loop*) (.constprop.0) LoopVectorize.cpp:0:0
 #89 0x00005621c5f8eec8 llvm::InnerLoopVectorizer::createInductionResumeValue(llvm::PHINode*, llvm::InductionDescriptor const&, llvm::ArrayRef<llvm::BasicBlock*>, std::pair<llvm::BasicBlock*, llvm::Value*>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x41ffec8)
 #90 0x00005621c5f8f3a8 llvm::InnerLoopVectorizer::createInductionResumeValues(std::pair<llvm::BasicBlock*, llvm::Value*>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x42003a8)
 #91 0x00005621c5faaaa8 llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x421baa8)
 #92 0x00005621c5fbd5a6 llvm::LoopVectorizationPlanner::executePlan(llvm::ElementCount, unsigned int, llvm::VPlan&, llvm::InnerLoopVectorizer&, llvm::DominatorTree*, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x422e5a6)
 #93 0x00005621c5fc7274 llvm::LoopVectorizePass::processLoop(llvm::Loop*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4238274)
 #94 0x00005621c5fc7d90 llvm::LoopVectorizePass::runImpl(llvm::Function&, llvm::ScalarEvolution&, llvm::LoopInfo&, llvm::TargetTransformInfo&, llvm::DominatorTree&, llvm::BlockFrequencyInfo&, llvm::TargetLibraryInfo*, llvm::DemandedBits&, llvm::AAResults&, llvm::AssumptionCache&, llvm::LoopAccessInfoManager&, llvm::OptimizationRemarkEmitter&, llvm::ProfileSummaryInfo*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4238d90)
 #95 0x00005621c5fc8594 llvm::LoopVectorizePass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4239594)
 #96 0x00005621c726d0a6 llvm::detail::PassModel<llvm::Function, llvm::LoopVectorizePass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x54de0a6)
 #97 0x00005621c3575f44 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>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x17e6f44)
 #98 0x00005621c54e88cf llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x37598cf)
 #99 0x00005621c355be86 llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x17cce86)
#100 0x00005621c54e6a2a llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3757a2a)
#101 0x00005621c611dcd0 (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>>&) BackendUtil.cpp:0:0
#102 0x00005621c6120262 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4391262)
#103 0x00005621c707b21b clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x52ec21b)
#104 0x00005621c83173a5 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x65883a5)
#105 0x00005621c7079c98 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x52eac98)
#106 0x00005621c690acf9 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4b7bcf9)
#107 0x00005621c689170e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4b0270e)
#108 0x00005621c69eff73 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4c60f73)
#109 0x00005621c31fec74 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x146fc74)
#110 0x00005621c31faa77 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#111 0x00005621c66fd259 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#112 0x00005621c5c8392a llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3ef492a)
#113 0x00005621c66fdaaf clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#114 0x00005621c66c6ed9 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4937ed9)
#115 0x00005621c66c795d clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x493895d)
#116 0x00005621c66d134c clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x494234c)
#117 0x00005621c31fd262 clang_main(int, char**) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x146e262)
#118 0x00007f9a06a39083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#119 0x00005621c31f63ae _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x14673ae)
clang-16: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134
@EugeneZelenko EugeneZelenko added llvm:SCEV Scalar Evolution crash Prefer [crash-on-valid] or [crash-on-invalid] and removed new issue labels Nov 4, 2022
@fhahn
Copy link
Contributor

fhahn commented Nov 7, 2022

Potential fix: https://reviews.llvm.org/D137588

@fhahn
Copy link
Contributor

fhahn commented Apr 10, 2023

Potential fix: https://reviews.llvm.org/D137588

That was going in the wrong direction and didn't fully fix the issue. I started a new patch: https://reviews.llvm.org/D147965

fhahn added a commit that referenced this issue Apr 17, 2023
@fhahn fhahn closed this as completed in b85a402 May 4, 2023
flemairen6 pushed a commit to Xilinx/llvm-project that referenced this issue May 10, 2023
fhahn added a commit that referenced this issue May 11, 2023
Update skeleton creation logic to use SCEV expansion results from
expanding the pre-header. This avoids another set of SCEV expansions
that may happen after the CFG has been modified.

Fixes #58811.

Depends on D147964.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D147965
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash Prefer [crash-on-valid] or [crash-on-invalid] llvm:SCEV Scalar Evolution
Projects
None yet
Development

No branches or pull requests

3 participants