aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Scalar')
-rw-r--r--lib/Transforms/Scalar/ADCE.cpp2
-rw-r--r--lib/Transforms/Scalar/ConstantProp.cpp2
-rw-r--r--lib/Transforms/Scalar/DCE.cpp3
-rw-r--r--lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp10
-rw-r--r--lib/Transforms/Scalar/GCSE.cpp4
-rw-r--r--lib/Transforms/Scalar/IndVarSimplify.cpp4
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp2
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp4
-rw-r--r--lib/Transforms/Scalar/SymbolStripping.cpp3
9 files changed, 30 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/ADCE.cpp b/lib/Transforms/Scalar/ADCE.cpp
index 7f1fedec24..bd60b519a7 100644
--- a/lib/Transforms/Scalar/ADCE.cpp
+++ b/lib/Transforms/Scalar/ADCE.cpp
@@ -290,6 +290,8 @@ BasicBlock *ADCE::fixupCFG(BasicBlock *BB, std::set<BasicBlock*> &VisitedBlocks,
namespace {
struct AgressiveDCE : public FunctionPass {
+ const char *getPassName() const {return "Aggressive Dead Code Elimination";}
+
// doADCE - Execute the Agressive Dead Code Elimination Algorithm
//
virtual bool runOnFunction(Function *F) {
diff --git a/lib/Transforms/Scalar/ConstantProp.cpp b/lib/Transforms/Scalar/ConstantProp.cpp
index a8dbe3ff95..77a959910f 100644
--- a/lib/Transforms/Scalar/ConstantProp.cpp
+++ b/lib/Transforms/Scalar/ConstantProp.cpp
@@ -211,6 +211,8 @@ static bool DoConstPropPass(Function *F) {
namespace {
struct ConstantPropogation : public FunctionPass {
+ const char *getPassName() const { return "Simple Constant Propogation"; }
+
inline bool runOnFunction(Function *F) {
bool Modified = false;
diff --git a/lib/Transforms/Scalar/DCE.cpp b/lib/Transforms/Scalar/DCE.cpp
index 1a3073c3c7..4aac04114e 100644
--- a/lib/Transforms/Scalar/DCE.cpp
+++ b/lib/Transforms/Scalar/DCE.cpp
@@ -64,6 +64,8 @@ static inline bool RemoveUnusedDefs(BasicBlock::InstListType &Vals) {
}
struct DeadInstElimination : public BasicBlockPass {
+ const char *getPassName() const { return "Dead Instruction Elimination"; }
+
virtual bool runOnBasicBlock(BasicBlock *BB) {
return RemoveUnusedDefs(BB->getInstList());
}
@@ -340,6 +342,7 @@ static bool RemoveUnusedGlobalValues(Module *Mod) {
namespace {
struct DeadCodeElimination : public FunctionPass {
+ const char *getPassName() const { return "Dead Code Elimination"; }
// Pass Interface...
virtual bool doInitialization(Module *M) {
diff --git a/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp b/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
index 0367348ef5..1eb582ebc4 100644
--- a/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
+++ b/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
@@ -9,15 +9,16 @@
//===----------------------------------------------------------------------===//
#include "llvm/Transforms/Scalar/DecomposeMultiDimRefs.h"
-#include "llvm/Constants.h"
+#include "llvm/Constant.h"
#include "llvm/iMemory.h"
#include "llvm/iOther.h"
#include "llvm/BasicBlock.h"
-#include "llvm/Function.h"
#include "llvm/Pass.h"
namespace {
struct DecomposePass : public BasicBlockPass {
+ const char *getPassName() const { return "Decompose Subscripting Exps"; }
+
virtual bool runOnBasicBlock(BasicBlock *BB);
private:
@@ -79,8 +80,9 @@ void DecomposePass::decomposeArrayRef(BasicBlock::iterator &BBI) {
// Check for a zero index. This will need a cast instead of
// a getElementPtr, or it may need neither.
- bool indexIsZero = isa<ConstantUInt>(*OI) &&
- cast<Constant>(*OI)->isNullValue();
+ bool indexIsZero = isa<Constant>(*OI) &&
+ cast<Constant>(*OI)->isNullValue() &&
+ (*OI)->getType() == Type::UIntTy;
// Extract the first index. If the ptr is a pointer to a structure
// and the next index is a structure offset (i.e., not an array offset),
diff --git a/lib/Transforms/Scalar/GCSE.cpp b/lib/Transforms/Scalar/GCSE.cpp
index b864760e68..cb24a0cbfc 100644
--- a/lib/Transforms/Scalar/GCSE.cpp
+++ b/lib/Transforms/Scalar/GCSE.cpp
@@ -30,6 +30,10 @@ namespace {
DominatorSet *DomSetInfo;
ImmediateDominators *ImmDominator;
public:
+ const char *getPassName() const {
+ return "Global Common Subexpression Elimination";
+ }
+
virtual bool runOnFunction(Function *F);
// Visitation methods, these are invoked depending on the type of
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp
index 003419bb84..1e8621b5ed 100644
--- a/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -197,6 +197,10 @@ static bool doit(Function *M, LoopInfo &Loops) {
namespace {
struct InductionVariableSimplify : public FunctionPass {
+ const char *getPassName() const {
+ return "Induction Variable Cannonicalize";
+ }
+
virtual bool runOnFunction(Function *F) {
return doit(F, getAnalysis<LoopInfo>());
}
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 626c130114..c8d2bed789 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -42,6 +42,8 @@ namespace {
}
public:
+ const char *getPassName() const { return "Instruction Combining"; }
+
virtual bool runOnFunction(Function *F);
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index 12d518b3c8..8271c9bce4 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -466,6 +466,10 @@ namespace {
// to prove whether a value is constant and whether blocks are used.
//
struct SCCPPass : public FunctionPass {
+ const char *getPassName() const {
+ return "Sparse Conditional Constant Propogation";
+ }
+
inline bool runOnFunction(Function *F) {
SCCP S(F);
return S.doSCCP();
diff --git a/lib/Transforms/Scalar/SymbolStripping.cpp b/lib/Transforms/Scalar/SymbolStripping.cpp
index f99684faaf..8320716d54 100644
--- a/lib/Transforms/Scalar/SymbolStripping.cpp
+++ b/lib/Transforms/Scalar/SymbolStripping.cpp
@@ -61,6 +61,8 @@ static bool doStripGlobalSymbols(Module *M) {
namespace {
struct SymbolStripping : public FunctionPass {
+ const char *getPassName() const { return "Strip Symbols from Functions"; }
+
virtual bool runOnFunction(Function *F) {
return doSymbolStripping(F);
}
@@ -70,6 +72,7 @@ namespace {
};
struct FullSymbolStripping : public SymbolStripping {
+ const char *getPassName() const { return "Strip Symbols from Module"; }
virtual bool doInitialization(Module *M) {
return doStripGlobalSymbols(M);
}