Introduce a new LoopInfo utility function makeLoopInvariant, which
authorDan Gohman <gohman@apple.com>
Tue, 14 Jul 2009 01:06:29 +0000 (01:06 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 14 Jul 2009 01:06:29 +0000 (01:06 +0000)
commita342026504e65e2c8dc5600dab4b45ab4f94026d
tree418fea323a04472d98a8cb8c7217ce2b9430ea43
parentb9e126ce7de05d580d9eb3b664487dab07304939
Introduce a new LoopInfo utility function makeLoopInvariant, which
works similar to isLoopInvariant, except that it will do trivial
hoisting to try to make the value loop invariant if it isn't already.
This makes it easier for transformation passes to clear trivial
instructions out of the way (the regular LICM pass doesn't run
until relatively late). This is code factored out of LoopSimplify
and other places.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75578 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/LoopInfo.h
lib/Analysis/LoopInfo.cpp