blob: a666c5fe2e1ce7af3f3263ee28993dae819af190 [file] [log] [blame]
Chris Lattner2e1749b2002-07-30 03:57:36 +00001//===- InstrSelection.cpp - Machine Independant Inst Selection Driver -----===//
2//
3// Machine-independent driver file for instruction selection. This file
4// constructs a forest of BURG instruction trees and then uses the
5// BURG-generated tree grammar (BURM) to find the optimal instruction sequences
6// for a given machine.
Vikram S. Adve70bc4b52001-07-21 12:41:50 +00007//
Chris Lattner2e1749b2002-07-30 03:57:36 +00008//===----------------------------------------------------------------------===//
Vikram S. Adve70bc4b52001-07-21 12:41:50 +00009
Chris Lattnerfeb60592001-09-07 17:15:18 +000010#include "llvm/CodeGen/InstrSelection.h"
Vikram S. Adve6d353262001-10-17 23:57:50 +000011#include "llvm/CodeGen/InstrSelectionSupport.h"
Chris Lattner06cb1b72002-02-03 07:33:46 +000012#include "llvm/CodeGen/InstrForest.h"
13#include "llvm/CodeGen/MachineCodeForInstruction.h"
Misha Brukmanfce11432002-10-28 00:28:31 +000014#include "llvm/CodeGen/MachineFunction.h"
Chris Lattnerd0f166a2002-12-29 03:13:05 +000015#include "llvm/Target/TargetRegInfo.h"
Chris Lattner06cb1b72002-02-03 07:33:46 +000016#include "llvm/Target/TargetMachine.h"
Chris Lattner2fbfdcf2002-04-07 20:49:59 +000017#include "llvm/Function.h"
Chris Lattner7061dc52001-12-03 18:02:31 +000018#include "llvm/iPHINode.h"
Chris Lattner2e1749b2002-07-30 03:57:36 +000019#include "llvm/Pass.h"
Chris Lattnercee8f9a2001-11-27 00:03:19 +000020#include "Support/CommandLine.h"
Chris Lattnera175ed42002-09-08 21:08:43 +000021#include "Support/LeakDetector.h"
Anand Shuklacfb22d32002-06-25 20:55:50 +000022using std::vector;
Vikram S. Adve70bc4b52001-07-21 12:41:50 +000023
Chris Lattner04120772003-01-15 19:47:53 +000024std::vector<MachineInstr*>
25FixConstantOperandsForInstr(Instruction* vmInstr, MachineInstr* minstr,
26 TargetMachine& target);
27
Chris Lattner2e1749b2002-07-30 03:57:36 +000028namespace {
29 //===--------------------------------------------------------------------===//
30 // SelectDebugLevel - Allow command line control over debugging.
31 //
32 enum SelectDebugLevel_t {
33 Select_NoDebugInfo,
34 Select_PrintMachineCode,
35 Select_DebugInstTrees,
36 Select_DebugBurgTrees,
37 };
Vikram S. Adve70bc4b52001-07-21 12:41:50 +000038
Chris Lattner2e1749b2002-07-30 03:57:36 +000039 // Enable Debug Options to be specified on the command line
40 cl::opt<SelectDebugLevel_t>
41 SelectDebugLevel("dselect", cl::Hidden,
42 cl::desc("enable instruction selection debug information"),
43 cl::values(
44 clEnumValN(Select_NoDebugInfo, "n", "disable debug output"),
45 clEnumValN(Select_PrintMachineCode, "y", "print generated machine code"),
46 clEnumValN(Select_DebugInstTrees, "i",
47 "print debugging info for instruction selection"),
48 clEnumValN(Select_DebugBurgTrees, "b", "print burg trees"),
49 0));
50
51
52 //===--------------------------------------------------------------------===//
53 // InstructionSelection Pass
54 //
55 // This is the actual pass object that drives the instruction selection
56 // process.
57 //
58 class InstructionSelection : public FunctionPass {
59 TargetMachine &Target;
60 void InsertCodeForPhis(Function &F);
61 void InsertPhiElimInstructions(BasicBlock *BB,
Chris Lattnerb91b31c2002-08-09 20:05:34 +000062 const vector<MachineInstr*>& CpVec);
Chris Lattner2e1749b2002-07-30 03:57:36 +000063 void SelectInstructionsForTree(InstrTreeNode* treeRoot, int goalnt);
64 void PostprocessMachineCodeForTree(InstructionNode* instrNode,
65 int ruleForNode, short* nts);
66 public:
67 InstructionSelection(TargetMachine &T) : Target(T) {}
Chris Lattnera0877722002-10-23 03:30:47 +000068
69 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
70 AU.setPreservesCFG();
71 }
Chris Lattner2e1749b2002-07-30 03:57:36 +000072
73 bool runOnFunction(Function &F);
74 };
75}
76
77// Register the pass...
78static RegisterLLC<InstructionSelection>
79X("instselect", "Instruction Selection", createInstructionSelectionPass);
80
Vikram S. Advef3d3ca12003-05-31 07:41:24 +000081TmpInstruction::TmpInstruction(MachineCodeForInstruction& mcfi,
82 Value *s1, Value *s2, const std::string &name)
83 : Instruction(s1->getType(), Instruction::UserOp1, name)
84{
85 mcfi.addTemp(this);
86
Chris Lattnera175ed42002-09-08 21:08:43 +000087 Operands.push_back(Use(s1, this)); // s1 must be nonnull
88 if (s2) {
89 Operands.push_back(Use(s2, this));
90 }
91
92 // TmpInstructions should not be garbage checked.
93 LeakDetector::removeGarbageObject(this);
94}
95
96// Constructor that requires the type of the temporary to be specified.
97// Both S1 and S2 may be NULL.(
Vikram S. Advef3d3ca12003-05-31 07:41:24 +000098TmpInstruction::TmpInstruction(MachineCodeForInstruction& mcfi,
99 const Type *Ty, Value *s1, Value* s2,
Chris Lattnera175ed42002-09-08 21:08:43 +0000100 const std::string &name)
Vikram S. Advef3d3ca12003-05-31 07:41:24 +0000101 : Instruction(Ty, Instruction::UserOp1, name)
102{
103 mcfi.addTemp(this);
104
Chris Lattnera175ed42002-09-08 21:08:43 +0000105 if (s1) { Operands.push_back(Use(s1, this)); }
106 if (s2) { Operands.push_back(Use(s2, this)); }
107
108 // TmpInstructions should not be garbage checked.
109 LeakDetector::removeGarbageObject(this);
110}
111
Chris Lattner2e1749b2002-07-30 03:57:36 +0000112
113bool InstructionSelection::runOnFunction(Function &F)
114{
Vikram S. Adve89df1ae2001-08-28 23:04:38 +0000115 //
116 // Build the instruction trees to be given as inputs to BURG.
117 //
Chris Lattner2e1749b2002-07-30 03:57:36 +0000118 InstrForest instrForest(&F);
Vikram S. Adve89df1ae2001-08-28 23:04:38 +0000119
120 if (SelectDebugLevel >= Select_DebugInstTrees)
121 {
Chris Lattner04120772003-01-15 19:47:53 +0000122 std::cerr << "\n\n*** Input to instruction selection for function "
123 << F.getName() << "\n\n" << F
124 << "\n\n*** Instruction trees for function "
125 << F.getName() << "\n\n";
Vikram S. Adve89df1ae2001-08-28 23:04:38 +0000126 instrForest.dump();
127 }
Vikram S. Adve70bc4b52001-07-21 12:41:50 +0000128
129 //
130 // Invoke BURG instruction selection for each tree
131 //
Vikram S. Adve4e7bc492002-03-24 03:36:52 +0000132 for (InstrForest::const_root_iterator RI = instrForest.roots_begin();
133 RI != instrForest.roots_end(); ++RI)
Vikram S. Adve6e447182001-09-18 12:56:28 +0000134 {
Vikram S. Adve4e7bc492002-03-24 03:36:52 +0000135 InstructionNode* basicNode = *RI;
136 assert(basicNode->parent() == NULL && "A `root' node has a parent?");
Vikram S. Adve70bc4b52001-07-21 12:41:50 +0000137
Vikram S. Adve6e447182001-09-18 12:56:28 +0000138 // Invoke BURM to label each tree node with a state
139 burm_label(basicNode);
Vikram S. Adve70bc4b52001-07-21 12:41:50 +0000140
Vikram S. Adve6e447182001-09-18 12:56:28 +0000141 if (SelectDebugLevel >= Select_DebugBurgTrees)
142 {
143 printcover(basicNode, 1, 0);
Chris Lattner04120772003-01-15 19:47:53 +0000144 std::cerr << "\nCover cost == " << treecost(basicNode, 1, 0) <<"\n\n";
Vikram S. Adve6e447182001-09-18 12:56:28 +0000145 printMatches(basicNode);
146 }
147
148 // Then recursively walk the tree to select instructions
Chris Lattner2e1749b2002-07-30 03:57:36 +0000149 SelectInstructionsForTree(basicNode, /*goalnt*/1);
Vikram S. Adve70bc4b52001-07-21 12:41:50 +0000150 }
151
Vikram S. Adve76d35202001-07-30 18:48:43 +0000152 //
Chris Lattnerd0aa0cd2002-10-28 05:30:46 +0000153 // Create the MachineBasicBlock records and add all of the MachineInstrs
154 // defined in the MachineCodeForInstruction objects to also live in the
155 // MachineBasicBlock objects.
Vikram S. Adve76d35202001-07-30 18:48:43 +0000156 //
Chris Lattnerd0aa0cd2002-10-28 05:30:46 +0000157 MachineFunction &MF = MachineFunction::get(&F);
158 for (Function::iterator BI = F.begin(), BE = F.end(); BI != BE; ++BI) {
159 MachineBasicBlock *MCBB = new MachineBasicBlock(BI);
160 MF.getBasicBlockList().push_back(MCBB);
161
Chris Lattner0b12b5f2002-06-25 16:13:21 +0000162 for (BasicBlock::iterator II = BI->begin(); II != BI->end(); ++II) {
Chris Lattner2e1749b2002-07-30 03:57:36 +0000163 MachineCodeForInstruction &mvec = MachineCodeForInstruction::get(II);
Chris Lattnerd0aa0cd2002-10-28 05:30:46 +0000164 MCBB->insert(MCBB->end(), mvec.begin(), mvec.end());
Vikram S. Adve76d35202001-07-30 18:48:43 +0000165 }
Chris Lattnerd0aa0cd2002-10-28 05:30:46 +0000166 }
Ruchira Sasankab2490fc2001-11-12 14:44:50 +0000167
Chris Lattner2e1749b2002-07-30 03:57:36 +0000168 // Insert phi elimination code
169 InsertCodeForPhis(F);
Vikram S. Adve76d35202001-07-30 18:48:43 +0000170
Vikram S. Adve6e447182001-09-18 12:56:28 +0000171 if (SelectDebugLevel >= Select_PrintMachineCode)
172 {
Chris Lattner04120772003-01-15 19:47:53 +0000173 std::cerr << "\n*** Machine instructions after INSTRUCTION SELECTION\n";
Misha Brukmanfce11432002-10-28 00:28:31 +0000174 MachineFunction::get(&F).dump();
Vikram S. Adve6e447182001-09-18 12:56:28 +0000175 }
Vikram S. Adve89df1ae2001-08-28 23:04:38 +0000176
Chris Lattner2e1749b2002-07-30 03:57:36 +0000177 return true;
Ruchira Sasankab2490fc2001-11-12 14:44:50 +0000178}
179
Ruchira Sasanka20ac79e2001-11-15 00:27:14 +0000180
181//-------------------------------------------------------------------------
182// This method inserts phi elimination code for all BBs in a method
183//-------------------------------------------------------------------------
Ruchira Sasanka20ac79e2001-11-15 00:27:14 +0000184
Vikram S. Adve1ed009f2002-03-18 03:31:54 +0000185void
Chris Lattner2e1749b2002-07-30 03:57:36 +0000186InstructionSelection::InsertCodeForPhis(Function &F)
Vikram S. Adve1ed009f2002-03-18 03:31:54 +0000187{
Chris Lattner2fbfdcf2002-04-07 20:49:59 +0000188 // for all basic blocks in function
Ruchira Sasanka20ac79e2001-11-15 00:27:14 +0000189 //
Chris Lattnerfcffe862002-10-28 19:01:16 +0000190 MachineFunction &MF = MachineFunction::get(&F);
191 for (MachineFunction::iterator BB = MF.begin(); BB != MF.end(); ++BB) {
Chris Lattner8d3f8e22003-07-26 23:29:51 +0000192 for (BasicBlock::const_iterator IIt = BB->getBasicBlock()->begin();
193 const PHINode *PN = dyn_cast<PHINode>(IIt); ++IIt) {
Chris Lattner0b12b5f2002-06-25 16:13:21 +0000194 // FIXME: This is probably wrong...
195 Value *PhiCpRes = new PHINode(PN->getType(), "PhiCp:");
Chris Lattner823c4ab2002-09-08 21:19:29 +0000196
197 // The leak detector shouldn't track these nodes. They are not garbage,
198 // even though their parent field is never filled in.
199 //
200 LeakDetector::removeGarbageObject(PhiCpRes);
201
Chris Lattner0b12b5f2002-06-25 16:13:21 +0000202 // for each incoming value of the phi, insert phi elimination
203 //
204 for (unsigned i = 0; i < PN->getNumIncomingValues(); ++i) {
205 // insert the copy instruction to the predecessor BB
206 vector<MachineInstr*> mvec, CpVec;
Chris Lattner2e1749b2002-07-30 03:57:36 +0000207 Target.getRegInfo().cpValue2Value(PN->getIncomingValue(i), PhiCpRes,
Chris Lattner0b12b5f2002-06-25 16:13:21 +0000208 mvec);
209 for (vector<MachineInstr*>::iterator MI=mvec.begin();
210 MI != mvec.end(); ++MI) {
211 vector<MachineInstr*> CpVec2 =
Chris Lattner8d3f8e22003-07-26 23:29:51 +0000212 FixConstantOperandsForInstr(const_cast<PHINode*>(PN), *MI, Target);
Chris Lattner0b12b5f2002-06-25 16:13:21 +0000213 CpVec2.push_back(*MI);
214 CpVec.insert(CpVec.end(), CpVec2.begin(), CpVec2.end());
215 }
Vikram S. Adve1ed009f2002-03-18 03:31:54 +0000216
Chris Lattner0b12b5f2002-06-25 16:13:21 +0000217 InsertPhiElimInstructions(PN->getIncomingBlock(i), CpVec);
Ruchira Sasanka20ac79e2001-11-15 00:27:14 +0000218 }
Ruchira Sasanka20ac79e2001-11-15 00:27:14 +0000219
Chris Lattner0b12b5f2002-06-25 16:13:21 +0000220 vector<MachineInstr*> mvec;
Chris Lattner8d3f8e22003-07-26 23:29:51 +0000221 Target.getRegInfo().cpValue2Value(PhiCpRes, const_cast<PHINode*>(PN),
222 mvec);
Chris Lattnerfcffe862002-10-28 19:01:16 +0000223 BB->insert(BB->begin(), mvec.begin(), mvec.end());
Ruchira Sasanka20ac79e2001-11-15 00:27:14 +0000224 } // for each Phi Instr in BB
Chris Lattner2fbfdcf2002-04-07 20:49:59 +0000225 } // for all BBs in function
Ruchira Sasanka20ac79e2001-11-15 00:27:14 +0000226}
227
Chris Lattner2e1749b2002-07-30 03:57:36 +0000228//-------------------------------------------------------------------------
229// Thid method inserts a copy instruction to a predecessor BB as a result
230// of phi elimination.
231//-------------------------------------------------------------------------
Ruchira Sasanka20ac79e2001-11-15 00:27:14 +0000232
Chris Lattner2e1749b2002-07-30 03:57:36 +0000233void
234InstructionSelection::InsertPhiElimInstructions(BasicBlock *BB,
Chris Lattner0006bd72002-11-09 00:49:43 +0000235 const vector<MachineInstr*>& CpVec)
Chris Lattner2e1749b2002-07-30 03:57:36 +0000236{
237 Instruction *TermInst = (Instruction*)BB->getTerminator();
238 MachineCodeForInstruction &MC4Term = MachineCodeForInstruction::get(TermInst);
239 MachineInstr *FirstMIOfTerm = MC4Term.front();
Chris Lattner2e1749b2002-07-30 03:57:36 +0000240 assert (FirstMIOfTerm && "No Machine Instrs for terminator");
Chris Lattnerfcffe862002-10-28 19:01:16 +0000241
242 MachineFunction &MF = MachineFunction::get(BB->getParent());
Chris Lattnerfcffe862002-10-28 19:01:16 +0000243
244 // FIXME: if PHI instructions existed in the machine code, this would be
245 // unnecesary.
Chris Lattner0006bd72002-11-09 00:49:43 +0000246 MachineBasicBlock *MBB = 0;
Chris Lattnerfcffe862002-10-28 19:01:16 +0000247 for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I)
248 if (I->getBasicBlock() == BB) {
249 MBB = I;
250 break;
251 }
Vikram S. Adve6d353262001-10-17 23:57:50 +0000252
Chris Lattner2e1749b2002-07-30 03:57:36 +0000253 // find the position of first machine instruction generated by the
254 // terminator of this BB
Chris Lattner55291ea2002-10-28 01:41:47 +0000255 MachineBasicBlock::iterator MCIt =
Chris Lattnerfcffe862002-10-28 19:01:16 +0000256 std::find(MBB->begin(), MBB->end(), FirstMIOfTerm);
Chris Lattner2e1749b2002-07-30 03:57:36 +0000257
Chris Lattnerfcffe862002-10-28 19:01:16 +0000258 assert(MCIt != MBB->end() && "Start inst of terminator not found");
Chris Lattner2e1749b2002-07-30 03:57:36 +0000259
260 // insert the copy instructions just before the first machine instruction
261 // generated for the terminator
Chris Lattnerfcffe862002-10-28 19:01:16 +0000262 MBB->insert(MCIt, CpVec.begin(), CpVec.end());
Vikram S. Adve6d353262001-10-17 23:57:50 +0000263}
264
Chris Lattner2e1749b2002-07-30 03:57:36 +0000265
Vikram S. Adve6d353262001-10-17 23:57:50 +0000266//---------------------------------------------------------------------------
Vikram S. Adve70bc4b52001-07-21 12:41:50 +0000267// Function SelectInstructionsForTree
268//
269// Recursively walk the tree to select instructions.
270// Do this top-down so that child instructions can exploit decisions
271// made at the child instructions.
272//
273// E.g., if br(setle(reg,const)) decides the constant is 0 and uses
274// a branch-on-integer-register instruction, then the setle node
275// can use that information to avoid generating the SUBcc instruction.
276//
277// Note that this cannot be done bottom-up because setle must do this
278// only if it is a child of the branch (otherwise, the result of setle
279// may be used by multiple instructions).
280//---------------------------------------------------------------------------
281
Chris Lattner2e1749b2002-07-30 03:57:36 +0000282void
283InstructionSelection::SelectInstructionsForTree(InstrTreeNode* treeRoot,
284 int goalnt)
Vikram S. Adve6e447182001-09-18 12:56:28 +0000285{
Vikram S. Adve70bc4b52001-07-21 12:41:50 +0000286 // Get the rule that matches this node.
287 //
288 int ruleForNode = burm_rule(treeRoot->state, goalnt);
289
Chris Lattner2e1749b2002-07-30 03:57:36 +0000290 if (ruleForNode == 0) {
Chris Lattner04120772003-01-15 19:47:53 +0000291 std::cerr << "Could not match instruction tree for instr selection\n";
Chris Lattner2e1749b2002-07-30 03:57:36 +0000292 abort();
293 }
Vikram S. Adve70bc4b52001-07-21 12:41:50 +0000294
295 // Get this rule's non-terminals and the corresponding child nodes (if any)
296 //
297 short *nts = burm_nts[ruleForNode];
298
Vikram S. Adve70bc4b52001-07-21 12:41:50 +0000299 // First, select instructions for the current node and rule.
300 // (If this is a list node, not an instruction, then skip this step).
301 // This function is specific to the target architecture.
302 //
Vikram S. Adve6e447182001-09-18 12:56:28 +0000303 if (treeRoot->opLabel != VRegListOp)
304 {
Chris Lattnerb91b31c2002-08-09 20:05:34 +0000305 vector<MachineInstr*> minstrVec;
Vikram S. Adve1ed009f2002-03-18 03:31:54 +0000306
Vikram S. Adve6e447182001-09-18 12:56:28 +0000307 InstructionNode* instrNode = (InstructionNode*)treeRoot;
308 assert(instrNode->getNodeType() == InstrTreeNode::NTInstructionNode);
Vikram S. Adve7ad10462001-10-22 13:51:09 +0000309
Chris Lattner2e1749b2002-07-30 03:57:36 +0000310 GetInstructionsByRule(instrNode, ruleForNode, nts, Target, minstrVec);
Vikram S. Adve1ed009f2002-03-18 03:31:54 +0000311
Chris Lattner06cb1b72002-02-03 07:33:46 +0000312 MachineCodeForInstruction &mvec =
313 MachineCodeForInstruction::get(instrNode->getInstruction());
Vikram S. Adve1ed009f2002-03-18 03:31:54 +0000314 mvec.insert(mvec.end(), minstrVec.begin(), minstrVec.end());
Vikram S. Adve70bc4b52001-07-21 12:41:50 +0000315 }
316
317 // Then, recursively compile the child nodes, if any.
318 //
Vikram S. Adve6e447182001-09-18 12:56:28 +0000319 if (nts[0])
320 { // i.e., there is at least one kid
321 InstrTreeNode* kids[2];
322 int currentRule = ruleForNode;
Vikram S. Adve70bc4b52001-07-21 12:41:50 +0000323 burm_kids(treeRoot, currentRule, kids);
Vikram S. Adve6e447182001-09-18 12:56:28 +0000324
325 // First skip over any chain rules so that we don't visit
326 // the current node again.
327 //
328 while (ThisIsAChainRule(currentRule))
329 {
330 currentRule = burm_rule(treeRoot->state, nts[0]);
331 nts = burm_nts[currentRule];
332 burm_kids(treeRoot, currentRule, kids);
333 }
Chris Lattner0e6530e2001-09-14 03:37:52 +0000334
Vikram S. Adve6e447182001-09-18 12:56:28 +0000335 // Now we have the first non-chain rule so we have found
336 // the actual child nodes. Recursively compile them.
337 //
Chris Lattner2e1749b2002-07-30 03:57:36 +0000338 for (unsigned i = 0; nts[i]; i++)
Vikram S. Adve6e447182001-09-18 12:56:28 +0000339 {
340 assert(i < 2);
341 InstrTreeNode::InstrTreeNodeType nodeType = kids[i]->getNodeType();
342 if (nodeType == InstrTreeNode::NTVRegListNode ||
343 nodeType == InstrTreeNode::NTInstructionNode)
Chris Lattner2e1749b2002-07-30 03:57:36 +0000344 SelectInstructionsForTree(kids[i], nts[i]);
Vikram S. Adve6e447182001-09-18 12:56:28 +0000345 }
Chris Lattner0e6530e2001-09-14 03:37:52 +0000346 }
Vikram S. Adve70bc4b52001-07-21 12:41:50 +0000347
Vikram S. Adve6d353262001-10-17 23:57:50 +0000348 // Finally, do any postprocessing on this node after its children
349 // have been translated
350 //
351 if (treeRoot->opLabel != VRegListOp)
Chris Lattner2e1749b2002-07-30 03:57:36 +0000352 PostprocessMachineCodeForTree((InstructionNode*)treeRoot, ruleForNode, nts);
353}
354
355//---------------------------------------------------------------------------
356// Function PostprocessMachineCodeForTree
357//
358// Apply any final cleanups to machine code for the root of a subtree
359// after selection for all its children has been completed.
360//
361void
362InstructionSelection::PostprocessMachineCodeForTree(InstructionNode* instrNode,
363 int ruleForNode,
364 short* nts)
365{
366 // Fix up any constant operands in the machine instructions to either
367 // use an immediate field or to load the constant into a register
368 // Walk backwards and use direct indexes to allow insertion before current
369 //
370 Instruction* vmInstr = instrNode->getInstruction();
371 MachineCodeForInstruction &mvec = MachineCodeForInstruction::get(vmInstr);
Chris Lattnerb91b31c2002-08-09 20:05:34 +0000372 for (unsigned i = mvec.size(); i != 0; --i)
Vikram S. Adve6d353262001-10-17 23:57:50 +0000373 {
Chris Lattnerb91b31c2002-08-09 20:05:34 +0000374 vector<MachineInstr*> loadConstVec =
375 FixConstantOperandsForInstr(vmInstr, mvec[i-1], Target);
Chris Lattner2e1749b2002-07-30 03:57:36 +0000376
Chris Lattnerb91b31c2002-08-09 20:05:34 +0000377 mvec.insert(mvec.begin()+i-1, loadConstVec.begin(), loadConstVec.end());
Vikram S. Adve6d353262001-10-17 23:57:50 +0000378 }
Chris Lattner2e1749b2002-07-30 03:57:36 +0000379}
380
381
382
383//===----------------------------------------------------------------------===//
384// createInstructionSelectionPass - Public entrypoint for instruction selection
385// and this file as a whole...
386//
387Pass *createInstructionSelectionPass(TargetMachine &T) {
388 return new InstructionSelection(T);
Vikram S. Adve70bc4b52001-07-21 12:41:50 +0000389}