This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Fix std::advance slowness
ClosedPublic

Authored by apazos on Aug 22 2018, 7:23 PM.

Details

Summary

It seems std::advance template is treating "-MFI.getCalleeSavedInfo().size()" as a large unsigned value", causing slowness.

Thanks to Henrik Gustafsson for reporting the issue.

Diff Detail

Repository
rL LLVM

Event Timeline

apazos created this revision.Aug 22 2018, 7:23 PM
asb added a reviewer: asb.Aug 23 2018, 5:06 AM
asb accepted this revision.Aug 23 2018, 5:13 AM

Thanks, looks good to me.

This revision is now accepted and ready to land.Aug 23 2018, 5:13 AM
asb added a comment.Aug 23 2018, 7:12 AM

Actually, how about replacing those two lines with auto LastFrameDestroy = std::prev(MBBI, MFI.getCalleeSavedInfo().size())?

apazos updated this revision to Diff 162494.Aug 24 2018, 3:58 PM
apazos added a subscriber: llvm-commits.
This revision was automatically updated to reflect the committed changes.