diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-09-06 01:05:37 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-09-06 01:05:37 +0000 |
| commit | da24b9a49a047d62f9c505766747d38c1728fe04 (patch) | |
| tree | 79e95ab6343f1913c12334b2b691efd52d943dfd /llvm/lib/Transforms/Scalar | |
| parent | 08e3cdcffa8442585b8e6a6c2b29dfbbc05be12d (diff) | |
| download | bcm5719-llvm-da24b9a49a047d62f9c505766747d38c1728fe04.tar.gz bcm5719-llvm-da24b9a49a047d62f9c505766747d38c1728fe04.zip | |
pull a simple method out of LICM into a new
Loop::hasLoopInvariantOperands method. Remove
a useless and confusing Loop::isLoopInvariant(Instruction)
method, which didn't do what you thought it did.
No functionality change.
llvm-svn: 113133
Diffstat (limited to 'llvm/lib/Transforms/Scalar')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LICM.cpp | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp index 0399329f0dd..4cab33b30dc 100644 --- a/llvm/lib/Transforms/Scalar/LICM.cpp +++ b/llvm/lib/Transforms/Scalar/LICM.cpp @@ -193,7 +193,6 @@ namespace { } bool canSinkOrHoistInst(Instruction &I); - bool isLoopInvariantInst(Instruction &I); bool isNotUsedInLoop(Instruction &I); void PromoteAliasSet(AliasSet &AS); @@ -369,7 +368,7 @@ void LICM::HoistRegion(DomTreeNode *N) { // if all of the operands of the instruction are loop invariant and if it // is safe to hoist the instruction. // - if (isLoopInvariantInst(I) && canSinkOrHoistInst(I) && + if (CurLoop->hasLoopInvariantOperands(&I) && canSinkOrHoistInst(I) && isSafeToExecuteUnconditionally(I)) hoist(I); } @@ -452,20 +451,6 @@ bool LICM::isNotUsedInLoop(Instruction &I) { } -/// isLoopInvariantInst - Return true if all operands of this instruction are -/// loop invariant. We also filter out non-hoistable instructions here just for -/// efficiency. -/// -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 (!CurLoop->isLoopInvariant(I.getOperand(i))) - return false; - - // If we got this far, the instruction is loop invariant! - return true; -} - /// sink - When an instruction is found to only be used outside of the loop, /// this function moves it to the exit blocks and patches up SSA form as needed. /// This method is guaranteed to remove the original instruction from its |

