[llvm-commits] Review Request: Use SmallPtrSetImpl instead of SmallPtrSet in funciton IVUsers::AddUsersIfInteresting
Jakob Stoklund Olesen
stoklund at 2pi.dk
Fri Mar 16 09:40:27 PDT 2012
On Mar 16, 2012, at 1:21 AM, Hongbin Zheng <etherzhhb at gmail.com> wrote:
> hi,
>
> This patch let the user to decide the default size of the SmallPtrSet
> which is passed to IVUsers::AddUsersIfInteresting.
Looks good to me.
/jakob
> [PATCH] Refactor: Use SmallPtrSetImpl instead of SmallPtrSet as the
> argument type of funciton IVUsers::AddUsersIfInteresting,
> let the user decide the default size.
>
> ---
> include/llvm/Analysis/IVUsers.h | 2 +-
> lib/Analysis/IVUsers.cpp | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/llvm/Analysis/IVUsers.h b/include/llvm/Analysis/IVUsers.h
> index 11d2cf0..59884de 100644
> --- a/include/llvm/Analysis/IVUsers.h
> +++ b/include/llvm/Analysis/IVUsers.h
> @@ -146,7 +146,7 @@ public:
> /// reducible SCEV, recursively add its users to the IVUsesByStride set and
> /// return true. Otherwise, return false.
> bool AddUsersIfInteresting(Instruction *I,
> - SmallPtrSet<Loop*,16> &SimpleLoopNests);
> + SmallPtrSetImpl<Loop*> &SimpleLoopNests);
>
> IVStrideUse &AddUser(Instruction *User, Value *Operand);
>
> diff --git a/lib/Analysis/IVUsers.cpp b/lib/Analysis/IVUsers.cpp
> index c598b72..df2bc1a 100644
> --- a/lib/Analysis/IVUsers.cpp
> +++ b/lib/Analysis/IVUsers.cpp
> @@ -102,7 +102,7 @@ static bool isSimplifiedLoopNest(Loop *L, const
> DominatorTree *DT,
> /// reducible SCEV, recursively add its users to the IVUsesByStride set and
> /// return true. Otherwise, return false.
> bool IVUsers::AddUsersIfInteresting(Instruction *I,
> - SmallPtrSet<Loop*,16> &SimpleLoopNests) {
> + SmallPtrSetImpl<Loop*> &SimpleLoopNests) {
> // Add this IV user to the Processed set before returning false to
> ensure that
> // all IV users are members of the set. See IVUsers::isIVUserOrOperand.
> if (!Processed.insert(I))
> --
> 1.7.5.4
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list