[llvm-commits] [llvm] r123724 - in /llvm/trunk: include/llvm/InitializePasses.h include/llvm/Transforms/Scalar.h lib/Transforms/Scalar/Scalar.cpp lib/Transforms/Scalar/ScalarReplAggregates.cpp lib/Transforms/Utils/Mem2Reg.cpp lib/Transforms/Utils/PromoteMemoryToRegister.cpp
Cameron Zwarich
zwarich at apple.com
Mon Jan 17 19:53:26 PST 2011
Author: zwarich
Date: Mon Jan 17 21:53:26 2011
New Revision: 123724
URL: http://llvm.org/viewvc/llvm-project?rev=123724&view=rev
Log:
Remove outdated references to dominance frontiers.
Modified:
llvm/trunk/include/llvm/InitializePasses.h
llvm/trunk/include/llvm/Transforms/Scalar.h
llvm/trunk/lib/Transforms/Scalar/Scalar.cpp
llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp
llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp
llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
Modified: llvm/trunk/include/llvm/InitializePasses.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InitializePasses.h?rev=123724&r1=123723&r2=123724&view=diff
==============================================================================
--- llvm/trunk/include/llvm/InitializePasses.h (original)
+++ llvm/trunk/include/llvm/InitializePasses.h Mon Jan 17 21:53:26 2011
@@ -192,7 +192,7 @@
void initializeRenderMachineFunctionPass(PassRegistry&);
void initializeSCCPPass(PassRegistry&);
void initializeSRETPromotionPass(PassRegistry&);
-void initializeSROA_DFPass(PassRegistry&);
+void initializeSROA_DTPass(PassRegistry&);
void initializeSROA_SSAUpPass(PassRegistry&);
void initializeScalarEvolutionAliasAnalysisPass(PassRegistry&);
void initializeScalarEvolutionPass(PassRegistry&);
Modified: llvm/trunk/include/llvm/Transforms/Scalar.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Scalar.h?rev=123724&r1=123723&r2=123724&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/Scalar.h (original)
+++ llvm/trunk/include/llvm/Transforms/Scalar.h Mon Jan 17 21:53:26 2011
@@ -74,7 +74,7 @@
// if possible.
//
FunctionPass *createScalarReplAggregatesPass(signed Threshold = -1,
- bool UseDomFrontier = true);
+ bool UseDomTree = true);
//===----------------------------------------------------------------------===//
//
Modified: llvm/trunk/lib/Transforms/Scalar/Scalar.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Scalar.cpp?rev=123724&r1=123723&r2=123724&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/Scalar.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/Scalar.cpp Mon Jan 17 21:53:26 2011
@@ -53,7 +53,7 @@
initializeRegToMemPass(Registry);
initializeSCCPPass(Registry);
initializeIPSCCPPass(Registry);
- initializeSROA_DFPass(Registry);
+ initializeSROA_DTPass(Registry);
initializeSROA_SSAUpPass(Registry);
initializeCFGSimplifyPassPass(Registry);
initializeSimplifyHalfPowrLibCallsPass(Registry);
Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=123724&r1=123723&r2=123724&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Mon Jan 17 21:53:26 2011
@@ -30,7 +30,7 @@
#include "llvm/LLVMContext.h"
#include "llvm/Module.h"
#include "llvm/Pass.h"
-#include "llvm/Analysis/DominanceFrontier.h"
+#include "llvm/Analysis/Dominators.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Transforms/Utils/PromoteMemToReg.h"
@@ -54,8 +54,8 @@
namespace {
struct SROA : public FunctionPass {
- SROA(int T, bool hasDF, char &ID)
- : FunctionPass(ID), HasDomFrontiers(hasDF) {
+ SROA(int T, bool hasDT, char &ID)
+ : FunctionPass(ID), HasDomTree(hasDT) {
if (T == -1)
SRThreshold = 128;
else
@@ -68,7 +68,7 @@
bool performPromotion(Function &F);
private:
- bool HasDomFrontiers;
+ bool HasDomTree;
TargetData *TD;
/// DeadInsts - Keep track of instructions we have made dead, so that
@@ -140,12 +140,12 @@
static MemTransferInst *isOnlyCopiedFromConstantGlobal(AllocaInst *AI);
};
- // SROA_DF - SROA that uses DominanceFrontier.
- struct SROA_DF : public SROA {
+ // SROA_DT - SROA that uses DominatorTree.
+ struct SROA_DT : public SROA {
static char ID;
public:
- SROA_DF(int T = -1) : SROA(T, true, ID) {
- initializeSROA_DFPass(*PassRegistry::getPassRegistry());
+ SROA_DT(int T = -1) : SROA(T, true, ID) {
+ initializeSROA_DTPass(*PassRegistry::getPassRegistry());
}
// getAnalysisUsage - This pass does not require any passes, but we know it
@@ -173,14 +173,14 @@
}
-char SROA_DF::ID = 0;
+char SROA_DT::ID = 0;
char SROA_SSAUp::ID = 0;
-INITIALIZE_PASS_BEGIN(SROA_DF, "scalarrepl",
- "Scalar Replacement of Aggregates (DF)", false, false)
+INITIALIZE_PASS_BEGIN(SROA_DT, "scalarrepl",
+ "Scalar Replacement of Aggregates (DT)", false, false)
INITIALIZE_PASS_DEPENDENCY(DominatorTree)
-INITIALIZE_PASS_END(SROA_DF, "scalarrepl",
- "Scalar Replacement of Aggregates (DF)", false, false)
+INITIALIZE_PASS_END(SROA_DT, "scalarrepl",
+ "Scalar Replacement of Aggregates (DT)", false, false)
INITIALIZE_PASS_BEGIN(SROA_SSAUp, "scalarrepl-ssa",
"Scalar Replacement of Aggregates (SSAUp)", false, false)
@@ -189,9 +189,9 @@
// Public interface to the ScalarReplAggregates pass
FunctionPass *llvm::createScalarReplAggregatesPass(int Threshold,
- bool UseDomFrontier) {
- if (UseDomFrontier)
- return new SROA_DF(Threshold);
+ bool UseDomTree) {
+ if (UseDomTree)
+ return new SROA_DT(Threshold);
return new SROA_SSAUp(Threshold);
}
@@ -875,7 +875,7 @@
bool SROA::performPromotion(Function &F) {
std::vector<AllocaInst*> Allocas;
DominatorTree *DT = 0;
- if (HasDomFrontiers)
+ if (HasDomTree)
DT = &getAnalysis<DominatorTree>();
BasicBlock &BB = F.getEntryBlock(); // Get the entry node for the function
@@ -894,7 +894,7 @@
if (Allocas.empty()) break;
- if (HasDomFrontiers)
+ if (HasDomTree)
PromoteMemToReg(Allocas, *DT);
else {
SSAUpdater SSA;
Modified: llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp?rev=123724&r1=123723&r2=123724&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/Mem2Reg.cpp Mon Jan 17 21:53:26 2011
@@ -16,7 +16,7 @@
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/PromoteMemToReg.h"
#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
-#include "llvm/Analysis/DominanceFrontier.h"
+#include "llvm/Analysis/Dominators.h"
#include "llvm/Instructions.h"
#include "llvm/Function.h"
#include "llvm/ADT/Statistic.h"
@@ -36,8 +36,6 @@
//
virtual bool runOnFunction(Function &F);
- // getAnalysisUsage - We need dominance frontiers
- //
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<DominatorTree>();
AU.setPreservesCFG();
Modified: llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp?rev=123724&r1=123723&r2=123724&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Mon Jan 17 21:53:26 2011
@@ -35,7 +35,7 @@
#include "llvm/Metadata.h"
#include "llvm/Analysis/AliasSetTracker.h"
#include "llvm/Analysis/DebugInfo.h"
-#include "llvm/Analysis/DominanceFrontier.h"
+#include "llvm/Analysis/Dominators.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallPtrSet.h"
@@ -44,6 +44,7 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/CFG.h"
#include <algorithm>
+#include <map>
#include <queue>
using namespace llvm;
@@ -523,9 +524,8 @@
Instruction *A = Allocas[i];
// 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.
- // Just delete the users now.
- //
+ // unreachable basic blocks that were not processed by walking the dominator
+ // tree. Just delete the users now.
if (!A->use_empty())
A->replaceAllUsesWith(UndefValue::get(A->getType()));
if (AST) AST->deleteValue(A);
@@ -1102,9 +1102,9 @@
}
/// PromoteMemToReg - Promote the specified list of alloca instructions into
-/// scalar registers, inserting PHI nodes as appropriate. This function makes
-/// use of DominanceFrontier information. This function does not modify the CFG
-/// of the function at all. All allocas must be from the same function.
+/// scalar registers, inserting PHI nodes as appropriate. This function does
+/// not modify the CFG of the function at all. All allocas must be from the
+/// same function.
///
/// If AST is specified, the specified tracker is updated to reflect changes
/// made to the IR.
More information about the llvm-commits
mailing list