[llvm-commits] [llvm] r86289 - /llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp
Eli Friedman
eli.friedman at gmail.com
Fri Nov 6 13:24:58 PST 2009
Author: efriedma
Date: Fri Nov 6 15:24:57 2009
New Revision: 86289
URL: http://llvm.org/viewvc/llvm-project?rev=86289&view=rev
Log:
Remove function left over from other jump threading cleanup.
Modified:
llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp?rev=86289&r1=86288&r2=86289&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Fri Nov 6 15:24:57 2009
@@ -75,7 +75,6 @@
bool ThreadEdge(BasicBlock *BB, BasicBlock *PredBB, BasicBlock *SuccBB);
bool DuplicateCondBranchOnPHIIntoPred(BasicBlock *BB,
BasicBlock *PredBB);
- BasicBlock *FactorCommonPHIPreds(PHINode *PN, Value *Val);
typedef SmallVectorImpl<std::pair<ConstantInt*,
BasicBlock*> > PredValueInfo;
@@ -204,29 +203,6 @@
LoopHeaders.insert(const_cast<BasicBlock*>(Edges[i].second));
}
-
-/// FactorCommonPHIPreds - If there are multiple preds with the same incoming
-/// value for the PHI, factor them together so we get one block to thread for
-/// the whole group.
-/// This is important for things like "phi i1 [true, true, false, true, x]"
-/// where we only need to clone the block for the true blocks once.
-///
-BasicBlock *JumpThreading::FactorCommonPHIPreds(PHINode *PN, Value *Val) {
- SmallVector<BasicBlock*, 16> CommonPreds;
- for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
- if (PN->getIncomingValue(i) == Val)
- CommonPreds.push_back(PN->getIncomingBlock(i));
-
- if (CommonPreds.size() == 1)
- return CommonPreds[0];
-
- DEBUG(errs() << " Factoring out " << CommonPreds.size()
- << " common predecessors.\n");
- return SplitBlockPredecessors(PN->getParent(),
- &CommonPreds[0], CommonPreds.size(),
- ".thr_comm", this);
-}
-
/// GetResultOfComparison - Given an icmp/fcmp predicate and the left and right
/// hand sides of the compare instruction, try to determine the result. If the
/// result can not be determined, a null pointer is returned.
More information about the llvm-commits
mailing list