mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 19:52:54 +01:00
Remove function left over from other jump threading cleanup.
llvm-svn: 86289
This commit is contained in:
parent
b0c347888a
commit
98daf610fb
@ -75,7 +75,6 @@ namespace {
|
|||||||
bool ThreadEdge(BasicBlock *BB, BasicBlock *PredBB, BasicBlock *SuccBB);
|
bool ThreadEdge(BasicBlock *BB, BasicBlock *PredBB, BasicBlock *SuccBB);
|
||||||
bool DuplicateCondBranchOnPHIIntoPred(BasicBlock *BB,
|
bool DuplicateCondBranchOnPHIIntoPred(BasicBlock *BB,
|
||||||
BasicBlock *PredBB);
|
BasicBlock *PredBB);
|
||||||
BasicBlock *FactorCommonPHIPreds(PHINode *PN, Value *Val);
|
|
||||||
|
|
||||||
typedef SmallVectorImpl<std::pair<ConstantInt*,
|
typedef SmallVectorImpl<std::pair<ConstantInt*,
|
||||||
BasicBlock*> > PredValueInfo;
|
BasicBlock*> > PredValueInfo;
|
||||||
@ -204,29 +203,6 @@ void JumpThreading::FindLoopHeaders(Function &F) {
|
|||||||
LoopHeaders.insert(const_cast<BasicBlock*>(Edges[i].second));
|
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
|
/// GetResultOfComparison - Given an icmp/fcmp predicate and the left and right
|
||||||
/// hand sides of the compare instruction, try to determine the result. If the
|
/// hand sides of the compare instruction, try to determine the result. If the
|
||||||
/// result can not be determined, a null pointer is returned.
|
/// result can not be determined, a null pointer is returned.
|
||||||
|
Loading…
Reference in New Issue
Block a user