summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-04-23 16:37:45 +0000
committerChris Lattner <sabre@nondot.org>2003-04-23 16:37:45 +0000
commit889f620841146d6f9f935f2271e80a7dddc15e25 (patch)
treeeb3b923511a1c4be6f4936462a30321f6984c395 /llvm/lib/Transforms/Scalar
parent6ee2cf5d89f1695e229926ecee821e1a22759617 (diff)
downloadbcm5719-llvm-889f620841146d6f9f935f2271e80a7dddc15e25.tar.gz
bcm5719-llvm-889f620841146d6f9f935f2271e80a7dddc15e25.zip
Remove unnecesary &*'s
llvm-svn: 5872
Diffstat (limited to 'llvm/lib/Transforms/Scalar')
-rw-r--r--llvm/lib/Transforms/Scalar/ADCE.cpp4
-rw-r--r--llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp8
-rw-r--r--llvm/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp2
-rw-r--r--llvm/lib/Transforms/Scalar/IndVarSimplify.cpp2
-rw-r--r--llvm/lib/Transforms/Scalar/LICM.cpp4
-rw-r--r--llvm/lib/Transforms/Scalar/LoopSimplify.cpp4
-rw-r--r--llvm/lib/Transforms/Scalar/LowerAllocations.cpp4
-rw-r--r--llvm/lib/Transforms/Scalar/Mem2Reg.cpp2
-rw-r--r--llvm/lib/Transforms/Scalar/Reassociate.cpp2
-rw-r--r--llvm/lib/Transforms/Scalar/SCCP.cpp2
10 files changed, 17 insertions, 17 deletions
diff --git a/llvm/lib/Transforms/Scalar/ADCE.cpp b/llvm/lib/Transforms/Scalar/ADCE.cpp
index e7bc1357ffe..5e2a2755fb7 100644
--- a/llvm/lib/Transforms/Scalar/ADCE.cpp
+++ b/llvm/lib/Transforms/Scalar/ADCE.cpp
@@ -119,7 +119,7 @@ bool ADCE::dropReferencesOfDeadInstructionsInLiveBlock(BasicBlock *BB) {
for (BasicBlock::iterator I = BB->begin(), E = --BB->end(); I != E; )
if (!LiveSet.count(I)) { // Is this instruction alive?
I->dropAllReferences(); // Nope, drop references...
- if (PHINode *PN = dyn_cast<PHINode>(&*I)) {
+ if (PHINode *PN = dyn_cast<PHINode>(I)) {
// We don't want to leave PHI nodes in the program that have
// #arguments != #predecessors, so we remove them now.
//
@@ -310,7 +310,7 @@ bool ADCE::doADCE() {
// should be identical to the incoming values for LastDead.
//
for (BasicBlock::iterator II = NextAlive->begin();
- PHINode *PN = dyn_cast<PHINode>(&*II); ++II) {
+ PHINode *PN = dyn_cast<PHINode>(II); ++II) {
// Get the incoming value for LastDead...
int OldIdx = PN->getBasicBlockIndex(LastDead);
assert(OldIdx != -1 && "LastDead is not a pred of NextAlive!");
diff --git a/llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp b/llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp
index cb8bd6109c1..c560e836975 100644
--- a/llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp
+++ b/llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp
@@ -450,11 +450,11 @@ bool CEE::ForwardCorrelatedEdgeDestination(TerminatorInst *TI, unsigned SuccNo,
// Put the newly discovered information into the RegionInfo...
for (BasicBlock::iterator I = OldSucc->begin(), E = OldSucc->end(); I!=E; ++I)
- if (PHINode *PN = dyn_cast<PHINode>(&*I)) {
+ if (PHINode *PN = dyn_cast<PHINode>(I)) {
int OpNum = PN->getBasicBlockIndex(BB);
assert(OpNum != -1 && "PHI doesn't have incoming edge for predecessor!?");
PropagateEquality(PN, PN->getIncomingValue(OpNum), NewRI);
- } else if (SetCondInst *SCI = dyn_cast<SetCondInst>(&*I)) {
+ } else if (SetCondInst *SCI = dyn_cast<SetCondInst>(I)) {
Relation::KnownResult Res = getSetCCResult(SCI, NewRI);
if (Res == Relation::Unknown) return false;
PropagateEquality(SCI, ConstantBool::get(Res), NewRI);
@@ -563,7 +563,7 @@ void CEE::ForwardSuccessorTo(TerminatorInst *TI, unsigned SuccNo,
// node with a new value.
//
for (BasicBlock::iterator I = OldSucc->begin();
- PHINode *PN = dyn_cast<PHINode>(&*I); ) {
+ PHINode *PN = dyn_cast<PHINode>(I); ) {
// Get the value flowing across the old edge and remove the PHI node entry
// for this edge: we are about to remove the edge! Don't remove the PHI
@@ -993,7 +993,7 @@ void CEE::ComputeReplacements(RegionInfo &RI) {
bool CEE::SimplifyBasicBlock(BasicBlock &BB, const RegionInfo &RI) {
bool Changed = false;
for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ) {
- Instruction *Inst = &*I++;
+ Instruction *Inst = I++;
// Convert instruction arguments to canonical forms...
Changed |= SimplifyInstruction(Inst, RI);
diff --git a/llvm/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp b/llvm/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
index d0f47d8b806..65cf465acd9 100644
--- a/llvm/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
+++ b/llvm/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
@@ -44,7 +44,7 @@ DecomposePass::runOnBasicBlock(BasicBlock &BB)
{
bool changed = false;
for (BasicBlock::iterator II = BB.begin(); II != BB.end(); )
- if (GetElementPtrInst *gep = dyn_cast<GetElementPtrInst>(&*II++)) // pre-inc
+ if (GetElementPtrInst *gep = dyn_cast<GetElementPtrInst>(II++)) // pre-inc
if (gep->getNumIndices() >= 2)
changed |= DecomposeArrayRef(gep); // always modifies II
return changed;
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index ff2b9939c70..993e533abc7 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -45,7 +45,7 @@ static bool TransformLoop(LoopInfo *Loops, Loop *Loop) {
//
std::vector<InductionVariable> IndVars; // Induction variables for block
BasicBlock::iterator AfterPHIIt = Header->begin();
- for (; PHINode *PN = dyn_cast<PHINode>(&*AfterPHIIt); ++AfterPHIIt)
+ for (; PHINode *PN = dyn_cast<PHINode>(AfterPHIIt); ++AfterPHIIt)
IndVars.push_back(InductionVariable(PN, Loops));
// AfterPHIIt now points to first nonphi instruction...
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index 3df11a5ca28..9069338e323 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LICM.cpp
@@ -319,12 +319,12 @@ void LICM::PromoteValuesInLoop() {
// Rewrite all loads and stores in the block of the pointer...
for (BasicBlock::iterator II = (*I)->begin(), E = (*I)->end();
II != E; ++II) {
- if (LoadInst *L = dyn_cast<LoadInst>(&*II)) {
+ if (LoadInst *L = dyn_cast<LoadInst>(II)) {
std::map<Value*, AllocaInst*>::iterator
I = ValueToAllocaMap.find(L->getOperand(0));
if (I != ValueToAllocaMap.end())
L->setOperand(0, I->second); // Rewrite load instruction...
- } else if (StoreInst *S = dyn_cast<StoreInst>(&*II)) {
+ } else if (StoreInst *S = dyn_cast<StoreInst>(II)) {
std::map<Value*, AllocaInst*>::iterator
I = ValueToAllocaMap.find(S->getOperand(1));
if (I != ValueToAllocaMap.end())
diff --git a/llvm/lib/Transforms/Scalar/LoopSimplify.cpp b/llvm/lib/Transforms/Scalar/LoopSimplify.cpp
index 5a68dda1af3..d5988b16526 100644
--- a/llvm/lib/Transforms/Scalar/LoopSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopSimplify.cpp
@@ -132,7 +132,7 @@ BasicBlock *Preheaders::SplitBlockPredecessors(BasicBlock *BB,
//
if (!Preds.empty()) { // Is the loop not obviously dead?
for (BasicBlock::iterator I = BB->begin();
- PHINode *PN = dyn_cast<PHINode>(&*I); ++I) {
+ PHINode *PN = dyn_cast<PHINode>(I); ++I) {
// Create the new PHI node, insert it into NewBB at the end of the block
PHINode *NewPHI = new PHINode(PN->getType(), PN->getName()+".ph", BI);
@@ -160,7 +160,7 @@ BasicBlock *Preheaders::SplitBlockPredecessors(BasicBlock *BB,
} else { // Otherwise the loop is dead...
for (BasicBlock::iterator I = BB->begin();
- PHINode *PN = dyn_cast<PHINode>(&*I); ++I)
+ PHINode *PN = dyn_cast<PHINode>(I); ++I)
// Insert dummy values as the incoming value...
PN->addIncoming(Constant::getNullValue(PN->getType()), NewBB);
}
diff --git a/llvm/lib/Transforms/Scalar/LowerAllocations.cpp b/llvm/lib/Transforms/Scalar/LowerAllocations.cpp
index 0148134d03b..68fb74efaf6 100644
--- a/llvm/lib/Transforms/Scalar/LowerAllocations.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerAllocations.cpp
@@ -85,7 +85,7 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) {
// Loop over all of the instructions, looking for malloc or free instructions
for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I) {
- if (MallocInst *MI = dyn_cast<MallocInst>(&*I)) {
+ if (MallocInst *MI = dyn_cast<MallocInst>(I)) {
const Type *AllocTy = MI->getType()->getElementType();
// Get the number of bytes to be allocated for one element of the
@@ -114,7 +114,7 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) {
I = --BBIL.erase(I); // remove and delete the malloc instr...
Changed = true;
++NumLowered;
- } else if (FreeInst *FI = dyn_cast<FreeInst>(&*I)) {
+ } else if (FreeInst *FI = dyn_cast<FreeInst>(I)) {
// Cast the argument to free into a ubyte*...
CastInst *MCast = new CastInst(FI->getOperand(0),
PointerType::get(Type::UByteTy), "", I);
diff --git a/llvm/lib/Transforms/Scalar/Mem2Reg.cpp b/llvm/lib/Transforms/Scalar/Mem2Reg.cpp
index 848c4d67066..6bd859a4037 100644
--- a/llvm/lib/Transforms/Scalar/Mem2Reg.cpp
+++ b/llvm/lib/Transforms/Scalar/Mem2Reg.cpp
@@ -43,7 +43,7 @@ bool PromotePass::runOnFunction(Function &F) {
// Find allocas that are safe to promote, by looking at all instructions in
// the entry node
for (BasicBlock::iterator I = BB.begin(), E = --BB.end(); I != E; ++I)
- if (AllocaInst *AI = dyn_cast<AllocaInst>(&*I)) // Is it an alloca?
+ if (AllocaInst *AI = dyn_cast<AllocaInst>(I)) // Is it an alloca?
if (isAllocaPromotable(AI, TD))
Allocas.push_back(AI);
diff --git a/llvm/lib/Transforms/Scalar/Reassociate.cpp b/llvm/lib/Transforms/Scalar/Reassociate.cpp
index df0a64188f3..3414c410ac8 100644
--- a/llvm/lib/Transforms/Scalar/Reassociate.cpp
+++ b/llvm/lib/Transforms/Scalar/Reassociate.cpp
@@ -224,7 +224,7 @@ bool Reassociate::ReassociateBB(BasicBlock *BB) {
// the two operands are sorted incorrectly, fix it now.
//
if (BI->isAssociative()) {
- BinaryOperator *I = cast<BinaryOperator>(&*BI);
+ BinaryOperator *I = cast<BinaryOperator>(BI);
if (!I->use_empty()) {
// Make sure that we don't have a tree-shaped computation. If we do,
// linearize it. Convert (A+B)+(C+D) into ((A+B)+C)+D
diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp
index 66818bc3b63..77b41f4e360 100644
--- a/llvm/lib/Transforms/Scalar/SCCP.cpp
+++ b/llvm/lib/Transforms/Scalar/SCCP.cpp
@@ -474,7 +474,7 @@ void SCCP::visitTerminatorInst(TerminatorInst &TI) {
// constant now may not be.
//
for (BasicBlock::iterator I = Succ->begin();
- PHINode *PN = dyn_cast<PHINode>(&*I); ++I)
+ PHINode *PN = dyn_cast<PHINode>(I); ++I)
visitPHINode(*PN);
}
}
OpenPOWER on IntegriCloud