mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-04 04:19:25 +00:00
remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96109 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -32,7 +32,6 @@
|
|||||||
#include "llvm/ADT/SmallSet.h"
|
#include "llvm/ADT/SmallSet.h"
|
||||||
#include "llvm/Assembly/Writer.h"
|
#include "llvm/Assembly/Writer.h"
|
||||||
#include "llvm/Support/CallSite.h"
|
#include "llvm/Support/CallSite.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
|
||||||
#include "llvm/Support/Debug.h"
|
#include "llvm/Support/Debug.h"
|
||||||
#include "llvm/Support/GetElementPtrTypeIterator.h"
|
#include "llvm/Support/GetElementPtrTypeIterator.h"
|
||||||
#include "llvm/Support/PatternMatch.h"
|
#include "llvm/Support/PatternMatch.h"
|
||||||
@@ -40,9 +39,6 @@
|
|||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
using namespace llvm::PatternMatch;
|
using namespace llvm::PatternMatch;
|
||||||
|
|
||||||
static cl::opt<bool> FactorCommonPreds("split-critical-paths-tweak",
|
|
||||||
cl::init(false), cl::Hidden);
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class CodeGenPrepare : public FunctionPass {
|
class CodeGenPrepare : public FunctionPass {
|
||||||
/// TLI - Keep a pointer of a TargetLowering to consult for determining
|
/// TLI - Keep a pointer of a TargetLowering to consult for determining
|
||||||
@@ -392,7 +388,6 @@ static void SplitEdgeNicely(TerminatorInst *TI, unsigned SuccNum,
|
|||||||
if (BackEdges.count(std::make_pair(TIBB, Dest)))
|
if (BackEdges.count(std::make_pair(TIBB, Dest)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!FactorCommonPreds) {
|
|
||||||
if (BasicBlock *ReuseBB = FindReusablePredBB(DestPHI, TIBB)) {
|
if (BasicBlock *ReuseBB = FindReusablePredBB(DestPHI, TIBB)) {
|
||||||
ProfileInfo *PFI = P->getAnalysisIfAvailable<ProfileInfo>();
|
ProfileInfo *PFI = P->getAnalysisIfAvailable<ProfileInfo>();
|
||||||
if (PFI)
|
if (PFI)
|
||||||
@@ -403,40 +398,6 @@ static void SplitEdgeNicely(TerminatorInst *TI, unsigned SuccNum,
|
|||||||
}
|
}
|
||||||
|
|
||||||
SplitCriticalEdge(TI, SuccNum, P, true);
|
SplitCriticalEdge(TI, SuccNum, P, true);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
PHINode *PN;
|
|
||||||
SmallVector<Value*, 8> TIPHIValues;
|
|
||||||
for (BasicBlock::iterator I = Dest->begin();
|
|
||||||
(PN = dyn_cast<PHINode>(I)); ++I)
|
|
||||||
TIPHIValues.push_back(PN->getIncomingValueForBlock(TIBB));
|
|
||||||
|
|
||||||
SmallVector<BasicBlock*, 8> IdenticalPreds;
|
|
||||||
|
|
||||||
for (unsigned pi = 0, e = DestPHI->getNumIncomingValues(); pi != e; ++pi) {
|
|
||||||
BasicBlock *Pred = DestPHI->getIncomingBlock(pi);
|
|
||||||
if (BackEdges.count(std::make_pair(Pred, Dest)))
|
|
||||||
continue;
|
|
||||||
if (Pred == TIBB) {
|
|
||||||
IdenticalPreds.push_back(Pred);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
bool Identical = true;
|
|
||||||
unsigned PHINo = 0;
|
|
||||||
for (BasicBlock::iterator I = Dest->begin();
|
|
||||||
(PN = dyn_cast<PHINode>(I)); ++I, ++PHINo)
|
|
||||||
if (TIPHIValues[PHINo] != PN->getIncomingValueForBlock(Pred)) {
|
|
||||||
Identical = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (Identical)
|
|
||||||
IdenticalPreds.push_back(Pred);
|
|
||||||
}
|
|
||||||
|
|
||||||
assert(!IdenticalPreds.empty());
|
|
||||||
SplitBlockPredecessors(Dest, &IdenticalPreds[0], IdenticalPreds.size(),
|
|
||||||
".critedge", P);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user