Handles the case where Previous doesn't come before LastPrev incorrectly.
Details
Diff Detail
Event Timeline
Thanks for the patch, response inline.
llvm/lib/Analysis/IVDescriptors.cpp | ||
---|---|---|
19 | I think this handles the case where Previous doesn't come before LastPrev incorrectly. I added an additional test that crashes with the current version of the patch (02ee3fbff816). To start with, you should be able to use return Previous->comesBefore(LastPrev); here. The reasoning is that if Previous comes before LastPrev, SinkCandidate already gets sunk after Previous, so there's nothing to do here. I put up a follow-up patch (D118642), that should handle the other case correctly. |
@fhahn ping
llvm/lib/Analysis/IVDescriptors.cpp | ||
---|---|---|
19 | Yes, Thanks a lot for extending. what need I do next step ? do you mind squash your patch D118642, or just fix the crash of your new added case 02ee3fbff816 ? |
llvm/lib/Analysis/IVDescriptors.cpp | ||
---|---|---|
19 |
As suggested in my comment, you should be able to update the patch to use return Previous->comesBefore(LastPrev) instead of if (Previous->comesBefore(LastPrev)) return true; to fix the issue. |
LGTM, thanks with the inline suggestions.
Handles the case where Previous doesn't come before LastPrev incorrectly.
Could you update the commit messages before landing this change? It should definitely handle this correctly rather than incorrectly :)
llvm/lib/Analysis/IVDescriptors.cpp | ||
---|---|---|
14 | might be more compact to just check LastPrev->getParent() != Previous->getParent(). | |
17 | Maybe add a comment along the lines If LastPrev comes after the current Previous, SinkCandidate already gets sunk past Previous and there is nothing to do. |
Oh, and could you double check this version on its own fixes https://github.com/llvm/llvm-project/issues/53483 if you include it in the commit message?
If you do not yet have commit access, please let me know if you would like me to commit the patch on your behalf. In that case, please provide the name + email to use for the git authorship.
might be more compact to just check LastPrev->getParent() != Previous->getParent().