-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
infinite recursion in scavengeregister #1796
Comments
Does -fast disable coalescing? There might be an issue there if "dead" operands are not propagated. |
yeah, could be. |
bugpoint-reduced-simplified.bc |
This bug occurs when the store in ScavengingFrameIndex has an offset greater |
RegScavenger.patch The RegScavenger mustn't be used to eliminate the ScavengingFrameIndex. |
To solve, I think the ScavengingFrameIndex offset never should be greater than When using sp: | callee saved reg || static alloca || spills |when using fp: | callee saved reg || spills || static alloca || dynamic alloca |This solves the bug for the most cases. The bug would persist only for very rare |
Fixed. The proposed idea was not implemented because the PrologEpilogInserter already |
This is the wrong fix. It's sweeping the bug under the rug. Even if disabling the use of RS when FP is used is correct (when I am not convinced of), that's up to the I've not have a chance to look into this. Please explain, in this case, why is ScavengingFrameIndex not If we ever run into situation where it's not possible to reserve a legal frame index, then we need a |
I'm not disabling the use of RS when FP is used. About 30 lines before my if (RS && RegInfo->hasFP(Fn)) { The bug was: the PrologEpilogInserter has two chunks of code to define the |
Now I understand it! :-) |
Extended Description
Get the example from #1795 (the optimized bc file), run this command:
llc attachment.cgi -o t.s -time-passes -f -fast
You get an infinite recursion:
#6132 0x0020e575 in llvm::RegScavenger::scavengeRegister ()
#6133 0x000356f5 in llvm::ARMRegisterInfo::eliminateFrameIndex ()
#6134 0x0020e575 in llvm::RegScavenger::scavengeRegister ()
#6135 0x000356f5 in llvm::ARMRegisterInfo::eliminateFrameIndex ()
#6136 0x0020e575 in llvm::RegScavenger::scavengeRegister ()
#6137 0x000356f5 in llvm::ARMRegisterInfo::eliminateFrameIndex ()
This seems to depend on -fast.
-Chris
The text was updated successfully, but these errors were encountered: