blob: e4a188ec35038fa2c1ac2b5b294c9984c387ef91 [file] [log] [blame]
Vikram S. Advea1d14f32001-10-10 20:50:43 +00001//***************************************************************************
2// File:
3// InstrSelectionSupport.h
4//
5// Purpose:
6// Target-independent instruction selection code.
7// See SparcInstrSelection.cpp for usage.
8//
9// History:
10// 10/10/01 - Vikram Adve - Created
11//**************************************************************************/
12
13#include "llvm/CodeGen/InstrSelectionSupport.h"
14#include "llvm/CodeGen/InstrSelection.h"
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +000015#include "llvm/CodeGen/MachineInstr.h"
16#include "llvm/CodeGen/MachineInstrAnnot.h"
Chris Lattnerfb3b1ec2002-02-03 07:39:06 +000017#include "llvm/CodeGen/MachineCodeForInstruction.h"
18#include "llvm/CodeGen/MachineCodeForMethod.h"
19#include "llvm/CodeGen/InstrForest.h"
Vikram S. Advea1d14f32001-10-10 20:50:43 +000020#include "llvm/Target/TargetMachine.h"
21#include "llvm/Target/MachineRegInfo.h"
Chris Lattner31bcdb82002-04-28 19:55:58 +000022#include "llvm/Constants.h"
Chris Lattner2fbfdcf2002-04-07 20:49:59 +000023#include "llvm/Function.h"
Vikram S. Adve94e40ef2001-10-28 21:46:23 +000024#include "llvm/BasicBlock.h"
Vikram S. Advea1d14f32001-10-10 20:50:43 +000025#include "llvm/Type.h"
26#include "llvm/iMemory.h"
Chris Lattner697954c2002-01-20 22:54:45 +000027using std::vector;
Vikram S. Advea1d14f32001-10-10 20:50:43 +000028
29//*************************** Local Functions ******************************/
30
Vikram S. Advea1d14f32001-10-10 20:50:43 +000031
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +000032// Generate code to load the constant into a TmpInstruction (virtual reg) and
33// returns the virtual register.
34//
Vikram S. Adve6d353262001-10-17 23:57:50 +000035static TmpInstruction*
Chris Lattner2fbfdcf2002-04-07 20:49:59 +000036InsertCodeToLoadConstant(Function *F,
Vikram S. Adve42f63202002-03-18 03:33:43 +000037 Value* opValue,
Vikram S. Adve6d353262001-10-17 23:57:50 +000038 Instruction* vmInstr,
39 vector<MachineInstr*>& loadConstVec,
40 TargetMachine& target)
Vikram S. Advea1d14f32001-10-10 20:50:43 +000041{
Vikram S. Adve6d353262001-10-17 23:57:50 +000042 // Create a tmp virtual register to hold the constant.
Chris Lattnerfb3b1ec2002-02-03 07:39:06 +000043 TmpInstruction* tmpReg = new TmpInstruction(opValue);
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +000044 MachineCodeForInstruction &mcfi = MachineCodeForInstruction::get(vmInstr);
45 mcfi.addTemp(tmpReg);
Vikram S. Advea1d14f32001-10-10 20:50:43 +000046
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +000047 target.getInstrInfo().CreateCodeToLoadConst(target, F, opValue, tmpReg,
48 loadConstVec, mcfi);
Vikram S. Adve6d353262001-10-17 23:57:50 +000049
50 // Record the mapping from the tmp VM instruction to machine instruction.
51 // Do this for all machine instructions that were not mapped to any
52 // other temp values created by
53 // tmpReg->addMachineInstruction(loadConstVec.back());
54
55 return tmpReg;
Vikram S. Advea1d14f32001-10-10 20:50:43 +000056}
57
58
Vikram S. Adve6d353262001-10-17 23:57:50 +000059//---------------------------------------------------------------------------
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +000060// Function GetConstantValueAsUnsignedInt
Vikram S. Adve6d353262001-10-17 23:57:50 +000061// Function GetConstantValueAsSignedInt
62//
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +000063// Convenience functions to get the value of an integral constant, for an
64// appropriate integer or non-integer type that can be held in a signed
65// or unsigned integer respectively. The type of the argument must be
66// the following:
Vikram S. Adve6d353262001-10-17 23:57:50 +000067// Signed or unsigned integer
68// Boolean
69// Pointer
70//
71// isValidConstant is set to true if a valid constant was found.
72//---------------------------------------------------------------------------
73
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +000074uint64_t
75GetConstantValueAsUnsignedInt(const Value *V,
76 bool &isValidConstant)
Vikram S. Advea1d14f32001-10-10 20:50:43 +000077{
Vikram S. Adve6d353262001-10-17 23:57:50 +000078 isValidConstant = true;
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +000079
80 if (isa<Constant>(V))
81 if (V->getType() == Type::BoolTy)
82 return (int64_t) cast<ConstantBool>(V)->getValue();
83 else if (V->getType()->isIntegral())
84 return (V->getType()->isUnsigned()
85 ? cast<ConstantUInt>(V)->getValue()
86 : (uint64_t) cast<ConstantSInt>(V)->getValue());
87
Vikram S. Adve6d353262001-10-17 23:57:50 +000088 isValidConstant = false;
89 return 0;
Vikram S. Advea1d14f32001-10-10 20:50:43 +000090}
91
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +000092int64_t
93GetConstantValueAsSignedInt(const Value *V,
94 bool &isValidConstant)
95{
96 uint64_t C = GetConstantValueAsUnsignedInt(V, isValidConstant);
97 if (isValidConstant) {
98 if (V->getType()->isSigned() || C < INT64_MAX) // safe to cast to signed
99 return (int64_t) C;
100 else
101 isValidConstant = false;
102 }
103 return 0;
104}
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000105
106//---------------------------------------------------------------------------
107// Function: FoldGetElemChain
108//
109// Purpose:
Vikram S. Advec941b872002-03-24 03:37:53 +0000110// Fold a chain of GetElementPtr instructions containing only
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000111// constant offsets into an equivalent (Pointer, IndexVector) pair.
Vikram S. Advec941b872002-03-24 03:37:53 +0000112// Returns the pointer Value, and stores the resulting IndexVector
113// in argument chainIdxVec.
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000114//---------------------------------------------------------------------------
115
116Value*
117FoldGetElemChain(const InstructionNode* getElemInstrNode,
Vikram S. Advefa248972001-12-15 00:36:32 +0000118 vector<Value*>& chainIdxVec)
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000119{
120 MemAccessInst* getElemInst = (MemAccessInst*)
121 getElemInstrNode->getInstruction();
122
Vikram S. Adve17927792002-03-31 18:56:51 +0000123 // Return NULL if we don't fold any instructions in.
Vikram S. Advec941b872002-03-24 03:37:53 +0000124 Value* ptrVal = NULL;
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000125
126 // Remember if the last instruction had a leading [0] index.
127 bool hasLeadingZero = false;
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000128
Vikram S. Advec941b872002-03-24 03:37:53 +0000129 // Now chase the chain of getElementInstr instructions, if any.
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000130 // Check for any non-constant indices and stop there.
Vikram S. Advec941b872002-03-24 03:37:53 +0000131 //
132 const InstrTreeNode* ptrChild = getElemInstrNode;
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000133 while (ptrChild->getOpLabel() == Instruction::GetElementPtr ||
134 ptrChild->getOpLabel() == GetElemPtrIdx)
135 {
136 // Child is a GetElemPtr instruction
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +0000137 getElemInst = cast<MemAccessInst>(ptrChild->getValue());
138 MemAccessInst::op_iterator OI, firstIdx = getElemInst->idx_begin();
139 MemAccessInst::op_iterator lastIdx = getElemInst->idx_end();
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000140 bool allConstantOffsets = true;
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +0000141
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000142 // Check that all offsets are constant for this instruction
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +0000143 for (OI = firstIdx; allConstantOffsets && OI != lastIdx; ++OI)
144 allConstantOffsets = isa<ConstantInt>(*OI);
145
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000146 if (allConstantOffsets)
Vikram S. Adve17927792002-03-31 18:56:51 +0000147 { // Get pointer value out of ptrChild.
Vikram S. Advec941b872002-03-24 03:37:53 +0000148 ptrVal = getElemInst->getPointerOperand();
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +0000149
150 // Check for a leading [0] index, if any. It will be discarded later.
151 ConstantUInt* CV = dyn_cast<ConstantUInt>((Value*) *firstIdx);
152 hasLeadingZero = bool(CV && CV->getValue() == 0);
153
154 // Insert its index vector at the start, skipping any leading [0]
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000155 chainIdxVec.insert(chainIdxVec.begin(),
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +0000156 firstIdx + hasLeadingZero, lastIdx);
157
Vikram S. Adve17927792002-03-31 18:56:51 +0000158 // Mark the folded node so no code is generated for it.
Vikram S. Advec941b872002-03-24 03:37:53 +0000159 ((InstructionNode*) ptrChild)->markFoldedIntoParent();
Vikram S. Advec941b872002-03-24 03:37:53 +0000160 }
161 else // cannot fold this getElementPtr instr. or any further ones
162 break;
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +0000163
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000164 ptrChild = ptrChild->leftChild();
165 }
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +0000166
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000167 // If the first getElementPtr instruction had a leading [0], add it back.
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +0000168 // Note that this instruction is the *last* one successfully folded above.
169 if (ptrVal && hasLeadingZero)
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000170 chainIdxVec.insert(chainIdxVec.begin(), ConstantUInt::get(Type::UIntTy,0));
Vikram S. Adve1b51b1b2002-08-04 20:49:49 +0000171
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000172 return ptrVal;
173}
174
175
176//------------------------------------------------------------------------
177// Function Set2OperandsFromInstr
178// Function Set3OperandsFromInstr
179//
180// For the common case of 2- and 3-operand arithmetic/logical instructions,
181// set the m/c instr. operands directly from the VM instruction's operands.
182// Check whether the first or second operand is 0 and can use a dedicated "0"
183// register.
184// Check whether the second operand should use an immediate field or register.
185// (First and third operands are never immediates for such instructions.)
186//
187// Arguments:
188// canDiscardResult: Specifies that the result operand can be discarded
189// by using the dedicated "0"
190//
191// op1position, op2position and resultPosition: Specify in which position
192// in the machine instruction the 3 operands (arg1, arg2
193// and result) should go.
194//
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000195//------------------------------------------------------------------------
196
197void
198Set2OperandsFromInstr(MachineInstr* minstr,
199 InstructionNode* vmInstrNode,
200 const TargetMachine& target,
201 bool canDiscardResult,
202 int op1Position,
203 int resultPosition)
204{
205 Set3OperandsFromInstr(minstr, vmInstrNode, target,
206 canDiscardResult, op1Position,
207 /*op2Position*/ -1, resultPosition);
208}
209
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000210
211void
212Set3OperandsFromInstr(MachineInstr* minstr,
213 InstructionNode* vmInstrNode,
214 const TargetMachine& target,
215 bool canDiscardResult,
216 int op1Position,
217 int op2Position,
218 int resultPosition)
219{
220 assert(op1Position >= 0);
221 assert(resultPosition >= 0);
222
223 // operand 1
Vikram S. Adve42f63202002-03-18 03:33:43 +0000224 minstr->SetMachineOperandVal(op1Position, MachineOperand::MO_VirtualRegister,
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000225 vmInstrNode->leftChild()->getValue());
226
227 // operand 2 (if any)
228 if (op2Position >= 0)
Vikram S. Adve42f63202002-03-18 03:33:43 +0000229 minstr->SetMachineOperandVal(op2Position, MachineOperand::MO_VirtualRegister,
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000230 vmInstrNode->rightChild()->getValue());
231
232 // result operand: if it can be discarded, use a dead register if one exists
233 if (canDiscardResult && target.getRegInfo().getZeroRegNum() >= 0)
Vikram S. Adve42f63202002-03-18 03:33:43 +0000234 minstr->SetMachineOperandReg(resultPosition,
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000235 target.getRegInfo().getZeroRegNum());
236 else
Vikram S. Adve42f63202002-03-18 03:33:43 +0000237 minstr->SetMachineOperandVal(resultPosition,
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000238 MachineOperand::MO_VirtualRegister, vmInstrNode->getValue());
239}
240
241
242MachineOperand::MachineOperandType
243ChooseRegOrImmed(Value* val,
244 MachineOpCode opCode,
245 const TargetMachine& target,
246 bool canUseImmed,
247 unsigned int& getMachineRegNum,
248 int64_t& getImmedValue)
249{
250 MachineOperand::MachineOperandType opType =
251 MachineOperand::MO_VirtualRegister;
252 getMachineRegNum = 0;
253 getImmedValue = 0;
254
255 // Check for the common case first: argument is not constant
256 //
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000257 Constant *CPV = dyn_cast<Constant>(val);
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000258 if (!CPV) return opType;
259
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000260 if (ConstantBool *CPB = dyn_cast<ConstantBool>(CPV))
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000261 {
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000262 if (!CPB->getValue() && target.getRegInfo().getZeroRegNum() >= 0)
263 {
264 getMachineRegNum = target.getRegInfo().getZeroRegNum();
265 return MachineOperand::MO_MachineRegister;
266 }
267
268 getImmedValue = 1;
269 return MachineOperand::MO_SignExtendedImmed;
270 }
271
Vikram S. Advec8117452001-11-14 17:24:49 +0000272 // Otherwise it needs to be an integer or a NULL pointer
273 if (! CPV->getType()->isIntegral() &&
Chris Lattner9b625032002-05-06 16:15:30 +0000274 ! (isa<PointerType>(CPV->getType()) &&
Vikram S. Advec8117452001-11-14 17:24:49 +0000275 CPV->isNullValue()))
276 return opType;
277
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000278 // Now get the constant value and check if it fits in the IMMED field.
279 // Take advantage of the fact that the max unsigned value will rarely
280 // fit into any IMMED field and ignore that case (i.e., cast smaller
281 // unsigned constants to signed).
282 //
283 int64_t intValue;
Chris Lattner9b625032002-05-06 16:15:30 +0000284 if (isa<PointerType>(CPV->getType()))
Vikram S. Advec8117452001-11-14 17:24:49 +0000285 {
286 intValue = 0;
287 }
Vikram S. Adve9e29f782001-11-14 17:55:02 +0000288 else if (CPV->getType()->isSigned())
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000289 {
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000290 intValue = cast<ConstantSInt>(CPV)->getValue();
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000291 }
292 else
293 {
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000294 uint64_t V = cast<ConstantUInt>(CPV)->getValue();
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000295 if (V >= INT64_MAX) return opType;
296 intValue = (int64_t)V;
297 }
298
299 if (intValue == 0 && target.getRegInfo().getZeroRegNum() >= 0)
300 {
301 opType = MachineOperand::MO_MachineRegister;
302 getMachineRegNum = target.getRegInfo().getZeroRegNum();
303 }
304 else if (canUseImmed &&
305 target.getInstrInfo().constantFitsInImmedField(opCode, intValue))
306 {
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000307 opType = CPV->getType()->isSigned()
308 ? MachineOperand::MO_SignExtendedImmed
309 : MachineOperand::MO_UnextendedImmed;
Vikram S. Advea1d14f32001-10-10 20:50:43 +0000310 getImmedValue = intValue;
311 }
312
313 return opType;
314}
315
Vikram S. Adve6d353262001-10-17 23:57:50 +0000316
317//---------------------------------------------------------------------------
318// Function: FixConstantOperandsForInstr
319//
320// Purpose:
321// Special handling for constant operands of a machine instruction
322// -- if the constant is 0, use the hardwired 0 register, if any;
323// -- if the constant fits in the IMMEDIATE field, use that field;
324// -- else create instructions to put the constant into a register, either
325// directly or by loading explicitly from the constant pool.
326//
327// In the first 2 cases, the operand of `minstr' is modified in place.
328// Returns a vector of machine instructions generated for operands that
329// fall under case 3; these must be inserted before `minstr'.
330//---------------------------------------------------------------------------
331
332vector<MachineInstr*>
333FixConstantOperandsForInstr(Instruction* vmInstr,
334 MachineInstr* minstr,
335 TargetMachine& target)
336{
337 vector<MachineInstr*> loadConstVec;
338
339 const MachineInstrDescriptor& instrDesc =
340 target.getInstrInfo().getDescriptor(minstr->getOpCode());
341
Chris Lattner2fbfdcf2002-04-07 20:49:59 +0000342 Function *F = vmInstr->getParent()->getParent();
Vikram S. Adve94e40ef2001-10-28 21:46:23 +0000343
Vikram S. Adve6d353262001-10-17 23:57:50 +0000344 for (unsigned op=0; op < minstr->getNumOperands(); op++)
345 {
346 const MachineOperand& mop = minstr->getOperand(op);
347
348 // skip the result position (for efficiency below) and any other
349 // positions already marked as not a virtual register
350 if (instrDesc.resultPos == (int) op ||
351 mop.getOperandType() != MachineOperand::MO_VirtualRegister ||
352 mop.getVRegValue() == NULL)
353 {
354 continue;
355 }
356
357 Value* opValue = mop.getVRegValue();
358 bool constantThatMustBeLoaded = false;
359
Vikram S. Adve42f63202002-03-18 03:33:43 +0000360 if (Constant *opConst = dyn_cast<Constant>(opValue))
361 {
Vikram S. Adve6d353262001-10-17 23:57:50 +0000362 unsigned int machineRegNum;
363 int64_t immedValue;
364 MachineOperand::MachineOperandType opType =
365 ChooseRegOrImmed(opValue, minstr->getOpCode(), target,
Vikram S. Adve42f63202002-03-18 03:33:43 +0000366 (target.getInstrInfo().getImmedConstantPos(minstr->getOpCode()) == (int) op),
Vikram S. Adve6d353262001-10-17 23:57:50 +0000367 machineRegNum, immedValue);
Vikram S. Adveecd58132001-11-14 18:49:45 +0000368
Vikram S. Adve6d353262001-10-17 23:57:50 +0000369 if (opType == MachineOperand::MO_MachineRegister)
Vikram S. Adve42f63202002-03-18 03:33:43 +0000370 minstr->SetMachineOperandReg(op, machineRegNum);
Vikram S. Adve6d353262001-10-17 23:57:50 +0000371 else if (opType == MachineOperand::MO_VirtualRegister)
372 constantThatMustBeLoaded = true; // load is generated below
373 else
Vikram S. Adve42f63202002-03-18 03:33:43 +0000374 minstr->SetMachineOperandConst(op, opType, immedValue);
Vikram S. Adve94e40ef2001-10-28 21:46:23 +0000375 }
376
Vikram S. Adve6d353262001-10-17 23:57:50 +0000377 if (constantThatMustBeLoaded || isa<GlobalValue>(opValue))
378 { // opValue is a constant that must be explicitly loaded into a reg.
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000379 TmpInstruction* tmpReg = InsertCodeToLoadConstant(F, opValue,vmInstr,
Chris Lattner2fbfdcf2002-04-07 20:49:59 +0000380 loadConstVec,
381 target);
Vikram S. Adve42f63202002-03-18 03:33:43 +0000382 minstr->SetMachineOperandVal(op, MachineOperand::MO_VirtualRegister,
383 tmpReg);
Vikram S. Adve6d353262001-10-17 23:57:50 +0000384 }
385 }
386
387 //
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000388 // Also, check for implicit operands used by the machine instruction
389 // (no need to check those defined since they cannot be constants).
390 // These include:
Vikram S. Adve6d353262001-10-17 23:57:50 +0000391 // -- arguments to a Call
392 // -- return value of a Return
393 // Any such operand that is a constant value needs to be fixed also.
394 // The current instructions with implicit refs (viz., Call and Return)
395 // have no immediate fields, so the constant always needs to be loaded
396 // into a register.
397 //
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000398 bool isCall = target.getInstrInfo().isCall(minstr->getOpCode());
399 unsigned lastCallArgNum = 0; // unused if not a call
400 CallArgsDescriptor* argDesc = NULL; // unused if not a call
401 if (isCall)
402 argDesc = CallArgsDescriptor::get(minstr);
403
Vikram S. Adve6d353262001-10-17 23:57:50 +0000404 for (unsigned i=0, N=minstr->getNumImplicitRefs(); i < N; ++i)
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000405 if (isa<Constant>(minstr->getImplicitRef(i)) ||
Vikram S. Adve6d353262001-10-17 23:57:50 +0000406 isa<GlobalValue>(minstr->getImplicitRef(i)))
407 {
Vikram S. Adve94e40ef2001-10-28 21:46:23 +0000408 Value* oldVal = minstr->getImplicitRef(i);
Vikram S. Adve6d353262001-10-17 23:57:50 +0000409 TmpInstruction* tmpReg =
Chris Lattner2fbfdcf2002-04-07 20:49:59 +0000410 InsertCodeToLoadConstant(F, oldVal, vmInstr, loadConstVec, target);
Vikram S. Adve6d353262001-10-17 23:57:50 +0000411 minstr->setImplicitRef(i, tmpReg);
Vikram S. Adve36f0a9e2002-05-19 15:34:29 +0000412
413 if (isCall)
414 { // find and replace the argument in the CallArgsDescriptor
415 unsigned i=lastCallArgNum;
416 while (argDesc->getArgInfo(i).getArgVal() != oldVal)
417 ++i;
418 assert(i < argDesc->getNumArgs() &&
419 "Constant operands to a call *must* be in the arg list");
420 lastCallArgNum = i;
421 argDesc->getArgInfo(i).replaceArgVal(tmpReg);
422 }
Vikram S. Adve6d353262001-10-17 23:57:50 +0000423 }
424
425 return loadConstVec;
426}
427
428