This is an archive of the discontinued LLVM Phabricator instance.

[LoopIdiom] Refactor return value of LoopIdiomRecognize::isLegalStore
ClosedPublic

Authored by dneilson on May 19 2017, 9:26 AM.

Details

Summary

This is a NFC.

This change simply refactors the return value of LoopIdiomRecognize::isLegalStore() from bool to an enumeration, and removes the return-through-parameter mechanism that the function was using. This function is constructed such that it will only ever recognize a single store idiom (memset, memset_pattern, or memcpy), and never a combination of these. As such it makes much more sense for the return value to be the single idiom that the store matches, rather than having a separate argument-return for each idiom -- it's cleaner, and makes it clearer that only a single idiom can be matched.

Diff Detail

Event Timeline

dneilson created this revision.May 19 2017, 9:26 AM
haicheng accepted this revision.May 19 2017, 9:45 AM
haicheng added a subscriber: haicheng.

LGTM!

Thanks

This revision is now accepted and ready to land.May 19 2017, 9:45 AM

Thanks. Can someone please upstream this? I do not have commit access.

anna accepted this revision.May 19 2017, 10:07 AM

Thanks Daniel for the patch. I'll upstream it after running make check.

This revision was automatically updated to reflect the committed changes.