diff options
| author | Chris Lattner <sabre@nondot.org> | 2004-04-18 22:46:08 +0000 | 
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2004-04-18 22:46:08 +0000 | 
| commit | fc44a25bcbfcb8f7723361dc5bbb60015c7a9e45 (patch) | |
| tree | 87b17d57a0756bd3d79d27340748f2c0d052f801 /llvm/lib/Transforms | |
| parent | 26ba2f5fe8c86ad23d65fd4b84d241e063fba780 (diff) | |
| download | bcm5719-llvm-fc44a25bcbfcb8f7723361dc5bbb60015c7a9e45.tar.gz bcm5719-llvm-fc44a25bcbfcb8f7723361dc5bbb60015c7a9e45.zip | |
Move isLoopInvariant to the Loop class
llvm-svn: 13051
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LICM.cpp | 12 | 
1 files changed, 2 insertions, 10 deletions
| diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp index a02b66b20d6..13d8a53b519 100644 --- a/llvm/lib/Transforms/Scalar/LICM.cpp +++ b/llvm/lib/Transforms/Scalar/LICM.cpp @@ -176,14 +176,6 @@ namespace {        return CurAST->getAliasSetForPointer(V, 0).isMod();      } -    /// isLoopInvariant - Return true if the specified value is loop invariant -    /// -    inline bool isLoopInvariant(Value *V) { -      if (Instruction *I = dyn_cast<Instruction>(V)) -        return !CurLoop->contains(I->getParent()); -      return true;  // All non-instructions are loop invariant -    } -      bool canSinkOrHoistInst(Instruction &I);      bool isLoopInvariantInst(Instruction &I);      bool isNotUsedInLoop(Instruction &I); @@ -421,7 +413,7 @@ bool LICM::isNotUsedInLoop(Instruction &I) {  bool LICM::isLoopInvariantInst(Instruction &I) {    // The instruction is loop invariant if all of its operands are loop-invariant    for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) -    if (!isLoopInvariant(I.getOperand(i))) +    if (!CurLoop->isLoopInvariant(I.getOperand(i)))        return false;    // If we got this far, the instruction is loop invariant! @@ -714,7 +706,7 @@ void LICM::findPromotableValuesInLoop(      // set, if the pointer is loop invariant, if if we are not eliminating any      // volatile loads or stores.      if (!AS.isForwardingAliasSet() && AS.isMod() && AS.isMustAlias() && -        !AS.isVolatile() && isLoopInvariant(AS.begin()->first)) { +        !AS.isVolatile() && CurLoop->isLoopInvariant(AS.begin()->first)) {        assert(AS.begin() != AS.end() &&               "Must alias set should have at least one pointer element in it!");        Value *V = AS.begin()->first; | 

