From f81eca0ab908fdcf98ae0efaa75acccc8ba40dc2 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 22 Apr 2010 20:46:50 +0000 Subject: 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 --- include/llvm/CodeGen/FastISel.h | 13 ++++++++++++- include/llvm/CodeGen/SelectionDAGISel.h | 5 ----- 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'include/llvm/CodeGen') 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 &ValueMap; DenseMap &MBBMap; DenseMap &StaticAllocaMap; + std::vector > &PHINodesToUpdate; #ifndef NDEBUG SmallSet &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 &vm, DenseMap &bm, - DenseMap &am + DenseMap &am, + std::vector > &PHINodesToUpdate #ifndef NDEBUG , SmallSet &cil #endif diff --git a/include/llvm/CodeGen/SelectionDAGISel.h b/include/llvm/CodeGen/SelectionDAGISel.h index b2688bba8b..38175808ab 100644 --- a/include/llvm/CodeGen/SelectionDAGISel.h +++ b/include/llvm/CodeGen/SelectionDAGISel.h @@ -295,11 +295,6 @@ private: void ShrinkDemandedOps(); void ComputeLiveOutVRegInfo(); - void HandlePHINodesInSuccessorBlocks(const BasicBlock *LLVMBB); - - bool HandlePHINodesInSuccessorBlocksFast(const BasicBlock *LLVMBB, - FastISel *F); - /// Create the scheduler. If a specific scheduler was specified /// via the SchedulerRegistry, use it, otherwise select the /// one preferred by the target. -- cgit v1.2.3-70-g09d2