blob: 914fec3576288f670fe1aa6c8cc904a2c998b4cd [file] [log] [blame]
Chris Lattner035dfbe2002-08-09 20:08:06 +00001//===-- InstrSelectionSupport.cpp -----------------------------------------===//
2//
3// Target-independent instruction selection code. See SparcInstrSelection.cpp
4// for usage.
Vikram S. Advea1d14f32001-10-10 20:50:43 +00005//
Chris Lattner035dfbe2002-08-09 20:08:06 +00006//===----------------------------------------------------------------------===//
Vikram S. Advea1d14f32001-10-10 20:50:43 +00007
8#include "llvm/CodeGen/InstrSelectionSupport.h"
9#include "llvm/CodeGen/InstrSelection.h"
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +000010#include "llvm/CodeGen/MachineInstr.h"
11#include "llvm/CodeGen/MachineInstrAnnot.h"
Chris Lattnerfb3b1ec2002-02-03 07:39:06 +000012#include "llvm/CodeGen/MachineCodeForInstruction.h"
13#include "llvm/CodeGen/MachineCodeForMethod.h"
14#include "llvm/CodeGen/InstrForest.h"
Vikram S. Advea1d14f32001-10-10 20:50:43 +000015#include "llvm/Target/TargetMachine.h"
16#include "llvm/Target/MachineRegInfo.h"
Chris Lattner31bcdb82002-04-28 19:55:58 +000017#include "llvm/Constants.h"
Chris Lattner2fbfdcf2002-04-07 20:49:59 +000018#include "llvm/Function.h"
Vikram S. Advea1d14f32001-10-10 20:50:43 +000019#include "llvm/Type.h"
20#include "llvm/iMemory.h"
Chris Lattner697954c2002-01-20 22:54:45 +000021using std::vector;
Vikram S. Advea1d14f32001-10-10 20:50:43 +000022
23//*************************** Local Functions ******************************/
24
Vikram S. Advea1d14f32001-10-10 20:50:43 +000025
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +000026// Generate code to load the constant into a TmpInstruction (virtual reg) and
27// returns the virtual register.
28//
Vikram S. Adve6d353262001-10-17 23:57:50 +000029static TmpInstruction*
Chris Lattner2fbfdcf2002-04-07 20:49:59 +000030InsertCodeToLoadConstant(Function *F,
Vikram S. Adve42f63202002-03-18 03:33:43 +000031 Value* opValue,
Vikram S. Adve6d353262001-10-17 23:57:50 +000032 Instruction* vmInstr,
33 vector<MachineInstr*>& loadConstVec,
34 TargetMachine& target)
Vikram S. Advea1d14f32001-10-10 20:50:43 +000035{
Vikram S. Adve6d353262001-10-17 23:57:50 +000036 // Create a tmp virtual register to hold the constant.
Chris Lattnerfb3b1ec2002-02-03 07:39:06 +000037 TmpInstruction* tmpReg = new TmpInstruction(opValue);
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +000038 MachineCodeForInstruction &mcfi = MachineCodeForInstruction::get(vmInstr);
39 mcfi.addTemp(tmpReg);
Vikram S. Advea1d14f32001-10-10 20:50:43 +000040
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +000041 target.getInstrInfo().CreateCodeToLoadConst(target, F, opValue, tmpReg,
42 loadConstVec, mcfi);
Vikram S. Adve6d353262001-10-17 23:57:50 +000043
44 // Record the mapping from the tmp VM instruction to machine instruction.
45 // Do this for all machine instructions that were not mapped to any
46 // other temp values created by
47 // tmpReg->addMachineInstruction(loadConstVec.back());
48
49 return tmpReg;
Vikram S. Advea1d14f32001-10-10 20:50:43 +000050}
51
52
Vikram S. Adve6d353262001-10-17 23:57:50 +000053//---------------------------------------------------------------------------
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +000054// Function GetConstantValueAsUnsignedInt
Vikram S. Adve6d353262001-10-17 23:57:50 +000055// Function GetConstantValueAsSignedInt
56//
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +000057// Convenience functions to get the value of an integral constant, for an
58// appropriate integer or non-integer type that can be held in a signed
59// or unsigned integer respectively. The type of the argument must be
60// the following:
Vikram S. Adve6d353262001-10-17 23:57:50 +000061// Signed or unsigned integer
62// Boolean
63// Pointer
64//
65// isValidConstant is set to true if a valid constant was found.
66//---------------------------------------------------------------------------
67
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +000068uint64_t
69GetConstantValueAsUnsignedInt(const Value *V,
70 bool &isValidConstant)
Vikram S. Advea1d14f32001-10-10 20:50:43 +000071{
Vikram S. Adve6d353262001-10-17 23:57:50 +000072 isValidConstant = true;
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +000073
74 if (isa<Constant>(V))
75 if (V->getType() == Type::BoolTy)
76 return (int64_t) cast<ConstantBool>(V)->getValue();
77 else if (V->getType()->isIntegral())
78 return (V->getType()->isUnsigned()
79 ? cast<ConstantUInt>(V)->getValue()
80 : (uint64_t) cast<ConstantSInt>(V)->getValue());
81
Vikram S. Adve6d353262001-10-17 23:57:50 +000082 isValidConstant = false;
83 return 0;
Vikram S. Advea1d14f32001-10-10 20:50:43 +000084}
85
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +000086int64_t
87GetConstantValueAsSignedInt(const Value *V,
88 bool &isValidConstant)
89{
90 uint64_t C = GetConstantValueAsUnsignedInt(V, isValidConstant);
91 if (isValidConstant) {
92 if (V->getType()->isSigned() || C < INT64_MAX) // safe to cast to signed
93 return (int64_t) C;
94 else
95 isValidConstant = false;
96 }
97 return 0;
98}
Vikram S. Advea1d14f32001-10-10 20:50:43 +000099
100//---------------------------------------------------------------------------
101// Function: FoldGetElemChain
102//
103// Purpose:
Vikram S. Advec941b872002-03-24 03:37:53 +0000104// Fold a chain of GetElementPtr instructions containing only
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000105// constant offsets into an equivalent (Pointer, IndexVector) pair.
Vikram S. Advec941b872002-03-24 03:37:53 +0000106// Returns the pointer Value, and stores the resulting IndexVector
107// in argument chainIdxVec.
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000108//---------------------------------------------------------------------------
109
110Value*
111FoldGetElemChain(const InstructionNode* getElemInstrNode,
Vikram S. Advefa248972001-12-15 00:36:32 +0000112 vector<Value*>& chainIdxVec)
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000113{
114 MemAccessInst* getElemInst = (MemAccessInst*)
115 getElemInstrNode->getInstruction();
116
Vikram S. Adve17927792002-03-31 18:56:51 +0000117 // Return NULL if we don't fold any instructions in.
Vikram S. Advec941b872002-03-24 03:37:53 +0000118 Value* ptrVal = NULL;
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000119
120 // Remember if the last instruction had a leading [0] index.
121 bool hasLeadingZero = false;
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000122
Vikram S. Advec941b872002-03-24 03:37:53 +0000123 // Now chase the chain of getElementInstr instructions, if any.
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000124 // Check for any non-constant indices and stop there.
Vikram S. Advec941b872002-03-24 03:37:53 +0000125 //
126 const InstrTreeNode* ptrChild = getElemInstrNode;
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000127 while (ptrChild->getOpLabel() == Instruction::GetElementPtr ||
128 ptrChild->getOpLabel() == GetElemPtrIdx)
129 {
130 // Child is a GetElemPtr instruction
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +0000131 getElemInst = cast<MemAccessInst>(ptrChild->getValue());
132 MemAccessInst::op_iterator OI, firstIdx = getElemInst->idx_begin();
133 MemAccessInst::op_iterator lastIdx = getElemInst->idx_end();
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000134 bool allConstantOffsets = true;
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +0000135
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000136 // Check that all offsets are constant for this instruction
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +0000137 for (OI = firstIdx; allConstantOffsets && OI != lastIdx; ++OI)
138 allConstantOffsets = isa<ConstantInt>(*OI);
139
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000140 if (allConstantOffsets)
Vikram S. Adve17927792002-03-31 18:56:51 +0000141 { // Get pointer value out of ptrChild.
Vikram S. Advec941b872002-03-24 03:37:53 +0000142 ptrVal = getElemInst->getPointerOperand();
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +0000143
144 // Check for a leading [0] index, if any. It will be discarded later.
145 ConstantUInt* CV = dyn_cast<ConstantUInt>((Value*) *firstIdx);
146 hasLeadingZero = bool(CV && CV->getValue() == 0);
147
148 // Insert its index vector at the start, skipping any leading [0]
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000149 chainIdxVec.insert(chainIdxVec.begin(),
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +0000150 firstIdx + hasLeadingZero, lastIdx);
151
Vikram S. Adve17927792002-03-31 18:56:51 +0000152 // Mark the folded node so no code is generated for it.
Vikram S. Advec941b872002-03-24 03:37:53 +0000153 ((InstructionNode*) ptrChild)->markFoldedIntoParent();
Vikram S. Advec941b872002-03-24 03:37:53 +0000154 }
155 else // cannot fold this getElementPtr instr. or any further ones
156 break;
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +0000157
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000158 ptrChild = ptrChild->leftChild();
159 }
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +0000160
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000161 // If the first getElementPtr instruction had a leading [0], add it back.
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +0000162 // Note that this instruction is the *last* one successfully folded above.
163 if (ptrVal && hasLeadingZero)
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000164 chainIdxVec.insert(chainIdxVec.begin(), ConstantUInt::get(Type::UIntTy,0));
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +0000165
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000166 return ptrVal;
167}
168
169
170//------------------------------------------------------------------------
171// Function Set2OperandsFromInstr
172// Function Set3OperandsFromInstr
173//
174// For the common case of 2- and 3-operand arithmetic/logical instructions,
175// set the m/c instr. operands directly from the VM instruction's operands.
176// Check whether the first or second operand is 0 and can use a dedicated "0"
177// register.
178// Check whether the second operand should use an immediate field or register.
179// (First and third operands are never immediates for such instructions.)
180//
181// Arguments:
182// canDiscardResult: Specifies that the result operand can be discarded
183// by using the dedicated "0"
184//
185// op1position, op2position and resultPosition: Specify in which position
186// in the machine instruction the 3 operands (arg1, arg2
187// and result) should go.
188//
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000189//------------------------------------------------------------------------
190
191void
192Set2OperandsFromInstr(MachineInstr* minstr,
193 InstructionNode* vmInstrNode,
194 const TargetMachine& target,
195 bool canDiscardResult,
196 int op1Position,
197 int resultPosition)
198{
199 Set3OperandsFromInstr(minstr, vmInstrNode, target,
200 canDiscardResult, op1Position,
201 /*op2Position*/ -1, resultPosition);
202}
203
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000204
205void
206Set3OperandsFromInstr(MachineInstr* minstr,
207 InstructionNode* vmInstrNode,
208 const TargetMachine& target,
209 bool canDiscardResult,
210 int op1Position,
211 int op2Position,
212 int resultPosition)
213{
214 assert(op1Position >= 0);
215 assert(resultPosition >= 0);
216
217 // operand 1
Vikram S. Adve42f63202002-03-18 03:33:43 +0000218 minstr->SetMachineOperandVal(op1Position, MachineOperand::MO_VirtualRegister,
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000219 vmInstrNode->leftChild()->getValue());
220
221 // operand 2 (if any)
222 if (op2Position >= 0)
Vikram S. Adve42f63202002-03-18 03:33:43 +0000223 minstr->SetMachineOperandVal(op2Position, MachineOperand::MO_VirtualRegister,
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000224 vmInstrNode->rightChild()->getValue());
225
226 // result operand: if it can be discarded, use a dead register if one exists
227 if (canDiscardResult && target.getRegInfo().getZeroRegNum() >= 0)
Vikram S. Adve42f63202002-03-18 03:33:43 +0000228 minstr->SetMachineOperandReg(resultPosition,
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000229 target.getRegInfo().getZeroRegNum());
230 else
Vikram S. Adve42f63202002-03-18 03:33:43 +0000231 minstr->SetMachineOperandVal(resultPosition,
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000232 MachineOperand::MO_VirtualRegister, vmInstrNode->getValue());
233}
234
235
236MachineOperand::MachineOperandType
237ChooseRegOrImmed(Value* val,
238 MachineOpCode opCode,
239 const TargetMachine& target,
240 bool canUseImmed,
241 unsigned int& getMachineRegNum,
242 int64_t& getImmedValue)
243{
244 MachineOperand::MachineOperandType opType =
245 MachineOperand::MO_VirtualRegister;
246 getMachineRegNum = 0;
247 getImmedValue = 0;
248
249 // Check for the common case first: argument is not constant
250 //
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000251 Constant *CPV = dyn_cast<Constant>(val);
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000252 if (!CPV) return opType;
253
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000254 if (ConstantBool *CPB = dyn_cast<ConstantBool>(CPV))
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000255 {
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000256 if (!CPB->getValue() && target.getRegInfo().getZeroRegNum() >= 0)
257 {
258 getMachineRegNum = target.getRegInfo().getZeroRegNum();
259 return MachineOperand::MO_MachineRegister;
260 }
261
262 getImmedValue = 1;
263 return MachineOperand::MO_SignExtendedImmed;
264 }
265
Vikram S. Advec8117452001-11-14 17:24:49 +0000266 // Otherwise it needs to be an integer or a NULL pointer
267 if (! CPV->getType()->isIntegral() &&
Chris Lattner9b625032002-05-06 16:15:30 +0000268 ! (isa<PointerType>(CPV->getType()) &&
Vikram S. Advec8117452001-11-14 17:24:49 +0000269 CPV->isNullValue()))
270 return opType;
271
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000272 // Now get the constant value and check if it fits in the IMMED field.
273 // Take advantage of the fact that the max unsigned value will rarely
274 // fit into any IMMED field and ignore that case (i.e., cast smaller
275 // unsigned constants to signed).
276 //
277 int64_t intValue;
Chris Lattner9b625032002-05-06 16:15:30 +0000278 if (isa<PointerType>(CPV->getType()))
Vikram S. Advec8117452001-11-14 17:24:49 +0000279 {
280 intValue = 0;
281 }
Vikram S. Adve9e29f782001-11-14 17:55:02 +0000282 else if (CPV->getType()->isSigned())
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000283 {
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000284 intValue = cast<ConstantSInt>(CPV)->getValue();
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000285 }
286 else
287 {
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000288 uint64_t V = cast<ConstantUInt>(CPV)->getValue();
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000289 if (V >= INT64_MAX) return opType;
290 intValue = (int64_t)V;
291 }
292
293 if (intValue == 0 && target.getRegInfo().getZeroRegNum() >= 0)
294 {
295 opType = MachineOperand::MO_MachineRegister;
296 getMachineRegNum = target.getRegInfo().getZeroRegNum();
297 }
298 else if (canUseImmed &&
299 target.getInstrInfo().constantFitsInImmedField(opCode, intValue))
300 {
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000301 opType = CPV->getType()->isSigned()
302 ? MachineOperand::MO_SignExtendedImmed
303 : MachineOperand::MO_UnextendedImmed;
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000304 getImmedValue = intValue;
305 }
306
307 return opType;
308}
309
Vikram S. Adve6d353262001-10-17 23:57:50 +0000310
311//---------------------------------------------------------------------------
312// Function: FixConstantOperandsForInstr
313//
314// Purpose:
315// Special handling for constant operands of a machine instruction
316// -- if the constant is 0, use the hardwired 0 register, if any;
317// -- if the constant fits in the IMMEDIATE field, use that field;
318// -- else create instructions to put the constant into a register, either
319// directly or by loading explicitly from the constant pool.
320//
321// In the first 2 cases, the operand of `minstr' is modified in place.
322// Returns a vector of machine instructions generated for operands that
323// fall under case 3; these must be inserted before `minstr'.
324//---------------------------------------------------------------------------
325
326vector<MachineInstr*>
327FixConstantOperandsForInstr(Instruction* vmInstr,
328 MachineInstr* minstr,
329 TargetMachine& target)
330{
331 vector<MachineInstr*> loadConstVec;
332
333 const MachineInstrDescriptor& instrDesc =
334 target.getInstrInfo().getDescriptor(minstr->getOpCode());
335
Chris Lattner2fbfdcf2002-04-07 20:49:59 +0000336 Function *F = vmInstr->getParent()->getParent();
Vikram S. Adve94e40ef2001-10-28 21:46:23 +0000337
Vikram S. Adve6d353262001-10-17 23:57:50 +0000338 for (unsigned op=0; op < minstr->getNumOperands(); op++)
339 {
340 const MachineOperand& mop = minstr->getOperand(op);
341
342 // skip the result position (for efficiency below) and any other
343 // positions already marked as not a virtual register
344 if (instrDesc.resultPos == (int) op ||
345 mop.getOperandType() != MachineOperand::MO_VirtualRegister ||
346 mop.getVRegValue() == NULL)
347 {
348 continue;
349 }
350
351 Value* opValue = mop.getVRegValue();
352 bool constantThatMustBeLoaded = false;
353
Vikram S. Adve42f63202002-03-18 03:33:43 +0000354 if (Constant *opConst = dyn_cast<Constant>(opValue))
355 {
Vikram S. Adve6d353262001-10-17 23:57:50 +0000356 unsigned int machineRegNum;
357 int64_t immedValue;
358 MachineOperand::MachineOperandType opType =
359 ChooseRegOrImmed(opValue, minstr->getOpCode(), target,
Vikram S. Adve42f63202002-03-18 03:33:43 +0000360 (target.getInstrInfo().getImmedConstantPos(minstr->getOpCode()) == (int) op),
Vikram S. Adve6d353262001-10-17 23:57:50 +0000361 machineRegNum, immedValue);
Vikram S. Adveecd58132001-11-14 18:49:45 +0000362
Vikram S. Adve6d353262001-10-17 23:57:50 +0000363 if (opType == MachineOperand::MO_MachineRegister)
Vikram S. Adve42f63202002-03-18 03:33:43 +0000364 minstr->SetMachineOperandReg(op, machineRegNum);
Vikram S. Adve6d353262001-10-17 23:57:50 +0000365 else if (opType == MachineOperand::MO_VirtualRegister)
366 constantThatMustBeLoaded = true; // load is generated below
367 else
Vikram S. Adve42f63202002-03-18 03:33:43 +0000368 minstr->SetMachineOperandConst(op, opType, immedValue);
Vikram S. Adve94e40ef2001-10-28 21:46:23 +0000369 }
370
Vikram S. Adve6d353262001-10-17 23:57:50 +0000371 if (constantThatMustBeLoaded || isa<GlobalValue>(opValue))
372 { // opValue is a constant that must be explicitly loaded into a reg.
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000373 TmpInstruction* tmpReg = InsertCodeToLoadConstant(F, opValue,vmInstr,
Chris Lattner2fbfdcf2002-04-07 20:49:59 +0000374 loadConstVec,
375 target);
Vikram S. Adve42f63202002-03-18 03:33:43 +0000376 minstr->SetMachineOperandVal(op, MachineOperand::MO_VirtualRegister,
377 tmpReg);
Vikram S. Adve6d353262001-10-17 23:57:50 +0000378 }
379 }
380
381 //
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000382 // Also, check for implicit operands used by the machine instruction
383 // (no need to check those defined since they cannot be constants).
384 // These include:
Vikram S. Adve6d353262001-10-17 23:57:50 +0000385 // -- arguments to a Call
386 // -- return value of a Return
387 // Any such operand that is a constant value needs to be fixed also.
388 // The current instructions with implicit refs (viz., Call and Return)
389 // have no immediate fields, so the constant always needs to be loaded
390 // into a register.
391 //
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000392 bool isCall = target.getInstrInfo().isCall(minstr->getOpCode());
393 unsigned lastCallArgNum = 0; // unused if not a call
394 CallArgsDescriptor* argDesc = NULL; // unused if not a call
395 if (isCall)
396 argDesc = CallArgsDescriptor::get(minstr);
397
Vikram S. Adve6d353262001-10-17 23:57:50 +0000398 for (unsigned i=0, N=minstr->getNumImplicitRefs(); i < N; ++i)
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000399 if (isa<Constant>(minstr->getImplicitRef(i)) ||
Vikram S. Adve6d353262001-10-17 23:57:50 +0000400 isa<GlobalValue>(minstr->getImplicitRef(i)))
401 {
Vikram S. Adve94e40ef2001-10-28 21:46:23 +0000402 Value* oldVal = minstr->getImplicitRef(i);
Vikram S. Adve6d353262001-10-17 23:57:50 +0000403 TmpInstruction* tmpReg =
Chris Lattner2fbfdcf2002-04-07 20:49:59 +0000404 InsertCodeToLoadConstant(F, oldVal, vmInstr, loadConstVec, target);
Vikram S. Adve6d353262001-10-17 23:57:50 +0000405 minstr->setImplicitRef(i, tmpReg);
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000406
407 if (isCall)
408 { // find and replace the argument in the CallArgsDescriptor
409 unsigned i=lastCallArgNum;
410 while (argDesc->getArgInfo(i).getArgVal() != oldVal)
411 ++i;
412 assert(i < argDesc->getNumArgs() &&
413 "Constant operands to a call *must* be in the arg list");
414 lastCallArgNum = i;
415 argDesc->getArgInfo(i).replaceArgVal(tmpReg);
416 }
Vikram S. Adve6d353262001-10-17 23:57:50 +0000417 }
418
419 return loadConstVec;
420}
421
422