mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 02:33:33 +00:00
Remove outdated references to dominance frontiers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123724 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2e3cea3153
commit
b1686c32fc
@ -192,7 +192,7 @@ void initializeRegisterCoalescerAnalysisGroup(PassRegistry&);
|
|||||||
void initializeRenderMachineFunctionPass(PassRegistry&);
|
void initializeRenderMachineFunctionPass(PassRegistry&);
|
||||||
void initializeSCCPPass(PassRegistry&);
|
void initializeSCCPPass(PassRegistry&);
|
||||||
void initializeSRETPromotionPass(PassRegistry&);
|
void initializeSRETPromotionPass(PassRegistry&);
|
||||||
void initializeSROA_DFPass(PassRegistry&);
|
void initializeSROA_DTPass(PassRegistry&);
|
||||||
void initializeSROA_SSAUpPass(PassRegistry&);
|
void initializeSROA_SSAUpPass(PassRegistry&);
|
||||||
void initializeScalarEvolutionAliasAnalysisPass(PassRegistry&);
|
void initializeScalarEvolutionAliasAnalysisPass(PassRegistry&);
|
||||||
void initializeScalarEvolutionPass(PassRegistry&);
|
void initializeScalarEvolutionPass(PassRegistry&);
|
||||||
|
@ -74,7 +74,7 @@ FunctionPass *createAggressiveDCEPass();
|
|||||||
// if possible.
|
// if possible.
|
||||||
//
|
//
|
||||||
FunctionPass *createScalarReplAggregatesPass(signed Threshold = -1,
|
FunctionPass *createScalarReplAggregatesPass(signed Threshold = -1,
|
||||||
bool UseDomFrontier = true);
|
bool UseDomTree = true);
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
|
@ -53,7 +53,7 @@ void llvm::initializeScalarOpts(PassRegistry &Registry) {
|
|||||||
initializeRegToMemPass(Registry);
|
initializeRegToMemPass(Registry);
|
||||||
initializeSCCPPass(Registry);
|
initializeSCCPPass(Registry);
|
||||||
initializeIPSCCPPass(Registry);
|
initializeIPSCCPPass(Registry);
|
||||||
initializeSROA_DFPass(Registry);
|
initializeSROA_DTPass(Registry);
|
||||||
initializeSROA_SSAUpPass(Registry);
|
initializeSROA_SSAUpPass(Registry);
|
||||||
initializeCFGSimplifyPassPass(Registry);
|
initializeCFGSimplifyPassPass(Registry);
|
||||||
initializeSimplifyHalfPowrLibCallsPass(Registry);
|
initializeSimplifyHalfPowrLibCallsPass(Registry);
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
#include "llvm/LLVMContext.h"
|
#include "llvm/LLVMContext.h"
|
||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "llvm/Analysis/DominanceFrontier.h"
|
#include "llvm/Analysis/Dominators.h"
|
||||||
#include "llvm/Analysis/ValueTracking.h"
|
#include "llvm/Analysis/ValueTracking.h"
|
||||||
#include "llvm/Target/TargetData.h"
|
#include "llvm/Target/TargetData.h"
|
||||||
#include "llvm/Transforms/Utils/PromoteMemToReg.h"
|
#include "llvm/Transforms/Utils/PromoteMemToReg.h"
|
||||||
@ -54,8 +54,8 @@ STATISTIC(NumGlobals, "Number of allocas copied from constant global");
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
struct SROA : public FunctionPass {
|
struct SROA : public FunctionPass {
|
||||||
SROA(int T, bool hasDF, char &ID)
|
SROA(int T, bool hasDT, char &ID)
|
||||||
: FunctionPass(ID), HasDomFrontiers(hasDF) {
|
: FunctionPass(ID), HasDomTree(hasDT) {
|
||||||
if (T == -1)
|
if (T == -1)
|
||||||
SRThreshold = 128;
|
SRThreshold = 128;
|
||||||
else
|
else
|
||||||
@ -68,7 +68,7 @@ namespace {
|
|||||||
bool performPromotion(Function &F);
|
bool performPromotion(Function &F);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool HasDomFrontiers;
|
bool HasDomTree;
|
||||||
TargetData *TD;
|
TargetData *TD;
|
||||||
|
|
||||||
/// DeadInsts - Keep track of instructions we have made dead, so that
|
/// DeadInsts - Keep track of instructions we have made dead, so that
|
||||||
@ -140,12 +140,12 @@ namespace {
|
|||||||
static MemTransferInst *isOnlyCopiedFromConstantGlobal(AllocaInst *AI);
|
static MemTransferInst *isOnlyCopiedFromConstantGlobal(AllocaInst *AI);
|
||||||
};
|
};
|
||||||
|
|
||||||
// SROA_DF - SROA that uses DominanceFrontier.
|
// SROA_DT - SROA that uses DominatorTree.
|
||||||
struct SROA_DF : public SROA {
|
struct SROA_DT : public SROA {
|
||||||
static char ID;
|
static char ID;
|
||||||
public:
|
public:
|
||||||
SROA_DF(int T = -1) : SROA(T, true, ID) {
|
SROA_DT(int T = -1) : SROA(T, true, ID) {
|
||||||
initializeSROA_DFPass(*PassRegistry::getPassRegistry());
|
initializeSROA_DTPass(*PassRegistry::getPassRegistry());
|
||||||
}
|
}
|
||||||
|
|
||||||
// getAnalysisUsage - This pass does not require any passes, but we know it
|
// getAnalysisUsage - This pass does not require any passes, but we know it
|
||||||
@ -173,14 +173,14 @@ namespace {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
char SROA_DF::ID = 0;
|
char SROA_DT::ID = 0;
|
||||||
char SROA_SSAUp::ID = 0;
|
char SROA_SSAUp::ID = 0;
|
||||||
|
|
||||||
INITIALIZE_PASS_BEGIN(SROA_DF, "scalarrepl",
|
INITIALIZE_PASS_BEGIN(SROA_DT, "scalarrepl",
|
||||||
"Scalar Replacement of Aggregates (DF)", false, false)
|
"Scalar Replacement of Aggregates (DT)", false, false)
|
||||||
INITIALIZE_PASS_DEPENDENCY(DominatorTree)
|
INITIALIZE_PASS_DEPENDENCY(DominatorTree)
|
||||||
INITIALIZE_PASS_END(SROA_DF, "scalarrepl",
|
INITIALIZE_PASS_END(SROA_DT, "scalarrepl",
|
||||||
"Scalar Replacement of Aggregates (DF)", false, false)
|
"Scalar Replacement of Aggregates (DT)", false, false)
|
||||||
|
|
||||||
INITIALIZE_PASS_BEGIN(SROA_SSAUp, "scalarrepl-ssa",
|
INITIALIZE_PASS_BEGIN(SROA_SSAUp, "scalarrepl-ssa",
|
||||||
"Scalar Replacement of Aggregates (SSAUp)", false, false)
|
"Scalar Replacement of Aggregates (SSAUp)", false, false)
|
||||||
@ -189,9 +189,9 @@ INITIALIZE_PASS_END(SROA_SSAUp, "scalarrepl-ssa",
|
|||||||
|
|
||||||
// Public interface to the ScalarReplAggregates pass
|
// Public interface to the ScalarReplAggregates pass
|
||||||
FunctionPass *llvm::createScalarReplAggregatesPass(int Threshold,
|
FunctionPass *llvm::createScalarReplAggregatesPass(int Threshold,
|
||||||
bool UseDomFrontier) {
|
bool UseDomTree) {
|
||||||
if (UseDomFrontier)
|
if (UseDomTree)
|
||||||
return new SROA_DF(Threshold);
|
return new SROA_DT(Threshold);
|
||||||
return new SROA_SSAUp(Threshold);
|
return new SROA_SSAUp(Threshold);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -875,7 +875,7 @@ public:
|
|||||||
bool SROA::performPromotion(Function &F) {
|
bool SROA::performPromotion(Function &F) {
|
||||||
std::vector<AllocaInst*> Allocas;
|
std::vector<AllocaInst*> Allocas;
|
||||||
DominatorTree *DT = 0;
|
DominatorTree *DT = 0;
|
||||||
if (HasDomFrontiers)
|
if (HasDomTree)
|
||||||
DT = &getAnalysis<DominatorTree>();
|
DT = &getAnalysis<DominatorTree>();
|
||||||
|
|
||||||
BasicBlock &BB = F.getEntryBlock(); // Get the entry node for the function
|
BasicBlock &BB = F.getEntryBlock(); // Get the entry node for the function
|
||||||
@ -894,7 +894,7 @@ bool SROA::performPromotion(Function &F) {
|
|||||||
|
|
||||||
if (Allocas.empty()) break;
|
if (Allocas.empty()) break;
|
||||||
|
|
||||||
if (HasDomFrontiers)
|
if (HasDomTree)
|
||||||
PromoteMemToReg(Allocas, *DT);
|
PromoteMemToReg(Allocas, *DT);
|
||||||
else {
|
else {
|
||||||
SSAUpdater SSA;
|
SSAUpdater SSA;
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include "llvm/Transforms/Scalar.h"
|
#include "llvm/Transforms/Scalar.h"
|
||||||
#include "llvm/Transforms/Utils/PromoteMemToReg.h"
|
#include "llvm/Transforms/Utils/PromoteMemToReg.h"
|
||||||
#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
|
#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
|
||||||
#include "llvm/Analysis/DominanceFrontier.h"
|
#include "llvm/Analysis/Dominators.h"
|
||||||
#include "llvm/Instructions.h"
|
#include "llvm/Instructions.h"
|
||||||
#include "llvm/Function.h"
|
#include "llvm/Function.h"
|
||||||
#include "llvm/ADT/Statistic.h"
|
#include "llvm/ADT/Statistic.h"
|
||||||
@ -36,8 +36,6 @@ namespace {
|
|||||||
//
|
//
|
||||||
virtual bool runOnFunction(Function &F);
|
virtual bool runOnFunction(Function &F);
|
||||||
|
|
||||||
// getAnalysisUsage - We need dominance frontiers
|
|
||||||
//
|
|
||||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
|
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
|
||||||
AU.addRequired<DominatorTree>();
|
AU.addRequired<DominatorTree>();
|
||||||
AU.setPreservesCFG();
|
AU.setPreservesCFG();
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
#include "llvm/Metadata.h"
|
#include "llvm/Metadata.h"
|
||||||
#include "llvm/Analysis/AliasSetTracker.h"
|
#include "llvm/Analysis/AliasSetTracker.h"
|
||||||
#include "llvm/Analysis/DebugInfo.h"
|
#include "llvm/Analysis/DebugInfo.h"
|
||||||
#include "llvm/Analysis/DominanceFrontier.h"
|
#include "llvm/Analysis/Dominators.h"
|
||||||
#include "llvm/Analysis/InstructionSimplify.h"
|
#include "llvm/Analysis/InstructionSimplify.h"
|
||||||
#include "llvm/ADT/DenseMap.h"
|
#include "llvm/ADT/DenseMap.h"
|
||||||
#include "llvm/ADT/SmallPtrSet.h"
|
#include "llvm/ADT/SmallPtrSet.h"
|
||||||
@ -44,6 +44,7 @@
|
|||||||
#include "llvm/ADT/STLExtras.h"
|
#include "llvm/ADT/STLExtras.h"
|
||||||
#include "llvm/Support/CFG.h"
|
#include "llvm/Support/CFG.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <map>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
@ -523,9 +524,8 @@ void PromoteMem2Reg::run() {
|
|||||||
Instruction *A = Allocas[i];
|
Instruction *A = Allocas[i];
|
||||||
|
|
||||||
// If there are any uses of the alloca instructions left, they must be in
|
// If there are any uses of the alloca instructions left, they must be in
|
||||||
// sections of dead code that were not processed on the dominance frontier.
|
// unreachable basic blocks that were not processed by walking the dominator
|
||||||
// Just delete the users now.
|
// tree. Just delete the users now.
|
||||||
//
|
|
||||||
if (!A->use_empty())
|
if (!A->use_empty())
|
||||||
A->replaceAllUsesWith(UndefValue::get(A->getType()));
|
A->replaceAllUsesWith(UndefValue::get(A->getType()));
|
||||||
if (AST) AST->deleteValue(A);
|
if (AST) AST->deleteValue(A);
|
||||||
@ -1102,9 +1102,9 @@ NextIteration:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// PromoteMemToReg - Promote the specified list of alloca instructions into
|
/// PromoteMemToReg - Promote the specified list of alloca instructions into
|
||||||
/// scalar registers, inserting PHI nodes as appropriate. This function makes
|
/// scalar registers, inserting PHI nodes as appropriate. This function does
|
||||||
/// use of DominanceFrontier information. This function does not modify the CFG
|
/// not modify the CFG of the function at all. All allocas must be from the
|
||||||
/// of the function at all. All allocas must be from the same function.
|
/// same function.
|
||||||
///
|
///
|
||||||
/// If AST is specified, the specified tracker is updated to reflect changes
|
/// If AST is specified, the specified tracker is updated to reflect changes
|
||||||
/// made to the IR.
|
/// made to the IR.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user