diff options
author | Bob Wilson <bob.wilson@apple.com> | 2010-04-26 17:40:49 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2010-04-26 17:40:49 +0000 |
commit | 211678a0d761942578970fc78a72c56d69ed36db (patch) | |
tree | 51f6534b0cf9554acab349c67235f0c0bea2b820 /include | |
parent | 7c8e7965e1726ed3fa5e45fea02d93c8df1920ed (diff) | |
download | external_llvm-211678a0d761942578970fc78a72c56d69ed36db.zip external_llvm-211678a0d761942578970fc78a72c56d69ed36db.tar.gz external_llvm-211678a0d761942578970fc78a72c56d69ed36db.tar.bz2 |
Update MachineSSAUpdater with the same changes I made for the IR-level
SSAUpdater. I'm going to try to refactor this to share most of the code
between them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102353 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/CodeGen/MachineSSAUpdater.h | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/include/llvm/CodeGen/MachineSSAUpdater.h b/include/llvm/CodeGen/MachineSSAUpdater.h index ab663fe..979ef01 100644 --- a/include/llvm/CodeGen/MachineSSAUpdater.h +++ b/include/llvm/CodeGen/MachineSSAUpdater.h @@ -23,22 +23,27 @@ namespace llvm { class TargetInstrInfo; class TargetRegisterClass; template<typename T> class SmallVectorImpl; + class BumpPtrAllocator; /// MachineSSAUpdater - This class updates SSA form for a set of virtual /// registers defined in multiple blocks. This is used when code duplication /// or another unstructured transformation wants to rewrite a set of uses of one /// vreg with uses of a set of vregs. class MachineSSAUpdater { +public: + class BBInfo; + typedef SmallVectorImpl<BBInfo*> BlockListTy; + +private: /// AvailableVals - This keeps track of which value to use on a per-block /// basis. When we insert PHI nodes, we keep track of them here. //typedef DenseMap<MachineBasicBlock*, unsigned > AvailableValsTy; void *AV; - /// IncomingPredInfo - We use this as scratch space when doing our recursive - /// walk. This should only be used in GetValueInBlockInternal, normally it - /// should be empty. - //std::vector<std::pair<MachineBasicBlock*, unsigned > > IncomingPredInfo; - void *IPI; + /// BBMap - The GetValueAtEndOfBlock method maintains this mapping from + /// basic blocks to BBInfo structures. + /// typedef DenseMap<MachineBasicBlock*, BBInfo*> BBMapTy; + void *BM; /// VR - Current virtual register whose uses are being updated. unsigned VR; @@ -106,6 +111,15 @@ public: private: void ReplaceRegWith(unsigned OldReg, unsigned NewReg); unsigned GetValueAtEndOfBlockInternal(MachineBasicBlock *BB); + void BuildBlockList(MachineBasicBlock *BB, BlockListTy *BlockList, + BumpPtrAllocator *Allocator); + void FindDominators(BlockListTy *BlockList); + void FindPHIPlacement(BlockListTy *BlockList); + void FindAvailableVals(BlockListTy *BlockList); + void FindExistingPHI(MachineBasicBlock *BB, BlockListTy *BlockList); + bool CheckIfPHIMatches(MachineInstr *PHI); + void RecordMatchingPHI(MachineInstr *PHI); + void operator=(const MachineSSAUpdater&); // DO NOT IMPLEMENT MachineSSAUpdater(const MachineSSAUpdater&); // DO NOT IMPLEMENT }; |