diff options
author | Dan Gohman <gohman@apple.com> | 2010-04-22 20:46:50 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-04-22 20:46:50 +0000 |
commit | f81eca0ab908fdcf98ae0efaa75acccc8ba40dc2 (patch) | |
tree | d22f48cbface21800721177a712cc71616b031da /include/llvm/CodeGen/FastISel.h | |
parent | f720a4edb0343a288bfc77ccbedfdb164ed37742 (diff) | |
download | llvm-f81eca0ab908fdcf98ae0efaa75acccc8ba40dc2.tar.gz llvm-f81eca0ab908fdcf98ae0efaa75acccc8ba40dc2.tar.bz2 llvm-f81eca0ab908fdcf98ae0efaa75acccc8ba40dc2.tar.xz |
Move HandlePHINodesInSuccessorBlocks functions out of SelectionDAGISel
and into SelectionDAGBuilder and FastISel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102123 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/FastISel.h')
-rw-r--r-- | include/llvm/CodeGen/FastISel.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/FastISel.h b/include/llvm/CodeGen/FastISel.h index 202efe2f9f..8c8698cdc0 100644 --- a/include/llvm/CodeGen/FastISel.h +++ b/include/llvm/CodeGen/FastISel.h @@ -28,6 +28,7 @@ class Instruction; class MachineBasicBlock; class MachineConstantPool; class MachineFunction; +class MachineInstr; class MachineFrameInfo; class MachineRegisterInfo; class TargetData; @@ -46,6 +47,7 @@ protected: DenseMap<const Value *, unsigned> &ValueMap; DenseMap<const BasicBlock *, MachineBasicBlock *> &MBBMap; DenseMap<const AllocaInst *, int> &StaticAllocaMap; + std::vector<std::pair<MachineInstr*, unsigned> > &PHINodesToUpdate; #ifndef NDEBUG SmallSet<const Instruction *, 8> &CatchInfoLost; #endif @@ -105,13 +107,22 @@ public: /// index value. unsigned getRegForGEPIndex(const Value *V); + /// HandlePHINodesInSuccessorBlocks - Handle PHI nodes in successor blocks. + /// Emit code to ensure constants are copied into registers when needed. + /// Remember the virtual registers that need to be added to the Machine PHI + /// nodes as input. We cannot just directly add them, because expansion + /// might result in multiple MBB's for one BB. As such, the start of the + /// BB might correspond to a different MBB than the end. + bool HandlePHINodesInSuccessorBlocks(const BasicBlock *LLVMBB); + virtual ~FastISel(); protected: FastISel(MachineFunction &mf, DenseMap<const Value *, unsigned> &vm, DenseMap<const BasicBlock *, MachineBasicBlock *> &bm, - DenseMap<const AllocaInst *, int> &am + DenseMap<const AllocaInst *, int> &am, + std::vector<std::pair<MachineInstr*, unsigned> > &PHINodesToUpdate #ifndef NDEBUG , SmallSet<const Instruction *, 8> &cil #endif |