[IndVarSimplify][SimplifyIndVar] Move WidenIV to Utils/SimplifyIndVar. NFCI.
authorSjoerd Meijer <sjoerd.meijer@arm.com>
Thu, 5 Nov 2020 15:56:19 +0000 (15:56 +0000)
committerSjoerd Meijer <sjoerd.meijer@arm.com>
Thu, 5 Nov 2020 16:52:47 +0000 (16:52 +0000)
commit7eb70158e4d03d2c1fe430ce62aa76982a483d1b
treeed5239dc096b6918d3afcce7fd2536233832ec88
parent2c2eb5e6702bf3bbb8fb8f09790b1ab7b139e879
[IndVarSimplify][SimplifyIndVar] Move WidenIV to Utils/SimplifyIndVar. NFCI.

This moves WidenIV from IndVarSimplify to Utils/SimplifyIndVar so that we have
createWideIV available as a generic helper utility. I.e., this is not only
useful in IndVarSimplify, but could be useful for loop transformations. For
example, motivation for this refactoring is the loop flatten transformation: if
induction variables in a loop nest can be widened, we can avoid having to
perform certain overflow checks, enabling this transformation.

Differential Revision: https://reviews.llvm.org/D90421
llvm/include/llvm/Transforms/Utils/SimplifyIndVar.h
llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
llvm/lib/Transforms/Utils/SimplifyIndVar.cpp