[LoopIdiom] Refactor return value of isLegalStore [NFC]
authorAnna Thomas <anna@azul.com>
Fri, 19 May 2017 17:05:36 +0000 (17:05 +0000)
committerAnna Thomas <anna@azul.com>
Fri, 19 May 2017 17:05:36 +0000 (17:05 +0000)
commit5ecb8f7593146672a63515ec94c0e30658d8b42c
tree43e98aca35ad5a79acfe06e85a62154cbe821b4a
parent9c913bfd49f07b51874e1c6095ef64ccc9c71a29
[LoopIdiom] Refactor return value of isLegalStore [NFC]

Summary:

This NFC 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.

Patch by Daniel Neilson!

Reviewers: anna, sanjoy, davide, haicheng

Reviewed By: anna, haicheng

Subscribers: haicheng, mzolotukhin, llvm-commits

Differential Revision: https://reviews.llvm.org/D33359

llvm-svn: 303434
llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp