Remove function left over from other jump threading cleanup.
authorEli Friedman <eli.friedman@gmail.com>
Fri, 6 Nov 2009 21:24:57 +0000 (21:24 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Fri, 6 Nov 2009 21:24:57 +0000 (21:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86289 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/JumpThreading.cpp

index 4918b73c5fd559cc8e86d9ca135085b21aa35e30..62f7d51ff8c8432047acc2687b749a1adaa88e25 100644 (file)
@@ -75,7 +75,6 @@ namespace {
     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 @@ void JumpThreading::FindLoopHeaders(Function &F) {
     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.