[SCEV] Factor out getUsedLoops

The patch introduces the new function in ScalarEvolution to get
all loops used in specified SCEV.

This is a preparation for re-writing isKnownPredicate utility as
described in https://reviews.llvm.org/D42417.

Reviewers: sanjoy, mkazantsev, reames
Reviewed By: sanjoy
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D43504


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326072 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed