From 2641cad180e94c0d26630d4ed455352f19be3d3e Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Fri, 28 Jul 2006 00:47:19 +0000 Subject: [PATCH] Remove InFlightSet hack. No longer needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29373 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/SelectionDAG.h | 10 ----- lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 14 ------- lib/Target/ARM/ARMISelDAGToDAG.cpp | 1 - lib/Target/Alpha/AlphaISelDAGToDAG.cpp | 1 - lib/Target/IA64/IA64ISelDAGToDAG.cpp | 1 - lib/Target/PowerPC/PPCISelDAGToDAG.cpp | 1 - lib/Target/Sparc/SparcISelDAGToDAG.cpp | 1 - utils/TableGen/DAGISelEmitter.cpp | 46 ----------------------- 8 files changed, 75 deletions(-) diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h index 4de4161103a..91d2800cc42 100644 --- a/include/llvm/CodeGen/SelectionDAG.h +++ b/include/llvm/CodeGen/SelectionDAG.h @@ -435,16 +435,6 @@ public: SDNode *Key, unsigned KeyResNo, SDNode *Element, unsigned ElementResNo); - /// InsertInFlightSetEntry - A helper function to insert a SDNode* to a - /// SDNode* set. This is added to avoid the set insertion operator from being - /// inlined. - static void InsertInFlightSetEntry(std::set &Set, SDNode *N); - - /// RemoveInFlightSetEntry - A helper function to remove a SDNode* from a - /// SDNode* set. This is added to avoid the set removal operator from being - /// inlined. - static void RemoveInFlightSetEntry(std::set &Set, SDNode *N); - private: void RemoveNodeFromCSEMaps(SDNode *N); SDNode *AddNonLeafNodeToCSEMaps(SDNode *N); diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 1a5a09b1dc9..8c40a72bec1 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -3115,17 +3115,3 @@ void SelectionDAG::InsertISelMapEntry(std::map &Map, Map.insert(std::make_pair(SDOperand(Key, KeyResNo), SDOperand(Element, ElementResNo))); } - -/// InsertInFlightSetEntry - A helper function to insert a SDNode* to a -/// SDNode* set. This is added to avoid the set insertion operator from being -/// inlined. -void SelectionDAG::InsertInFlightSetEntry(std::set &Set, SDNode *N) { - Set.insert(N); -} - -/// RemoveInFlightSetEntry - A helper function to remove a SDNode* from a -/// SDNode* set. This is added to avoid the set removal operator from being -/// inlined. -void SelectionDAG::RemoveInFlightSetEntry(std::set &Set, SDNode *N) { - Set.erase(N); -} diff --git a/lib/Target/ARM/ARMISelDAGToDAG.cpp b/lib/Target/ARM/ARMISelDAGToDAG.cpp index 8ca7c0b40c0..59704cb4149 100644 --- a/lib/Target/ARM/ARMISelDAGToDAG.cpp +++ b/lib/Target/ARM/ARMISelDAGToDAG.cpp @@ -282,7 +282,6 @@ void ARMDAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) { DEBUG(BB->dump()); DAG.setRoot(SelectRoot(DAG.getRoot())); - assert(InFlightSet.empty() && "ISel InFlightSet has not been emptied!"); CodeGenMap.clear(); HandleMap.clear(); ReplaceMap.clear(); diff --git a/lib/Target/Alpha/AlphaISelDAGToDAG.cpp b/lib/Target/Alpha/AlphaISelDAGToDAG.cpp index 32d5222a025..78a78143c15 100644 --- a/lib/Target/Alpha/AlphaISelDAGToDAG.cpp +++ b/lib/Target/Alpha/AlphaISelDAGToDAG.cpp @@ -172,7 +172,6 @@ void AlphaDAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) { // Select target instructions for the DAG. DAG.setRoot(SelectRoot(DAG.getRoot())); - assert(InFlightSet.empty() && "ISel InFlightSet has not been emptied!"); CodeGenMap.clear(); HandleMap.clear(); ReplaceMap.clear(); diff --git a/lib/Target/IA64/IA64ISelDAGToDAG.cpp b/lib/Target/IA64/IA64ISelDAGToDAG.cpp index 3fb7b2a3b8a..fe5a7bb0abd 100644 --- a/lib/Target/IA64/IA64ISelDAGToDAG.cpp +++ b/lib/Target/IA64/IA64ISelDAGToDAG.cpp @@ -142,7 +142,6 @@ void IA64DAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) { // Select target instructions for the DAG. DAG.setRoot(SelectRoot(DAG.getRoot())); - assert(InFlightSet.empty() && "ISel InFlightSet has not been emptied!"); CodeGenMap.clear(); HandleMap.clear(); ReplaceMap.clear(); diff --git a/lib/Target/PowerPC/PPCISelDAGToDAG.cpp b/lib/Target/PowerPC/PPCISelDAGToDAG.cpp index 99d97881491..937092ab029 100644 --- a/lib/Target/PowerPC/PPCISelDAGToDAG.cpp +++ b/lib/Target/PowerPC/PPCISelDAGToDAG.cpp @@ -215,7 +215,6 @@ void PPCDAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) { // Select target instructions for the DAG. DAG.setRoot(SelectRoot(DAG.getRoot())); - assert(InFlightSet.empty() && "ISel InFlightSet has not been emptied!"); CodeGenMap.clear(); HandleMap.clear(); ReplaceMap.clear(); diff --git a/lib/Target/Sparc/SparcISelDAGToDAG.cpp b/lib/Target/Sparc/SparcISelDAGToDAG.cpp index 4be7fa582d0..1004109524d 100644 --- a/lib/Target/Sparc/SparcISelDAGToDAG.cpp +++ b/lib/Target/Sparc/SparcISelDAGToDAG.cpp @@ -1001,7 +1001,6 @@ void SparcDAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) { // Select target instructions for the DAG. DAG.setRoot(SelectRoot(DAG.getRoot())); - assert(InFlightSet.empty() && "ISel InFlightSet has not been emptied!"); CodeGenMap.clear(); HandleMap.clear(); ReplaceMap.clear(); diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp index 935038ba3f6..fa4d8492e44 100644 --- a/utils/TableGen/DAGISelEmitter.cpp +++ b/utils/TableGen/DAGISelEmitter.cpp @@ -2106,8 +2106,6 @@ private: // Names of all the folded nodes which produce chains. std::vector > FoldedChains; std::set Duplicates; - /// These nodes are being marked "in-flight" so they cannot be folded. - std::vector InflightNodes; /// GeneratedCode - This is the buffer that we emit code to. The first bool /// indicates whether this is an exit predicate (something that should be @@ -2231,8 +2229,6 @@ public: OpNo = 1; if (!isRoot) { const SDNodeInfo &CInfo = ISE.getSDNodeInfo(N->getOperator()); - // Not in flight? - emitCheck("InFlightSet.count(" + RootName + ".Val) == 0"); // Multiple uses of actual result? emitCheck(RootName + ".hasOneUse()"); EmittedUseCheck = true; @@ -2477,23 +2473,8 @@ public: for (unsigned i = 0; i < NumRes; i++) Code += ", CPTmp" + utostr(i + ResNo); emitCode(Code + ");"); - if (InflightNodes.size()) { - // Remove the in-flight nodes if the ComplexPattern does not match! - emitCode("if (!Match) {"); - for (std::vector::iterator AI = InflightNodes.begin(), - AE = InflightNodes.end(); AI != AE; ++AI) - emitCode(" SelectionDAG::RemoveInFlightSetEntry(InFlightSet, " + - *AI + ".Val);"); - emitCode("}"); - } - emitCheck("Match"); - for (unsigned i = 0; i < NumRes; ++i) { - emitCode("SelectionDAG::InsertInFlightSetEntry(InFlightSet, CPTmp" + - utostr(i+ResNo) + ".Val);"); - InflightNodes.push_back("CPTmp" + utostr(i+ResNo)); - } for (unsigned i = 0; i < NumRes; ++i) { emitDecl("Tmp" + utostr(i+ResNo)); emitCode("Select(Tmp" + utostr(i+ResNo) + ", CPTmp" + @@ -2608,22 +2589,6 @@ public: } } - // Make sure these operands which would be selected won't be folded while - // the isel traverses the DAG upward. - for (unsigned i = 0, e = EmitOrder.size(); i != e; ++i) { - TreePatternNode *Child = EmitOrder[i].second; - if (!Child->getName().empty()) { - std::string &Val = VariableMap[Child->getName()]; - assert(!Val.empty() && - "Variable referenced but not defined and not caught earlier!"); - if (Child->isLeaf() && !NodeGetComplexPattern(Child, ISE)) { - emitCode("SelectionDAG::InsertInFlightSetEntry(InFlightSet, " + - Val + ".Val);"); - InflightNodes.push_back(Val); - } - } - } - // Emit all of the operands. std::vector > NumTemps(EmitOrder.size()); for (unsigned i = 0, e = EmitOrder.size(); i != e; ++i) { @@ -2651,14 +2616,6 @@ public: emitCode(" Select(InFlag, N.getOperand(N.getNumOperands()-1));"); } - if (isRoot) { - // The operands have been selected. Remove them from InFlightSet. - for (std::vector::iterator AI = InflightNodes.begin(), - AE = InflightNodes.end(); AI != AE; ++AI) - emitCode("SelectionDAG::RemoveInFlightSetEntry(InFlightSet, " + - *AI + ".Val);"); - } - unsigned NumResults = Inst.getNumResults(); unsigned ResNo = TmpNo++; if (!isRoot || InputHasChain || NodeHasChain || NodeHasOutFlag || @@ -3639,9 +3596,6 @@ void DAGISelEmitter::run(std::ostream &OS) { OS << "// Instance var to keep track of mapping of place handle nodes\n" << "// and their replacement nodes.\n"; OS << "std::map ReplaceMap;\n"; - OS << "// Keep track of nodes that are currently being selecte and therefore\n" - << "// should not be folded.\n"; - OS << "std::set InFlightSet;\n"; OS << "\n"; OS << "// AddHandleReplacement - Note the pending replacement node for a\n"