aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-10-04 18:49:55 +0000
committerOwen Anderson <resistor@mac.com>2009-10-04 18:49:55 +0000
commitfa289966b6b7ae54a3c17822f5155d0588783342 (patch)
tree8a274e0c4edd760ccf6695673ff7e3b335e22790 /include
parentcc0aeb29f77c1d84341f2843edf6c0f78642f125 (diff)
downloadexternal_llvm-fa289966b6b7ae54a3c17822f5155d0588783342.zip
external_llvm-fa289966b6b7ae54a3c17822f5155d0588783342.tar.gz
external_llvm-fa289966b6b7ae54a3c17822f5155d0588783342.tar.bz2
Do away with the strange use of BitVectors in SSI, and just use normal sets. This makes the code much more C++/LLVM-ish.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83286 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Transforms/Utils/SSI.h30
1 files changed, 11 insertions, 19 deletions
diff --git a/include/llvm/Transforms/Utils/SSI.h b/include/llvm/Transforms/Utils/SSI.h
index 8b49aac..ff5bb7b 100644
--- a/include/llvm/Transforms/Utils/SSI.h
+++ b/include/llvm/Transforms/Utils/SSI.h
@@ -23,7 +23,6 @@
#define LLVM_TRANSFORMS_UTILS_SSI_H
#include "llvm/Pass.h"
-#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
@@ -55,43 +54,36 @@ namespace llvm {
// Stores variables created by SSI
SmallPtrSet<Instruction *, 16> created;
- // These variables are only live for each creation
- unsigned num_values;
-
- // Has a bit for each variable, true if it needs to be created
- // and false otherwise
- BitVector needConstruction;
-
// Phis created by SSI
- DenseMap<PHINode *, unsigned> phis;
+ DenseMap<PHINode *, Instruction*> phis;
// Sigmas created by SSI
- DenseMap<PHINode *, unsigned> sigmas;
+ DenseMap<PHINode *, Instruction*> sigmas;
// Phi nodes that have a phi as operand and has to be fixed
SmallPtrSet<PHINode *, 1> phisToFix;
// List of definition points for every variable
- SmallVector<SmallVector<BasicBlock *, 1>, 0> defsites;
+ DenseMap<Instruction*, SmallVector<BasicBlock*, 4> > defsites;
// Basic Block of the original definition of each variable
- SmallVector<BasicBlock *, 0> value_original;
+ DenseMap<Instruction*, BasicBlock*> value_original;
// Stack of last seen definition of a variable
- SmallVector<SmallVector<Instruction *, 1>, 0> value_stack;
+ DenseMap<Instruction*, SmallVector<Instruction *, 1> > value_stack;
- void insertSigmaFunctions(SmallVectorImpl<Instruction *> &value);
- void insertSigma(TerminatorInst *TI, Instruction *I, unsigned pos);
- void insertPhiFunctions(SmallVectorImpl<Instruction *> &value);
- void renameInit(SmallVectorImpl<Instruction *> &value);
+ void insertSigmaFunctions(SmallPtrSet<Instruction*, 4> &value);
+ void insertSigma(TerminatorInst *TI, Instruction *I);
+ void insertPhiFunctions(SmallPtrSet<Instruction*, 4> &value);
+ void renameInit(SmallPtrSet<Instruction*, 4> &value);
void rename(BasicBlock *BB);
void substituteUse(Instruction *I);
bool dominateAny(BasicBlock *BB, Instruction *value);
void fixPhis();
- unsigned getPositionPhi(PHINode *PN);
- unsigned getPositionSigma(PHINode *PN);
+ Instruction* getPositionPhi(PHINode *PN);
+ Instruction* getPositionSigma(PHINode *PN);
void init(SmallVectorImpl<Instruction *> &value);
void clean();