Crash in CallGraphSCCPass with -argpromotion -loop-extract-single
| Bugzilla Link | 7759 |
| Resolution | DUPLICATE |
| Resolved on | Jan 22, 2020 10:06 |
| Version | trunk |
| OS | MacOS X |
| Attachments | Reduced test case |
| Reporter | LLVM Bugzilla Contributor |
| CC | @ekatz |
Extended Description
Running opt ~/sccpass-crash.ll -argpromotion -loop-extract-single -o /dev/null results in an assertion failure in CallGraphSCCPass. I've tested this as of r109867 in a Release+Debug+Asserts build.
Assertion failed: (CallSites.empty() && "Dangling pointers found in call sites map"), function RefreshCallGraph, file /Users/collinwinter/src/llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp, line 333. 0 opt 0x0054e748 llvm::SearchForAddressOfSpecialSymbol(char const*) + 1048 1 opt 0x0054f4a6 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 1334 2 libSystem.B.dylib 0x954a92bb _sigtramp + 43 3 libSystem.B.dylib 0xffffffff _sigtramp + 1790274927 4 libSystem.B.dylib 0x9551d23a raise + 26 5 libSystem.B.dylib 0x95529679 abort + 73 6 libSystem.B.dylib 0x9551e3db __assert_rtn + 101 7 opt 0x0023edf2 (anonymous namespace)::CGPassManager::RefreshCallGraph(llvm::CallGraphSCC&, llvm::CallGraph&, bool) + 2354 8 opt 0x0023fd27 (anonymous namespace)::CGPassManager::RunAllPassesOnSCC(llvm::CallGraphSCC&, llvm::CallGraph&, bool&) + 823 9 opt 0x00240add (anonymous namespace)::CGPassManager::runOnModule(llvm::Module&) + 317 10 opt 0x004b5df6 llvm::MPPassManager::runOnModule(llvm::Module&) + 566 11 opt 0x004b61c4 llvm::PassManagerImpl::run(llvm::Module&) + 164 12 opt 0x004b62bb llvm::PassManager::run(llvm::Module&) + 27 13 opt 0x0000c714 main + 3156 14 opt 0x000020e6 start + 54 Stack dump: 0. Program arguments: /Users/collinwinter/src/llvm/obj/Release+Debug+Asserts/bin/opt /Users/collinwinter/sccpass-crash.ll -argpromotion -loop-extract-single -o /dev/null
- Running pass 'CallGraph Pass Manager' on module '/Users/collinwinter/sccpass-crash.ll'. Abort trap
mentioned in issue llvm/llvm-bugzilla-archive#8929
*** This bug has been marked as a duplicate of bug llvm/llvm-bugzilla-archive#8929 ***
Closing old bugs. Please reopen, if this is still relevant.
further reduced testcase -loop-extract-single claims to be a LoopPass but what it actually creates a new Function. That's naughty, but it has to be LoopPass in order to schedule where bugpoint needs it.
Either the loop extractor needs to learn to update the call graph, or the call graph scc pass manager needs to handle more surprising changes to the call graph. I don't like the second option since this is not its fault anyway.
In order to do that, the LoopExtractor would have to make a list of all the call sites within the code it's going to remove, perform the extraction, then tell the CG about the removals and also add the new call site it's replaced them with.