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
SelectionDAG crash #30259
Comments
The following patch seems to fix the issue, but I have no idea if it's actually right: diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
|
Reproduces with 3.9 as well as trunk and 4.0, so not a recent regression. |
Arnaud, James, do you happen to know who at ARM can give feedback to this bugreport? |
I do not think we have DAG scheduler experts at hand, so you'd better move this into a proper patch + testcase and get a review on Phabricator: you'll get much more visibility from the wider community. |
I see. Eli / Michael you wanna submit this for review? |
I think the issue goes a lot deeper than checking the wrong item. As far as I understand, LiveRegDefs are supposed to be set/null exactly when the entry in LiveRegGens is. Here the SelectionDAG for BB8: SelectionDAG has 178 nodes: What happens is (chronologically backwards)
These commits could be related: I submitted Eli's proposed patch as https://reviews.llvm.org/D29492. He introduced the CallSeqEndForStart in r146087, hence should be the expert for this. |
Uploaded a patch to https://reviews.llvm.org/D31536. |
Thank you Sam. This patch certainly prevents the attached test case from crashing. Will be great to see it upstreamed. |
committed fix in r299926 |
mentioned in issue llvm/llvm-bugzilla-archive#31927 |
Extended Description
The attached test case crashes with llc. LLVM trunk r285921 on Windows 10 and Linux x86_64. Target architecture is arm-linux-gnueabihf.
Test case is derived from test-suite's oggenc.c with code generated by Polly and reduced using bugpoint -llc-safe.
$ bin/llc oggenc.ll
#0 0x0000000001307be8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (bin/llc+0x1307be8)
#1 0x000000000130583e llvm::sys::RunSignalHandlers() (bin/llc+0x130583e)
#2 0x00000000013059b2 SignalHandler(int) (bin/llc+0x13059b2)
#3 0x00007f5b5a9f13e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113e0)
#4 0x000000000114ebd1 (anonymous namespace)::ScheduleDAGRRList::PickNodeToScheduleBottomUp() [clone .constprop.284] (bin/llc+0x114ebd1)
#5 0x00000000011516e2 (anonymous namespace)::ScheduleDAGRRList::Schedule() (bin/llc+0x11516e2)
#6 0x00000000011d7d99 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (bin/llc+0x11d7d99)
#7 0x00000000011e211c llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (bin/llc+0x11e211c)
#8 0x00000000011e4339 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) [clone .part.722] [clone .constprop.746] (bin/llc+0x11e4339)
#9 0x000000000082fa54 (anonymous namespace)::ARMDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) (bin/llc+0x82fa54)
#10 0x0000000000cb6f95 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (bin/llc+0xcb6f95)
#11 0x0000000000f86ea3 llvm::FPPassManager::runOnFunction(llvm::Function&) (bin/llc+0xf86ea3)
#12 0x0000000000f86f6c llvm::FPPassManager::runOnModule(llvm::Module&) (bin/llc+0xf86f6c)
#13 0x0000000000f86a0d llvm::legacy::PassManagerImpl::run(llvm::Module&) (bin/llc+0xf86a0d)
#14 0x00000000005e6bef compileModule(char**, llvm::LLVMContext&) [clone .constprop.340] (bin/llc+0x5e6bef)
#15 0x00000000005a2580 main (bin/llc+0x5a2580)
#16 0x00007f5b59b60830 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x20830)
#17 0x00000000005da489 _start (bin/llc+0x5da489)
Stack dump:
0. Program arguments: bin/llc oggenc.ll
Segmentation fault (core dumped)
The text was updated successfully, but these errors were encountered: