Added a SimplifyIndVar utility to simplify induction variable users
authorAndrew Trick <atrick@apple.com>
Wed, 10 Aug 2011 03:46:27 +0000 (03:46 +0000)
committerAndrew Trick <atrick@apple.com>
Wed, 10 Aug 2011 03:46:27 +0000 (03:46 +0000)
commit4b4bb71bcdfd8c17cd4acb6116fc9a56c5fecd47
tree8451c2af58db59a8d6fec6bcccc79ff077753ad2
parent2d31ae3d9dfb153f081a5521374b2b42befd50a1
Added a SimplifyIndVar utility to simplify induction variable users
based on ScalarEvolution without changing the induction variable phis.

This utility is the main tool of IndVarSimplifyPass, but the pass also
restructures induction variables in strange ways that are sensitive to
pass ordering. This provides a way for other loop passes to simplify
new uses of induction variables created during transformation. The
utility may be used by any pass that preserves ScalarEvolution. Soon
LoopUnroll will use it.

The net effect in this checkin is to cleanup the IndVarSimplify pass
by factoring out the SimplifyIndVar algorithm into a standalone utility.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137197 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/IVUsers.h
include/llvm/Transforms/Utils/SimplifyIndVar.h [new file with mode: 0644]
lib/Transforms/Scalar/IndVarSimplify.cpp
lib/Transforms/Utils/SimplifyIndVar.cpp [new file with mode: 0644]