diff options
author | Ruchira Sasanka <sasanka@students.uiuc.edu> | 2001-07-24 17:14:13 +0000 |
---|---|---|
committer | Ruchira Sasanka <sasanka@students.uiuc.edu> | 2001-07-24 17:14:13 +0000 |
commit | 683847fb751890fb0ca16657be68f769bdff786c (patch) | |
tree | 7bdc59d4565c8d04335ddae7d2b5114292f51320 /lib/Target/SparcV9/LiveVar/BBLiveVar.h | |
parent | 2233a07b686ead865b0bfeed5a50d178d05f9549 (diff) | |
download | llvm-683847fb751890fb0ca16657be68f769bdff786c.tar.gz llvm-683847fb751890fb0ca16657be68f769bdff786c.tar.bz2 llvm-683847fb751890fb0ca16657be68f769bdff786c.tar.xz |
*** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SparcV9/LiveVar/BBLiveVar.h')
-rw-r--r-- | lib/Target/SparcV9/LiveVar/BBLiveVar.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/lib/Target/SparcV9/LiveVar/BBLiveVar.h b/lib/Target/SparcV9/LiveVar/BBLiveVar.h new file mode 100644 index 0000000000..7917cc2131 --- /dev/null +++ b/lib/Target/SparcV9/LiveVar/BBLiveVar.h @@ -0,0 +1,69 @@ +/* Title: ValueSet.h + Author: Ruchira Sasanka + Date: Jun 30, 01 + Purpose: This is a wrapper class for BasicBlock which is used by live + variable anaysis +*/ + +#ifndef LIVE_VAR_BB_H +#define LIVE_VAR_BB_H + +#include "LiveVarSet.h" +#include "LiveVarMap.h" + +#include "llvm/BasicBlock.h" +#include "llvm/Instruction.h" +#include "llvm/CFG.h" +#include "llvm/Type.h" +#include "llvm/iOther.h" + + +class BBLiveVar +{ + const BasicBlock* BaseBB; // pointer to BasicBlock + unsigned int POId; // Post-Order ID + + LiveVarSet DefSet; // Def set for LV analysis + LiveVarSet InSet, OutSet; // In & Out for LV analysis + bool InSetChanged, OutSetChanged; // set if the InSet/OutSet is modified + + // map that contains phi args->BB they came + hash_map<const Value *, const BasicBlock *, hashFuncValue> PhiArgMap; + + // method to propogate an InSet to OutSet of a predecessor + bool setPropagate( LiveVarSet *const OutSetOfPred, + const LiveVarSet *const InSetOfThisBB, + const BasicBlock *const PredBB); + + public: + + BBLiveVar( const BasicBlock* baseBB, unsigned int POId); + + inline bool isInSetChanged() const { return InSetChanged; } + inline bool isOutSetChanged() const { return OutSetChanged; } + + inline unsigned int getPOId() const { return POId; } + + void calcDefUseSets() ; // calculates the Def & Use sets for this BB + bool applyTransferFunc(); // calcultes the In in terms of Out + + // calculates Out set using In sets of the predecessors + bool applyFlowFunc(BBToBBLiveVarMapType LVMap); + + inline const LiveVarSet* getOutSet() const { return &OutSet; } + inline const LiveVarSet* getInSet() const { return &InSet; } + + void printAllSets() const; // for printing Def/In/Out sets + void printInOutSets() const; // for printing In/Out sets + + //TODO write a destructor to deallocate Def/In.Out sets and PhiArgMap + +}; + + + + + + +#endif + |