This fixes PR21792 by handling an additional case in constrainLocalCopy.
This should probably be generalized, but I don't understand the code well enough to figure out how, yet.
Any suggestions on how to improve this are welcome.
Differential D6823
[MIScheduler] Slightly better handling of constrainLocalCopy when both source and dest are local mkuper on Jan 1 2015, 6:25 AM. Authored by
Details This fixes PR21792 by handling an additional case in constrainLocalCopy. This should probably be generalized, but I don't understand the code well enough to figure out how, yet.
Diff Detail
Event TimelineComment Actions Hi Michael, I am not familiar with that code either but the current patch makes sense to me. Now looking for a generalization, I guess we could loop over all the local candidate and try to apply the transformation until we looked for all or one work. Your patch does: The generalization would be: try apply if success -> exit Where the list of candidates is the local virtual registers. Anyhow, Andy would have a much more educated answer. Thanks, Comment Actions Thanks for the improvement! Your test case comment lists an incorrect bug number: PR21972. I'm not sure the logic makes sense to me. What if DstReg is local, and SrcReg is global, but a single interval? Now we'll just fail. I don't think your example has any live intervals with "holes". I think you just wanted to change the bias from Local=DstReg to Local=SrcReg because the contraints will happen to work in that case. I would avoid checking LI->size() == 1. I'm not sure it's really relevant. For example, two-address instructions may tie two segments together like this: I think you can just reverse the default global LI. It really looks like that's what I intended. I have no idea why I defaulted to SrcReg=Global. It may have just been messed up during code cleanup. I would try this: + If both the copy's source and dest are local live intervals, then we If you do that, it looks like a trivial fix is needed in the widen_load-2.ll test. Comment Actions Thanks a lot, Andrew! As I wrote on the PR, I don't fully understand the surrounding code. Anyway, if you're sure that treating the dest as the "global" works in all cases, I'm perfectly ok with that as well. :-) Michael |