Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 1 | //===--- ScheduleDAGSDNodes.cpp - Implement the ScheduleDAGSDNodes class --===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This implements the ScheduleDAG class, which is a base class used by |
| 11 | // scheduling implementation classes. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #define DEBUG_TYPE "pre-RA-sched" |
Dan Gohman | 84fbac5 | 2009-02-06 17:22:58 +0000 | [diff] [blame] | 16 | #include "ScheduleDAGSDNodes.h" |
Dan Gohman | bcea859 | 2009-10-10 01:32:21 +0000 | [diff] [blame] | 17 | #include "InstrEmitter.h" |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 18 | #include "llvm/CodeGen/SelectionDAG.h" |
| 19 | #include "llvm/Target/TargetMachine.h" |
| 20 | #include "llvm/Target/TargetInstrInfo.h" |
| 21 | #include "llvm/Target/TargetRegisterInfo.h" |
David Goodwin | 7104616 | 2009-08-13 16:05:04 +0000 | [diff] [blame] | 22 | #include "llvm/Target/TargetSubtarget.h" |
Daniel Dunbar | 819309e | 2009-12-16 20:10:05 +0000 | [diff] [blame^] | 23 | #include "llvm/Support/CommandLine.h" |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 24 | #include "llvm/Support/Debug.h" |
| 25 | #include "llvm/Support/raw_ostream.h" |
| 26 | using namespace llvm; |
| 27 | |
Daniel Dunbar | 819309e | 2009-12-16 20:10:05 +0000 | [diff] [blame^] | 28 | cl::opt<bool> |
| 29 | DisableInstScheduling("disable-inst-scheduling", |
| 30 | cl::init(false), |
| 31 | cl::desc("Disable instruction scheduling")); |
| 32 | |
Dan Gohman | 79ce276 | 2009-01-15 19:20:50 +0000 | [diff] [blame] | 33 | ScheduleDAGSDNodes::ScheduleDAGSDNodes(MachineFunction &mf) |
| 34 | : ScheduleDAG(mf) { |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 35 | } |
| 36 | |
Dan Gohman | 47ac0f0 | 2009-02-11 04:27:20 +0000 | [diff] [blame] | 37 | /// Run - perform scheduling. |
| 38 | /// |
| 39 | void ScheduleDAGSDNodes::Run(SelectionDAG *dag, MachineBasicBlock *bb, |
| 40 | MachineBasicBlock::iterator insertPos) { |
| 41 | DAG = dag; |
| 42 | ScheduleDAG::Run(bb, insertPos); |
| 43 | } |
| 44 | |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 45 | SUnit *ScheduleDAGSDNodes::Clone(SUnit *Old) { |
| 46 | SUnit *SU = NewSUnit(Old->getNode()); |
| 47 | SU->OrigNode = Old->OrigNode; |
| 48 | SU->Latency = Old->Latency; |
| 49 | SU->isTwoAddress = Old->isTwoAddress; |
| 50 | SU->isCommutable = Old->isCommutable; |
| 51 | SU->hasPhysRegDefs = Old->hasPhysRegDefs; |
Dan Gohman | 3974667 | 2009-03-23 16:10:52 +0000 | [diff] [blame] | 52 | SU->hasPhysRegClobbers = Old->hasPhysRegClobbers; |
Evan Cheng | e57187c | 2009-01-16 20:57:18 +0000 | [diff] [blame] | 53 | Old->isCloned = true; |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 54 | return SU; |
| 55 | } |
| 56 | |
| 57 | /// CheckForPhysRegDependency - Check if the dependency between def and use of |
| 58 | /// a specified operand is a physical register dependency. If so, returns the |
Evan Cheng | c29a56d | 2009-01-12 03:19:55 +0000 | [diff] [blame] | 59 | /// register and the cost of copying the register. |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 60 | static void CheckForPhysRegDependency(SDNode *Def, SDNode *User, unsigned Op, |
| 61 | const TargetRegisterInfo *TRI, |
| 62 | const TargetInstrInfo *TII, |
Evan Cheng | c29a56d | 2009-01-12 03:19:55 +0000 | [diff] [blame] | 63 | unsigned &PhysReg, int &Cost) { |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 64 | if (Op != 2 || User->getOpcode() != ISD::CopyToReg) |
| 65 | return; |
| 66 | |
| 67 | unsigned Reg = cast<RegisterSDNode>(User->getOperand(1))->getReg(); |
| 68 | if (TargetRegisterInfo::isVirtualRegister(Reg)) |
| 69 | return; |
| 70 | |
| 71 | unsigned ResNo = User->getOperand(2).getResNo(); |
| 72 | if (Def->isMachineOpcode()) { |
| 73 | const TargetInstrDesc &II = TII->get(Def->getMachineOpcode()); |
| 74 | if (ResNo >= II.getNumDefs() && |
Evan Cheng | c29a56d | 2009-01-12 03:19:55 +0000 | [diff] [blame] | 75 | II.ImplicitDefs[ResNo - II.getNumDefs()] == Reg) { |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 76 | PhysReg = Reg; |
Evan Cheng | c29a56d | 2009-01-12 03:19:55 +0000 | [diff] [blame] | 77 | const TargetRegisterClass *RC = |
| 78 | TRI->getPhysicalRegisterRegClass(Reg, Def->getValueType(ResNo)); |
| 79 | Cost = RC->getCopyCost(); |
| 80 | } |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 81 | } |
| 82 | } |
| 83 | |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 84 | void ScheduleDAGSDNodes::BuildSchedUnits() { |
Dan Gohman | e1dfc7d | 2008-12-23 17:24:50 +0000 | [diff] [blame] | 85 | // During scheduling, the NodeId field of SDNode is used to map SDNodes |
| 86 | // to their associated SUnits by holding SUnits table indices. A value |
| 87 | // of -1 means the SDNode does not yet have an associated SUnit. |
| 88 | unsigned NumNodes = 0; |
| 89 | for (SelectionDAG::allnodes_iterator NI = DAG->allnodes_begin(), |
| 90 | E = DAG->allnodes_end(); NI != E; ++NI) { |
| 91 | NI->setNodeId(-1); |
| 92 | ++NumNodes; |
| 93 | } |
| 94 | |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 95 | // Reserve entries in the vector for each of the SUnits we are creating. This |
| 96 | // ensure that reallocation of the vector won't happen, so SUnit*'s won't get |
| 97 | // invalidated. |
Dan Gohman | 89b64bd | 2008-12-17 04:30:46 +0000 | [diff] [blame] | 98 | // FIXME: Multiply by 2 because we may clone nodes during scheduling. |
| 99 | // This is a temporary workaround. |
Dan Gohman | e1dfc7d | 2008-12-23 17:24:50 +0000 | [diff] [blame] | 100 | SUnits.reserve(NumNodes * 2); |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 101 | |
Dan Gohman | 3f23744 | 2008-12-16 03:25:46 +0000 | [diff] [blame] | 102 | // Check to see if the scheduler cares about latencies. |
| 103 | bool UnitLatencies = ForceUnitLatencies(); |
| 104 | |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 105 | for (SelectionDAG::allnodes_iterator NI = DAG->allnodes_begin(), |
| 106 | E = DAG->allnodes_end(); NI != E; ++NI) { |
| 107 | if (isPassiveNode(NI)) // Leaf node, e.g. a TargetImmediate. |
| 108 | continue; |
| 109 | |
| 110 | // If this node has already been processed, stop now. |
| 111 | if (NI->getNodeId() != -1) continue; |
| 112 | |
| 113 | SUnit *NodeSUnit = NewSUnit(NI); |
| 114 | |
| 115 | // See if anything is flagged to this node, if so, add them to flagged |
| 116 | // nodes. Nodes can have at most one flag input and one flag output. Flags |
Dan Gohman | db95fa1 | 2009-03-20 20:42:23 +0000 | [diff] [blame] | 117 | // are required to be the last operand and result of a node. |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 118 | |
| 119 | // Scan up to find flagged preds. |
| 120 | SDNode *N = NI; |
Dan Gohman | db95fa1 | 2009-03-20 20:42:23 +0000 | [diff] [blame] | 121 | while (N->getNumOperands() && |
Owen Anderson | 825b72b | 2009-08-11 20:47:22 +0000 | [diff] [blame] | 122 | N->getOperand(N->getNumOperands()-1).getValueType() == MVT::Flag) { |
Dan Gohman | db95fa1 | 2009-03-20 20:42:23 +0000 | [diff] [blame] | 123 | N = N->getOperand(N->getNumOperands()-1).getNode(); |
| 124 | assert(N->getNodeId() == -1 && "Node already inserted!"); |
| 125 | N->setNodeId(NodeSUnit->NodeNum); |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 126 | } |
| 127 | |
| 128 | // Scan down to find any flagged succs. |
| 129 | N = NI; |
Owen Anderson | 825b72b | 2009-08-11 20:47:22 +0000 | [diff] [blame] | 130 | while (N->getValueType(N->getNumValues()-1) == MVT::Flag) { |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 131 | SDValue FlagVal(N, N->getNumValues()-1); |
| 132 | |
| 133 | // There are either zero or one users of the Flag result. |
| 134 | bool HasFlagUse = false; |
| 135 | for (SDNode::use_iterator UI = N->use_begin(), E = N->use_end(); |
| 136 | UI != E; ++UI) |
| 137 | if (FlagVal.isOperandOf(*UI)) { |
| 138 | HasFlagUse = true; |
| 139 | assert(N->getNodeId() == -1 && "Node already inserted!"); |
| 140 | N->setNodeId(NodeSUnit->NodeNum); |
| 141 | N = *UI; |
| 142 | break; |
| 143 | } |
| 144 | if (!HasFlagUse) break; |
| 145 | } |
| 146 | |
| 147 | // If there are flag operands involved, N is now the bottom-most node |
| 148 | // of the sequence of nodes that are flagged together. |
| 149 | // Update the SUnit. |
| 150 | NodeSUnit->setNode(N); |
| 151 | assert(N->getNodeId() == -1 && "Node already inserted!"); |
| 152 | N->setNodeId(NodeSUnit->NodeNum); |
| 153 | |
Dan Gohman | 787782f | 2008-11-21 01:44:51 +0000 | [diff] [blame] | 154 | // Assign the Latency field of NodeSUnit using target-provided information. |
Dan Gohman | 3f23744 | 2008-12-16 03:25:46 +0000 | [diff] [blame] | 155 | if (UnitLatencies) |
| 156 | NodeSUnit->Latency = 1; |
| 157 | else |
| 158 | ComputeLatency(NodeSUnit); |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 159 | } |
Dan Gohman | c9a5b9e | 2008-12-23 18:36:58 +0000 | [diff] [blame] | 160 | } |
| 161 | |
| 162 | void ScheduleDAGSDNodes::AddSchedEdges() { |
David Goodwin | 7104616 | 2009-08-13 16:05:04 +0000 | [diff] [blame] | 163 | const TargetSubtarget &ST = TM.getSubtarget<TargetSubtarget>(); |
| 164 | |
David Goodwin | dc4bdcd | 2009-08-19 16:08:58 +0000 | [diff] [blame] | 165 | // Check to see if the scheduler cares about latencies. |
| 166 | bool UnitLatencies = ForceUnitLatencies(); |
| 167 | |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 168 | // Pass 2: add the preds, succs, etc. |
| 169 | for (unsigned su = 0, e = SUnits.size(); su != e; ++su) { |
| 170 | SUnit *SU = &SUnits[su]; |
| 171 | SDNode *MainNode = SU->getNode(); |
| 172 | |
| 173 | if (MainNode->isMachineOpcode()) { |
| 174 | unsigned Opc = MainNode->getMachineOpcode(); |
| 175 | const TargetInstrDesc &TID = TII->get(Opc); |
| 176 | for (unsigned i = 0; i != TID.getNumOperands(); ++i) { |
| 177 | if (TID.getOperandConstraint(i, TOI::TIED_TO) != -1) { |
| 178 | SU->isTwoAddress = true; |
| 179 | break; |
| 180 | } |
| 181 | } |
| 182 | if (TID.isCommutable()) |
| 183 | SU->isCommutable = true; |
| 184 | } |
| 185 | |
| 186 | // Find all predecessors and successors of the group. |
| 187 | for (SDNode *N = SU->getNode(); N; N = N->getFlaggedNode()) { |
| 188 | if (N->isMachineOpcode() && |
Dan Gohman | 3974667 | 2009-03-23 16:10:52 +0000 | [diff] [blame] | 189 | TII->get(N->getMachineOpcode()).getImplicitDefs()) { |
| 190 | SU->hasPhysRegClobbers = true; |
Dan Gohman | bcea859 | 2009-10-10 01:32:21 +0000 | [diff] [blame] | 191 | unsigned NumUsed = InstrEmitter::CountResults(N); |
Dan Gohman | 8cccf0e | 2009-03-23 17:39:36 +0000 | [diff] [blame] | 192 | while (NumUsed != 0 && !N->hasAnyUseOfValue(NumUsed - 1)) |
| 193 | --NumUsed; // Skip over unused values at the end. |
| 194 | if (NumUsed > TII->get(N->getMachineOpcode()).getNumDefs()) |
Dan Gohman | 3974667 | 2009-03-23 16:10:52 +0000 | [diff] [blame] | 195 | SU->hasPhysRegDefs = true; |
| 196 | } |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 197 | |
| 198 | for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) { |
| 199 | SDNode *OpN = N->getOperand(i).getNode(); |
| 200 | if (isPassiveNode(OpN)) continue; // Not scheduled. |
| 201 | SUnit *OpSU = &SUnits[OpN->getNodeId()]; |
| 202 | assert(OpSU && "Node has no SUnit!"); |
| 203 | if (OpSU == SU) continue; // In the same group. |
| 204 | |
Owen Anderson | e50ed30 | 2009-08-10 22:56:29 +0000 | [diff] [blame] | 205 | EVT OpVT = N->getOperand(i).getValueType(); |
Owen Anderson | 825b72b | 2009-08-11 20:47:22 +0000 | [diff] [blame] | 206 | assert(OpVT != MVT::Flag && "Flagged nodes should be in same sunit!"); |
| 207 | bool isChain = OpVT == MVT::Other; |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 208 | |
| 209 | unsigned PhysReg = 0; |
Evan Cheng | c29a56d | 2009-01-12 03:19:55 +0000 | [diff] [blame] | 210 | int Cost = 1; |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 211 | // Determine if this is a physical register dependency. |
Evan Cheng | c29a56d | 2009-01-12 03:19:55 +0000 | [diff] [blame] | 212 | CheckForPhysRegDependency(OpN, N, i, TRI, TII, PhysReg, Cost); |
Dan Gohman | 54e4c36 | 2008-12-09 22:54:47 +0000 | [diff] [blame] | 213 | assert((PhysReg == 0 || !isChain) && |
| 214 | "Chain dependence via physreg data?"); |
Evan Cheng | c29a56d | 2009-01-12 03:19:55 +0000 | [diff] [blame] | 215 | // FIXME: See ScheduleDAGSDNodes::EmitCopyFromReg. For now, scheduler |
| 216 | // emits a copy from the physical register to a virtual register unless |
| 217 | // it requires a cross class copy (cost < 0). That means we are only |
| 218 | // treating "expensive to copy" register dependency as physical register |
| 219 | // dependency. This may change in the future though. |
| 220 | if (Cost >= 0) |
| 221 | PhysReg = 0; |
David Goodwin | 7104616 | 2009-08-13 16:05:04 +0000 | [diff] [blame] | 222 | |
| 223 | const SDep& dep = SDep(OpSU, isChain ? SDep::Order : SDep::Data, |
| 224 | OpSU->Latency, PhysReg); |
David Goodwin | dc4bdcd | 2009-08-19 16:08:58 +0000 | [diff] [blame] | 225 | if (!isChain && !UnitLatencies) { |
| 226 | ComputeOperandLatency(OpSU, SU, (SDep &)dep); |
| 227 | ST.adjustSchedDependency(OpSU, SU, (SDep &)dep); |
| 228 | } |
David Goodwin | 7104616 | 2009-08-13 16:05:04 +0000 | [diff] [blame] | 229 | |
| 230 | SU->addPred(dep); |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 231 | } |
| 232 | } |
| 233 | } |
| 234 | } |
| 235 | |
Dan Gohman | c9a5b9e | 2008-12-23 18:36:58 +0000 | [diff] [blame] | 236 | /// BuildSchedGraph - Build the SUnit graph from the selection dag that we |
| 237 | /// are input. This SUnit graph is similar to the SelectionDAG, but |
| 238 | /// excludes nodes that aren't interesting to scheduling, and represents |
| 239 | /// flagged together nodes with a single SUnit. |
Dan Gohman | 98976e4 | 2009-10-09 23:33:48 +0000 | [diff] [blame] | 240 | void ScheduleDAGSDNodes::BuildSchedGraph(AliasAnalysis *AA) { |
Dan Gohman | c9a5b9e | 2008-12-23 18:36:58 +0000 | [diff] [blame] | 241 | // Populate the SUnits array. |
| 242 | BuildSchedUnits(); |
| 243 | // Compute all the scheduling dependencies between nodes. |
| 244 | AddSchedEdges(); |
| 245 | } |
| 246 | |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 247 | void ScheduleDAGSDNodes::ComputeLatency(SUnit *SU) { |
| 248 | const InstrItineraryData &InstrItins = TM.getInstrItineraryData(); |
| 249 | |
| 250 | // Compute the latency for the node. We use the sum of the latencies for |
| 251 | // all nodes flagged together into this SUnit. |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 252 | SU->Latency = 0; |
Dan Gohman | c8c2827 | 2008-11-21 00:12:10 +0000 | [diff] [blame] | 253 | for (SDNode *N = SU->getNode(); N; N = N->getFlaggedNode()) |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 254 | if (N->isMachineOpcode()) { |
David Goodwin | dc4bdcd | 2009-08-19 16:08:58 +0000 | [diff] [blame] | 255 | SU->Latency += InstrItins. |
| 256 | getStageLatency(TII->get(N->getMachineOpcode()).getSchedClass()); |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 257 | } |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 258 | } |
| 259 | |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 260 | void ScheduleDAGSDNodes::dumpNode(const SUnit *SU) const { |
Evan Cheng | c29a56d | 2009-01-12 03:19:55 +0000 | [diff] [blame] | 261 | if (!SU->getNode()) { |
Daniel Dunbar | 1cd1d98 | 2009-07-24 10:36:58 +0000 | [diff] [blame] | 262 | errs() << "PHYS REG COPY\n"; |
Evan Cheng | c29a56d | 2009-01-12 03:19:55 +0000 | [diff] [blame] | 263 | return; |
| 264 | } |
| 265 | |
| 266 | SU->getNode()->dump(DAG); |
Daniel Dunbar | 1cd1d98 | 2009-07-24 10:36:58 +0000 | [diff] [blame] | 267 | errs() << "\n"; |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 268 | SmallVector<SDNode *, 4> FlaggedNodes; |
| 269 | for (SDNode *N = SU->getNode()->getFlaggedNode(); N; N = N->getFlaggedNode()) |
| 270 | FlaggedNodes.push_back(N); |
| 271 | while (!FlaggedNodes.empty()) { |
Daniel Dunbar | 1cd1d98 | 2009-07-24 10:36:58 +0000 | [diff] [blame] | 272 | errs() << " "; |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 273 | FlaggedNodes.back()->dump(DAG); |
Daniel Dunbar | 1cd1d98 | 2009-07-24 10:36:58 +0000 | [diff] [blame] | 274 | errs() << "\n"; |
Dan Gohman | 343f0c0 | 2008-11-19 23:18:57 +0000 | [diff] [blame] | 275 | FlaggedNodes.pop_back(); |
| 276 | } |
| 277 | } |
Dan Gohman | bcea859 | 2009-10-10 01:32:21 +0000 | [diff] [blame] | 278 | |
| 279 | /// EmitSchedule - Emit the machine code in scheduled order. |
| 280 | MachineBasicBlock *ScheduleDAGSDNodes:: |
| 281 | EmitSchedule(DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) { |
| 282 | InstrEmitter Emitter(BB, InsertPos); |
| 283 | DenseMap<SDValue, unsigned> VRBaseMap; |
| 284 | DenseMap<SUnit*, unsigned> CopyVRBaseMap; |
| 285 | for (unsigned i = 0, e = Sequence.size(); i != e; i++) { |
| 286 | SUnit *SU = Sequence[i]; |
| 287 | if (!SU) { |
| 288 | // Null SUnit* is a noop. |
| 289 | EmitNoop(); |
| 290 | continue; |
| 291 | } |
| 292 | |
| 293 | // For pre-regalloc scheduling, create instructions corresponding to the |
| 294 | // SDNode and any flagged SDNodes and append them to the block. |
| 295 | if (!SU->getNode()) { |
| 296 | // Emit a copy. |
| 297 | EmitPhysRegCopy(SU, CopyVRBaseMap); |
| 298 | continue; |
| 299 | } |
| 300 | |
| 301 | SmallVector<SDNode *, 4> FlaggedNodes; |
| 302 | for (SDNode *N = SU->getNode()->getFlaggedNode(); N; |
| 303 | N = N->getFlaggedNode()) |
| 304 | FlaggedNodes.push_back(N); |
| 305 | while (!FlaggedNodes.empty()) { |
| 306 | Emitter.EmitNode(FlaggedNodes.back(), SU->OrigNode != SU, SU->isCloned, |
| 307 | VRBaseMap, EM); |
| 308 | FlaggedNodes.pop_back(); |
| 309 | } |
| 310 | Emitter.EmitNode(SU->getNode(), SU->OrigNode != SU, SU->isCloned, |
| 311 | VRBaseMap, EM); |
| 312 | } |
| 313 | |
| 314 | BB = Emitter.getBlock(); |
| 315 | InsertPos = Emitter.getInsertPos(); |
| 316 | return BB; |
| 317 | } |