mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-12 06:06:19 +00:00
[ScalarOpts] Remove dead code.
Does not touch debug dumpers. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250417 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0f34207b1d
commit
7ba5769458
@ -264,7 +264,6 @@ namespace {
|
||||
/// expected that a later pass of GVN will catch the interesting/hard cases.
|
||||
class EarlyCSE {
|
||||
public:
|
||||
Function &F;
|
||||
const TargetLibraryInfo &TLI;
|
||||
const TargetTransformInfo &TTI;
|
||||
DominatorTree &DT;
|
||||
@ -316,10 +315,9 @@ public:
|
||||
unsigned CurrentGeneration;
|
||||
|
||||
/// \brief Set up the EarlyCSE runner for a particular function.
|
||||
EarlyCSE(Function &F, const TargetLibraryInfo &TLI,
|
||||
const TargetTransformInfo &TTI, DominatorTree &DT,
|
||||
AssumptionCache &AC)
|
||||
: F(F), TLI(TLI), TTI(TTI), DT(DT), AC(AC), CurrentGeneration(0) {}
|
||||
EarlyCSE(const TargetLibraryInfo &TLI, const TargetTransformInfo &TTI,
|
||||
DominatorTree &DT, AssumptionCache &AC)
|
||||
: TLI(TLI), TTI(TTI), DT(DT), AC(AC), CurrentGeneration(0) {}
|
||||
|
||||
bool run();
|
||||
|
||||
@ -735,7 +733,7 @@ PreservedAnalyses EarlyCSEPass::run(Function &F,
|
||||
auto &DT = AM->getResult<DominatorTreeAnalysis>(F);
|
||||
auto &AC = AM->getResult<AssumptionAnalysis>(F);
|
||||
|
||||
EarlyCSE CSE(F, TLI, TTI, DT, AC);
|
||||
EarlyCSE CSE(TLI, TTI, DT, AC);
|
||||
|
||||
if (!CSE.run())
|
||||
return PreservedAnalyses::all();
|
||||
@ -772,7 +770,7 @@ public:
|
||||
auto &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
|
||||
auto &AC = getAnalysis<AssumptionCacheTracker>().getAssumptionCache(F);
|
||||
|
||||
EarlyCSE CSE(F, TLI, TTI, DT, AC);
|
||||
EarlyCSE CSE(TLI, TTI, DT, AC);
|
||||
|
||||
return CSE.run();
|
||||
}
|
||||
|
@ -303,22 +303,6 @@ namespace {
|
||||
// The functions below can be called after we've finished processing all
|
||||
// instructions in the loop, and we know which reductions were selected.
|
||||
|
||||
// Is the provided instruction the PHI of a reduction selected for
|
||||
// rerolling?
|
||||
bool isSelectedPHI(Instruction *J) {
|
||||
if (!isa<PHINode>(J))
|
||||
return false;
|
||||
|
||||
for (DenseSet<int>::iterator RI = Reds.begin(), RIE = Reds.end();
|
||||
RI != RIE; ++RI) {
|
||||
int i = *RI;
|
||||
if (cast<Instruction>(J) == PossibleReds[i].getPHI())
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool validateSelected();
|
||||
void replaceSelected();
|
||||
|
||||
|
@ -283,8 +283,8 @@ class UnrolledInstAnalyzer : private InstVisitor<UnrolledInstAnalyzer, bool> {
|
||||
public:
|
||||
UnrolledInstAnalyzer(unsigned Iteration,
|
||||
DenseMap<Value *, Constant *> &SimplifiedValues,
|
||||
const Loop *L, ScalarEvolution &SE)
|
||||
: Iteration(Iteration), SimplifiedValues(SimplifiedValues), L(L), SE(SE) {
|
||||
ScalarEvolution &SE)
|
||||
: SimplifiedValues(SimplifiedValues), SE(SE) {
|
||||
IterationNumber = SE.getConstant(APInt(64, Iteration));
|
||||
}
|
||||
|
||||
@ -300,13 +300,6 @@ private:
|
||||
/// results saved.
|
||||
DenseMap<Value *, SimplifiedAddress> SimplifiedAddresses;
|
||||
|
||||
/// \brief Number of currently simulated iteration.
|
||||
///
|
||||
/// If an expression is ConstAddress+Constant, then the Constant is
|
||||
/// Start + Iteration*Step, where Start and Step could be obtained from
|
||||
/// SCEVGEPCache.
|
||||
unsigned Iteration;
|
||||
|
||||
/// \brief SCEV expression corresponding to number of currently simulated
|
||||
/// iteration.
|
||||
const SCEV *IterationNumber;
|
||||
@ -321,7 +314,6 @@ private:
|
||||
/// post-unrolling.
|
||||
DenseMap<Value *, Constant *> &SimplifiedValues;
|
||||
|
||||
const Loop *L;
|
||||
ScalarEvolution &SE;
|
||||
|
||||
/// \brief Try to simplify instruction \param I using its SCEV expression.
|
||||
@ -597,7 +589,7 @@ analyzeLoopUnrollCost(const Loop *L, unsigned TripCount, DominatorTree &DT,
|
||||
while (!SimplifiedInputValues.empty())
|
||||
SimplifiedValues.insert(SimplifiedInputValues.pop_back_val());
|
||||
|
||||
UnrolledInstAnalyzer Analyzer(Iteration, SimplifiedValues, L, SE);
|
||||
UnrolledInstAnalyzer Analyzer(Iteration, SimplifiedValues, SE);
|
||||
|
||||
BBWorklist.clear();
|
||||
BBWorklist.insert(L->getHeader());
|
||||
|
@ -84,20 +84,6 @@ namespace {
|
||||
|
||||
Factor(Value *Base, unsigned Power) : Base(Base), Power(Power) {}
|
||||
|
||||
/// \brief Sort factors by their Base.
|
||||
struct BaseSorter {
|
||||
bool operator()(const Factor &LHS, const Factor &RHS) {
|
||||
return LHS.Base < RHS.Base;
|
||||
}
|
||||
};
|
||||
|
||||
/// \brief Compare factors for equal bases.
|
||||
struct BaseEqual {
|
||||
bool operator()(const Factor &LHS, const Factor &RHS) {
|
||||
return LHS.Base == RHS.Base;
|
||||
}
|
||||
};
|
||||
|
||||
/// \brief Sort factors in descending order by their power.
|
||||
struct PowerDescendingSorter {
|
||||
bool operator()(const Factor &LHS, const Factor &RHS) {
|
||||
|
@ -2974,8 +2974,6 @@ class AggLoadStoreRewriter : public InstVisitor<AggLoadStoreRewriter, bool> {
|
||||
// Befriend the base class so it can delegate to private visit methods.
|
||||
friend class llvm::InstVisitor<AggLoadStoreRewriter, bool>;
|
||||
|
||||
const DataLayout &DL;
|
||||
|
||||
/// Queue of pointer uses to analyze and potentially rewrite.
|
||||
SmallVector<Use *, 8> Queue;
|
||||
|
||||
@ -2987,8 +2985,6 @@ class AggLoadStoreRewriter : public InstVisitor<AggLoadStoreRewriter, bool> {
|
||||
Use *U;
|
||||
|
||||
public:
|
||||
AggLoadStoreRewriter(const DataLayout &DL) : DL(DL) {}
|
||||
|
||||
/// Rewrite loads and stores through a pointer and all pointers derived from
|
||||
/// it.
|
||||
bool rewrite(Instruction &I) {
|
||||
@ -4101,7 +4097,7 @@ bool SROA::runOnAlloca(AllocaInst &AI) {
|
||||
|
||||
// First, split any FCA loads and stores touching this alloca to promote
|
||||
// better splitting and promotion opportunities.
|
||||
AggLoadStoreRewriter AggRewriter(DL);
|
||||
AggLoadStoreRewriter AggRewriter;
|
||||
Changed |= AggRewriter.rewrite(AI);
|
||||
|
||||
// Build the slices using a recursive instruction-visiting builder.
|
||||
|
Loading…
Reference in New Issue
Block a user