aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-06-26 19:10:05 +0000
committerChris Lattner <sabre@nondot.org>2006-06-26 19:10:05 +0000
commit3c80a51cfd5e7187439ce4c051da77ee46e0ff9a (patch)
tree2c13a675e459a9b314075abd10908e633aaa15dd
parent2b67f07d2b27fca793fb825731af1750cd1e5ddd (diff)
downloadexternal_llvm-3c80a51cfd5e7187439ce4c051da77ee46e0ff9a.tar.gz
external_llvm-3c80a51cfd5e7187439ce4c051da77ee46e0ff9a.tar.bz2
external_llvm-3c80a51cfd5e7187439ce4c051da77ee46e0ff9a.zip
random code cleanups, no functionality change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28914 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/LICM.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp
index dd66dcaf8a..2ecf6aa046 100644
--- a/lib/Transforms/Scalar/LICM.cpp
+++ b/lib/Transforms/Scalar/LICM.cpp
@@ -335,7 +335,7 @@ void LICM::HoistRegion(DominatorTree::Node *N) {
//
if (isLoopInvariantInst(I) && canSinkOrHoistInst(I) &&
isSafeToExecuteUnconditionally(I))
- hoist(I);
+ hoist(I);
}
const std::vector<DominatorTree::Node*> &Children = N->getChildren();
@@ -386,8 +386,7 @@ bool LICM::canSinkOrHoistInst(Instruction &I) {
}
return isa<BinaryOperator>(I) || isa<ShiftInst>(I) || isa<CastInst>(I) ||
- isa<SelectInst>(I) ||
- isa<GetElementPtrInst>(I);
+ isa<SelectInst>(I) || isa<GetElementPtrInst>(I);
}
/// isNotUsedInLoop - Return true if the only users of this instruction are
@@ -448,11 +447,11 @@ void LICM::sink(Instruction &I) {
if (!isExitBlockDominatedByBlockInLoop(ExitBlocks[0], I.getParent())) {
// Instruction is not used, just delete it.
CurAST->deleteValue(&I);
- I.getParent()->getInstList().erase(&I);
+ I.eraseFromParent();
} else {
// Move the instruction to the start of the exit block, after any PHI
// nodes in it.
- I.getParent()->getInstList().remove(&I);
+ I.removeFromParent();
BasicBlock::iterator InsertPt = ExitBlocks[0]->begin();
while (isa<PHINode>(InsertPt)) ++InsertPt;
@@ -461,7 +460,7 @@ void LICM::sink(Instruction &I) {
} else if (ExitBlocks.size() == 0) {
// The instruction is actually dead if there ARE NO exit blocks.
CurAST->deleteValue(&I);
- I.getParent()->getInstList().erase(&I);
+ I.eraseFromParent();
} else {
// Otherwise, if we have multiple exits, use the PromoteMem2Reg function to
// do all of the hard work of inserting PHI nodes as necessary. We convert
@@ -526,7 +525,7 @@ void LICM::sink(Instruction &I) {
// the copy.
Instruction *New;
if (InsertedBlocks.size() == 1) {
- I.getParent()->getInstList().remove(&I);
+ I.removeFromParent();
ExitBlock->getInstList().insert(InsertPt, &I);
New = &I;
} else {
@@ -546,7 +545,7 @@ void LICM::sink(Instruction &I) {
// If the instruction doesn't dominate any exit blocks, it must be dead.
if (InsertedBlocks.empty()) {
CurAST->deleteValue(&I);
- I.getParent()->getInstList().erase(&I);
+ I.eraseFromParent();
}
// Finally, promote the fine value to SSA form.
@@ -567,7 +566,7 @@ void LICM::hoist(Instruction &I) {
// Remove the instruction from its current basic block... but don't delete the
// instruction.
- I.getParent()->getInstList().remove(&I);
+ I.removeFromParent();
// Insert the new node in Preheader, before the terminator.
Preheader->getInstList().insert(Preheader->getTerminator(), &I);