Chris Lattner | 035dfbe | 2002-08-09 20:08:06 +0000 | [diff] [blame] | 1 | //===-- InstrSelectionSupport.cpp -----------------------------------------===// |
| 2 | // |
| 3 | // Target-independent instruction selection code. See SparcInstrSelection.cpp |
| 4 | // for usage. |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 5 | // |
Chris Lattner | 035dfbe | 2002-08-09 20:08:06 +0000 | [diff] [blame] | 6 | //===----------------------------------------------------------------------===// |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 7 | |
| 8 | #include "llvm/CodeGen/InstrSelectionSupport.h" |
| 9 | #include "llvm/CodeGen/InstrSelection.h" |
Vikram S. Adve | 36f0a9e | 2002-05-19 15:34:29 +0000 | [diff] [blame] | 10 | #include "llvm/CodeGen/MachineInstr.h" |
| 11 | #include "llvm/CodeGen/MachineInstrAnnot.h" |
Chris Lattner | fb3b1ec | 2002-02-03 07:39:06 +0000 | [diff] [blame] | 12 | #include "llvm/CodeGen/MachineCodeForInstruction.h" |
Misha Brukman | fce1143 | 2002-10-28 00:28:31 +0000 | [diff] [blame] | 13 | #include "llvm/CodeGen/MachineFunction.h" |
Chris Lattner | fb3b1ec | 2002-02-03 07:39:06 +0000 | [diff] [blame] | 14 | #include "llvm/CodeGen/InstrForest.h" |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 15 | #include "llvm/Target/TargetMachine.h" |
| 16 | #include "llvm/Target/MachineRegInfo.h" |
Chris Lattner | 0be79c6 | 2002-10-28 02:28:39 +0000 | [diff] [blame] | 17 | #include "llvm/Target/MachineInstrInfo.h" |
Chris Lattner | 31bcdb8 | 2002-04-28 19:55:58 +0000 | [diff] [blame] | 18 | #include "llvm/Constants.h" |
Chris Lattner | 2fbfdcf | 2002-04-07 20:49:59 +0000 | [diff] [blame] | 19 | #include "llvm/Function.h" |
Chris Lattner | c5b8b1a | 2002-10-28 23:54:47 +0000 | [diff] [blame] | 20 | #include "llvm/DerivedTypes.h" |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 21 | #include "llvm/iMemory.h" |
Chris Lattner | 697954c | 2002-01-20 22:54:45 +0000 | [diff] [blame] | 22 | using std::vector; |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 23 | |
| 24 | //*************************** Local Functions ******************************/ |
| 25 | |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 26 | |
Vikram S. Adve | 36f0a9e | 2002-05-19 15:34:29 +0000 | [diff] [blame] | 27 | // Generate code to load the constant into a TmpInstruction (virtual reg) and |
| 28 | // returns the virtual register. |
| 29 | // |
Vikram S. Adve | 6d35326 | 2001-10-17 23:57:50 +0000 | [diff] [blame] | 30 | static TmpInstruction* |
Chris Lattner | 2fbfdcf | 2002-04-07 20:49:59 +0000 | [diff] [blame] | 31 | InsertCodeToLoadConstant(Function *F, |
Vikram S. Adve | 42f6320 | 2002-03-18 03:33:43 +0000 | [diff] [blame] | 32 | Value* opValue, |
Vikram S. Adve | 6d35326 | 2001-10-17 23:57:50 +0000 | [diff] [blame] | 33 | Instruction* vmInstr, |
| 34 | vector<MachineInstr*>& loadConstVec, |
| 35 | TargetMachine& target) |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 36 | { |
Vikram S. Adve | 6d35326 | 2001-10-17 23:57:50 +0000 | [diff] [blame] | 37 | // Create a tmp virtual register to hold the constant. |
Chris Lattner | fb3b1ec | 2002-02-03 07:39:06 +0000 | [diff] [blame] | 38 | TmpInstruction* tmpReg = new TmpInstruction(opValue); |
Vikram S. Adve | 36f0a9e | 2002-05-19 15:34:29 +0000 | [diff] [blame] | 39 | MachineCodeForInstruction &mcfi = MachineCodeForInstruction::get(vmInstr); |
| 40 | mcfi.addTemp(tmpReg); |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 41 | |
Vikram S. Adve | 36f0a9e | 2002-05-19 15:34:29 +0000 | [diff] [blame] | 42 | target.getInstrInfo().CreateCodeToLoadConst(target, F, opValue, tmpReg, |
| 43 | loadConstVec, mcfi); |
Vikram S. Adve | 6d35326 | 2001-10-17 23:57:50 +0000 | [diff] [blame] | 44 | |
| 45 | // Record the mapping from the tmp VM instruction to machine instruction. |
| 46 | // Do this for all machine instructions that were not mapped to any |
| 47 | // other temp values created by |
| 48 | // tmpReg->addMachineInstruction(loadConstVec.back()); |
| 49 | |
| 50 | return tmpReg; |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 51 | } |
| 52 | |
| 53 | |
Vikram S. Adve | 6d35326 | 2001-10-17 23:57:50 +0000 | [diff] [blame] | 54 | //--------------------------------------------------------------------------- |
Vikram S. Adve | 1b51b1b | 2002-08-04 20:49:49 +0000 | [diff] [blame] | 55 | // Function GetConstantValueAsUnsignedInt |
Vikram S. Adve | 6d35326 | 2001-10-17 23:57:50 +0000 | [diff] [blame] | 56 | // Function GetConstantValueAsSignedInt |
| 57 | // |
Vikram S. Adve | 1b51b1b | 2002-08-04 20:49:49 +0000 | [diff] [blame] | 58 | // Convenience functions to get the value of an integral constant, for an |
| 59 | // appropriate integer or non-integer type that can be held in a signed |
| 60 | // or unsigned integer respectively. The type of the argument must be |
| 61 | // the following: |
Vikram S. Adve | 6d35326 | 2001-10-17 23:57:50 +0000 | [diff] [blame] | 62 | // Signed or unsigned integer |
| 63 | // Boolean |
| 64 | // Pointer |
| 65 | // |
| 66 | // isValidConstant is set to true if a valid constant was found. |
| 67 | //--------------------------------------------------------------------------- |
| 68 | |
Vikram S. Adve | 1b51b1b | 2002-08-04 20:49:49 +0000 | [diff] [blame] | 69 | uint64_t |
| 70 | GetConstantValueAsUnsignedInt(const Value *V, |
| 71 | bool &isValidConstant) |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 72 | { |
Vikram S. Adve | 6d35326 | 2001-10-17 23:57:50 +0000 | [diff] [blame] | 73 | isValidConstant = true; |
Vikram S. Adve | 1b51b1b | 2002-08-04 20:49:49 +0000 | [diff] [blame] | 74 | |
| 75 | if (isa<Constant>(V)) |
Chris Lattner | 0c4e886 | 2002-09-03 01:08:28 +0000 | [diff] [blame] | 76 | if (const ConstantBool *CB = dyn_cast<ConstantBool>(V)) |
| 77 | return (int64_t)CB->getValue(); |
| 78 | else if (const ConstantSInt *CS = dyn_cast<ConstantSInt>(V)) |
| 79 | return (uint64_t)CS->getValue(); |
| 80 | else if (const ConstantUInt *CU = dyn_cast<ConstantUInt>(V)) |
| 81 | return CU->getValue(); |
Vikram S. Adve | 1b51b1b | 2002-08-04 20:49:49 +0000 | [diff] [blame] | 82 | |
Vikram S. Adve | 6d35326 | 2001-10-17 23:57:50 +0000 | [diff] [blame] | 83 | isValidConstant = false; |
| 84 | return 0; |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 85 | } |
| 86 | |
Vikram S. Adve | 1b51b1b | 2002-08-04 20:49:49 +0000 | [diff] [blame] | 87 | int64_t |
| 88 | GetConstantValueAsSignedInt(const Value *V, |
| 89 | bool &isValidConstant) |
| 90 | { |
| 91 | uint64_t C = GetConstantValueAsUnsignedInt(V, isValidConstant); |
| 92 | if (isValidConstant) { |
| 93 | if (V->getType()->isSigned() || C < INT64_MAX) // safe to cast to signed |
| 94 | return (int64_t) C; |
| 95 | else |
| 96 | isValidConstant = false; |
| 97 | } |
| 98 | return 0; |
| 99 | } |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 100 | |
Vikram S. Adve | 6851333 | 2002-08-24 21:00:08 +0000 | [diff] [blame] | 101 | |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 102 | //--------------------------------------------------------------------------- |
| 103 | // Function: FoldGetElemChain |
| 104 | // |
| 105 | // Purpose: |
Vikram S. Adve | c941b87 | 2002-03-24 03:37:53 +0000 | [diff] [blame] | 106 | // Fold a chain of GetElementPtr instructions containing only |
Vikram S. Adve | 36f0a9e | 2002-05-19 15:34:29 +0000 | [diff] [blame] | 107 | // constant offsets into an equivalent (Pointer, IndexVector) pair. |
Vikram S. Adve | c941b87 | 2002-03-24 03:37:53 +0000 | [diff] [blame] | 108 | // Returns the pointer Value, and stores the resulting IndexVector |
Vikram S. Adve | 6851333 | 2002-08-24 21:00:08 +0000 | [diff] [blame] | 109 | // in argument chainIdxVec. This is a helper function for |
| 110 | // FoldConstantIndices that does the actual folding. |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 111 | //--------------------------------------------------------------------------- |
| 112 | |
Vikram S. Adve | aebdbe6 | 2002-09-29 22:55:05 +0000 | [diff] [blame] | 113 | |
| 114 | // Check for a constant 0. |
| 115 | inline bool |
| 116 | IsZero(Value* idx) |
| 117 | { |
| 118 | return (idx == ConstantSInt::getNullValue(idx->getType())); |
| 119 | } |
| 120 | |
Vikram S. Adve | 6851333 | 2002-08-24 21:00:08 +0000 | [diff] [blame] | 121 | static Value* |
Vikram S. Adve | aebdbe6 | 2002-09-29 22:55:05 +0000 | [diff] [blame] | 122 | FoldGetElemChain(InstrTreeNode* ptrNode, vector<Value*>& chainIdxVec, |
| 123 | bool lastInstHasLeadingNonZero) |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 124 | { |
Vikram S. Adve | 6851333 | 2002-08-24 21:00:08 +0000 | [diff] [blame] | 125 | InstructionNode* gepNode = dyn_cast<InstructionNode>(ptrNode); |
Vikram S. Adve | 6851333 | 2002-08-24 21:00:08 +0000 | [diff] [blame] | 126 | GetElementPtrInst* gepInst = |
Chris Lattner | 597f81f | 2002-09-12 20:27:10 +0000 | [diff] [blame] | 127 | dyn_cast_or_null<GetElementPtrInst>(gepNode ? gepNode->getInstruction() :0); |
Chris Lattner | 106ff45 | 2002-09-11 01:21:29 +0000 | [diff] [blame] | 128 | |
| 129 | // ptr value is not computed in this tree or ptr value does not come from GEP |
| 130 | // instruction |
| 131 | if (gepInst == NULL) |
Vikram S. Adve | 6851333 | 2002-08-24 21:00:08 +0000 | [diff] [blame] | 132 | return NULL; |
| 133 | |
Vikram S. Adve | 1792779 | 2002-03-31 18:56:51 +0000 | [diff] [blame] | 134 | // Return NULL if we don't fold any instructions in. |
Vikram S. Adve | c941b87 | 2002-03-24 03:37:53 +0000 | [diff] [blame] | 135 | Value* ptrVal = NULL; |
Vikram S. Adve | 6851333 | 2002-08-24 21:00:08 +0000 | [diff] [blame] | 136 | |
Vikram S. Adve | c941b87 | 2002-03-24 03:37:53 +0000 | [diff] [blame] | 137 | // Now chase the chain of getElementInstr instructions, if any. |
Vikram S. Adve | 36f0a9e | 2002-05-19 15:34:29 +0000 | [diff] [blame] | 138 | // Check for any non-constant indices and stop there. |
Vikram S. Adve | aebdbe6 | 2002-09-29 22:55:05 +0000 | [diff] [blame] | 139 | // Also, stop if the first index of child is a non-zero array index |
| 140 | // and the last index of the current node is a non-array index: |
| 141 | // in that case, a non-array declared type is being accessed as an array |
| 142 | // which is not type-safe, but could be legal. |
Vikram S. Adve | c941b87 | 2002-03-24 03:37:53 +0000 | [diff] [blame] | 143 | // |
Vikram S. Adve | 6851333 | 2002-08-24 21:00:08 +0000 | [diff] [blame] | 144 | InstructionNode* ptrChild = gepNode; |
| 145 | while (ptrChild && (ptrChild->getOpLabel() == Instruction::GetElementPtr || |
| 146 | ptrChild->getOpLabel() == GetElemPtrIdx)) |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 147 | { |
| 148 | // Child is a GetElemPtr instruction |
Vikram S. Adve | 6851333 | 2002-08-24 21:00:08 +0000 | [diff] [blame] | 149 | gepInst = cast<GetElementPtrInst>(ptrChild->getValue()); |
| 150 | User::op_iterator OI, firstIdx = gepInst->idx_begin(); |
| 151 | User::op_iterator lastIdx = gepInst->idx_end(); |
Vikram S. Adve | 36f0a9e | 2002-05-19 15:34:29 +0000 | [diff] [blame] | 152 | bool allConstantOffsets = true; |
Vikram S. Adve | 1b51b1b | 2002-08-04 20:49:49 +0000 | [diff] [blame] | 153 | |
Vikram S. Adve | aebdbe6 | 2002-09-29 22:55:05 +0000 | [diff] [blame] | 154 | // The first index of every GEP must be an array index. |
| 155 | assert((*firstIdx)->getType() == Type::LongTy && |
| 156 | "INTERNAL ERROR: Structure index for a pointer type!"); |
| 157 | |
Vikram S. Adve | cf911de | 2002-10-14 16:30:55 +0000 | [diff] [blame] | 158 | // If the last instruction had a leading non-zero index, check if the |
| 159 | // current one references a sequential (i.e., indexable) type. |
| 160 | // If not, the code is not type-safe and we would create an illegal GEP |
Vikram S. Adve | aebdbe6 | 2002-09-29 22:55:05 +0000 | [diff] [blame] | 161 | // by folding them, so don't fold any more instructions. |
| 162 | // |
| 163 | if (lastInstHasLeadingNonZero) |
Vikram S. Adve | cf911de | 2002-10-14 16:30:55 +0000 | [diff] [blame] | 164 | if (! isa<SequentialType>(gepInst->getType()->getElementType())) |
| 165 | break; // cannot fold in any preceding getElementPtr instrs. |
Vikram S. Adve | aebdbe6 | 2002-09-29 22:55:05 +0000 | [diff] [blame] | 166 | |
Vikram S. Adve | 36f0a9e | 2002-05-19 15:34:29 +0000 | [diff] [blame] | 167 | // Check that all offsets are constant for this instruction |
Vikram S. Adve | 1b51b1b | 2002-08-04 20:49:49 +0000 | [diff] [blame] | 168 | for (OI = firstIdx; allConstantOffsets && OI != lastIdx; ++OI) |
| 169 | allConstantOffsets = isa<ConstantInt>(*OI); |
| 170 | |
Vikram S. Adve | 36f0a9e | 2002-05-19 15:34:29 +0000 | [diff] [blame] | 171 | if (allConstantOffsets) |
Vikram S. Adve | 1792779 | 2002-03-31 18:56:51 +0000 | [diff] [blame] | 172 | { // Get pointer value out of ptrChild. |
Vikram S. Adve | 6851333 | 2002-08-24 21:00:08 +0000 | [diff] [blame] | 173 | ptrVal = gepInst->getPointerOperand(); |
Vikram S. Adve | 1b51b1b | 2002-08-04 20:49:49 +0000 | [diff] [blame] | 174 | |
Vikram S. Adve | aebdbe6 | 2002-09-29 22:55:05 +0000 | [diff] [blame] | 175 | // Remember if it has leading zero index: it will be discarded later. |
| 176 | lastInstHasLeadingNonZero = ! IsZero(*firstIdx); |
Vikram S. Adve | 1b51b1b | 2002-08-04 20:49:49 +0000 | [diff] [blame] | 177 | |
| 178 | // Insert its index vector at the start, skipping any leading [0] |
Vikram S. Adve | 36f0a9e | 2002-05-19 15:34:29 +0000 | [diff] [blame] | 179 | chainIdxVec.insert(chainIdxVec.begin(), |
Vikram S. Adve | aebdbe6 | 2002-09-29 22:55:05 +0000 | [diff] [blame] | 180 | firstIdx + !lastInstHasLeadingNonZero, lastIdx); |
Vikram S. Adve | 1b51b1b | 2002-08-04 20:49:49 +0000 | [diff] [blame] | 181 | |
Vikram S. Adve | 1792779 | 2002-03-31 18:56:51 +0000 | [diff] [blame] | 182 | // Mark the folded node so no code is generated for it. |
Vikram S. Adve | c941b87 | 2002-03-24 03:37:53 +0000 | [diff] [blame] | 183 | ((InstructionNode*) ptrChild)->markFoldedIntoParent(); |
Vikram S. Adve | 1b51b1b | 2002-08-04 20:49:49 +0000 | [diff] [blame] | 184 | |
Vikram S. Adve | aebdbe6 | 2002-09-29 22:55:05 +0000 | [diff] [blame] | 185 | // Get the previous GEP instruction and continue trying to fold |
| 186 | ptrChild = dyn_cast<InstructionNode>(ptrChild->leftChild()); |
| 187 | } |
| 188 | else // cannot fold this getElementPtr instr. or any preceding ones |
| 189 | break; |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 190 | } |
Vikram S. Adve | 1b51b1b | 2002-08-04 20:49:49 +0000 | [diff] [blame] | 191 | |
Vikram S. Adve | 36f0a9e | 2002-05-19 15:34:29 +0000 | [diff] [blame] | 192 | // If the first getElementPtr instruction had a leading [0], add it back. |
Vikram S. Adve | 1b51b1b | 2002-08-04 20:49:49 +0000 | [diff] [blame] | 193 | // Note that this instruction is the *last* one successfully folded above. |
Vikram S. Adve | aebdbe6 | 2002-09-29 22:55:05 +0000 | [diff] [blame] | 194 | if (ptrVal && ! lastInstHasLeadingNonZero) |
Chris Lattner | 106ff45 | 2002-09-11 01:21:29 +0000 | [diff] [blame] | 195 | chainIdxVec.insert(chainIdxVec.begin(), ConstantSInt::get(Type::LongTy,0)); |
Vikram S. Adve | 1b51b1b | 2002-08-04 20:49:49 +0000 | [diff] [blame] | 196 | |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 197 | return ptrVal; |
| 198 | } |
| 199 | |
| 200 | |
Vikram S. Adve | 6851333 | 2002-08-24 21:00:08 +0000 | [diff] [blame] | 201 | //--------------------------------------------------------------------------- |
Vikram S. Adve | cf911de | 2002-10-14 16:30:55 +0000 | [diff] [blame] | 202 | // Function: GetGEPInstArgs |
| 203 | // |
| 204 | // Purpose: |
| 205 | // Helper function for GetMemInstArgs that handles the final getElementPtr |
| 206 | // instruction used by (or same as) the memory operation. |
| 207 | // Extracts the indices of the current instruction and tries to fold in |
| 208 | // preceding ones if all indices of the current one are constant. |
| 209 | //--------------------------------------------------------------------------- |
| 210 | |
| 211 | Value* |
| 212 | GetGEPInstArgs(InstructionNode* gepNode, |
| 213 | vector<Value*>& idxVec, |
| 214 | bool& allConstantIndices) |
| 215 | { |
| 216 | allConstantIndices = true; |
| 217 | GetElementPtrInst* gepI = cast<GetElementPtrInst>(gepNode->getInstruction()); |
| 218 | |
| 219 | // Default pointer is the one from the current instruction. |
| 220 | Value* ptrVal = gepI->getPointerOperand(); |
| 221 | InstrTreeNode* ptrChild = gepNode->leftChild(); |
| 222 | |
| 223 | // Extract the index vector of the GEP instructin. |
| 224 | // If all indices are constant and first index is zero, try to fold |
| 225 | // in preceding GEPs with all constant indices. |
| 226 | for (User::op_iterator OI=gepI->idx_begin(), OE=gepI->idx_end(); |
| 227 | allConstantIndices && OI != OE; ++OI) |
| 228 | if (! isa<Constant>(*OI)) |
| 229 | allConstantIndices = false; // note: this also terminates loop! |
| 230 | |
| 231 | // If we have only constant indices, fold chains of constant indices |
| 232 | // in this and any preceding GetElemPtr instructions. |
| 233 | bool foldedGEPs = false; |
| 234 | bool leadingNonZeroIdx = gepI && ! IsZero(*gepI->idx_begin()); |
| 235 | if (allConstantIndices) |
| 236 | if (Value* newPtr = FoldGetElemChain(ptrChild, idxVec, leadingNonZeroIdx)) |
| 237 | { |
| 238 | ptrVal = newPtr; |
| 239 | foldedGEPs = true; |
| 240 | } |
| 241 | |
| 242 | // Append the index vector of the current instruction. |
| 243 | // Skip the leading [0] index if preceding GEPs were folded into this. |
| 244 | idxVec.insert(idxVec.end(), |
| 245 | gepI->idx_begin() + (foldedGEPs && !leadingNonZeroIdx), |
| 246 | gepI->idx_end()); |
| 247 | |
| 248 | return ptrVal; |
| 249 | } |
| 250 | |
| 251 | //--------------------------------------------------------------------------- |
Vikram S. Adve | 6851333 | 2002-08-24 21:00:08 +0000 | [diff] [blame] | 252 | // Function: GetMemInstArgs |
| 253 | // |
| 254 | // Purpose: |
| 255 | // Get the pointer value and the index vector for a memory operation |
| 256 | // (GetElementPtr, Load, or Store). If all indices of the given memory |
| 257 | // operation are constant, fold in constant indices in a chain of |
| 258 | // preceding GetElementPtr instructions (if any), and return the |
| 259 | // pointer value of the first instruction in the chain. |
| 260 | // All folded instructions are marked so no code is generated for them. |
| 261 | // |
| 262 | // Return values: |
| 263 | // Returns the pointer Value to use. |
| 264 | // Returns the resulting IndexVector in idxVec. |
| 265 | // Returns true/false in allConstantIndices if all indices are/aren't const. |
| 266 | //--------------------------------------------------------------------------- |
| 267 | |
Vikram S. Adve | 6851333 | 2002-08-24 21:00:08 +0000 | [diff] [blame] | 268 | Value* |
Vikram S. Adve | cf911de | 2002-10-14 16:30:55 +0000 | [diff] [blame] | 269 | GetMemInstArgs(InstructionNode* memInstrNode, |
Vikram S. Adve | 6851333 | 2002-08-24 21:00:08 +0000 | [diff] [blame] | 270 | vector<Value*>& idxVec, |
| 271 | bool& allConstantIndices) |
| 272 | { |
Vikram S. Adve | cf911de | 2002-10-14 16:30:55 +0000 | [diff] [blame] | 273 | allConstantIndices = false; |
Vikram S. Adve | 6851333 | 2002-08-24 21:00:08 +0000 | [diff] [blame] | 274 | Instruction* memInst = memInstrNode->getInstruction(); |
Vikram S. Adve | aebdbe6 | 2002-09-29 22:55:05 +0000 | [diff] [blame] | 275 | assert(idxVec.size() == 0 && "Need empty vector to return indices"); |
Vikram S. Adve | 6851333 | 2002-08-24 21:00:08 +0000 | [diff] [blame] | 276 | |
| 277 | // If there is a GetElemPtr instruction to fold in to this instr, |
| 278 | // it must be in the left child for Load and GetElemPtr, and in the |
| 279 | // right child for Store instructions. |
| 280 | InstrTreeNode* ptrChild = (memInst->getOpcode() == Instruction::Store |
| 281 | ? memInstrNode->rightChild() |
| 282 | : memInstrNode->leftChild()); |
Vikram S. Adve | cf911de | 2002-10-14 16:30:55 +0000 | [diff] [blame] | 283 | |
Vikram S. Adve | 6851333 | 2002-08-24 21:00:08 +0000 | [diff] [blame] | 284 | // Default pointer is the one from the current instruction. |
| 285 | Value* ptrVal = ptrChild->getValue(); |
| 286 | |
Vikram S. Adve | cf911de | 2002-10-14 16:30:55 +0000 | [diff] [blame] | 287 | // Find the "last" GetElemPtr instruction: this one or the immediate child. |
| 288 | // There will be none if this is a load or a store from a scalar pointer. |
| 289 | InstructionNode* gepNode = NULL; |
| 290 | if (isa<GetElementPtrInst>(memInst)) |
| 291 | gepNode = memInstrNode; |
| 292 | else if (isa<InstructionNode>(ptrChild) && isa<GetElementPtrInst>(ptrVal)) |
| 293 | { // Child of load/store is a GEP and memInst is its only use. |
| 294 | // Use its indices and mark it as folded. |
| 295 | gepNode = cast<InstructionNode>(ptrChild); |
| 296 | gepNode->markFoldedIntoParent(); |
| 297 | } |
Vikram S. Adve | 6851333 | 2002-08-24 21:00:08 +0000 | [diff] [blame] | 298 | |
Vikram S. Adve | cf911de | 2002-10-14 16:30:55 +0000 | [diff] [blame] | 299 | // If there are no indices, return the current pointer. |
| 300 | // Else extract the pointer from the GEP and fold the indices. |
| 301 | return (gepNode)? GetGEPInstArgs(gepNode, idxVec, allConstantIndices) |
| 302 | : ptrVal; |
Vikram S. Adve | 6851333 | 2002-08-24 21:00:08 +0000 | [diff] [blame] | 303 | } |
| 304 | |
Vikram S. Adve | cf911de | 2002-10-14 16:30:55 +0000 | [diff] [blame] | 305 | |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 306 | //------------------------------------------------------------------------ |
| 307 | // Function Set2OperandsFromInstr |
| 308 | // Function Set3OperandsFromInstr |
| 309 | // |
| 310 | // For the common case of 2- and 3-operand arithmetic/logical instructions, |
| 311 | // set the m/c instr. operands directly from the VM instruction's operands. |
| 312 | // Check whether the first or second operand is 0 and can use a dedicated "0" |
| 313 | // register. |
| 314 | // Check whether the second operand should use an immediate field or register. |
| 315 | // (First and third operands are never immediates for such instructions.) |
| 316 | // |
| 317 | // Arguments: |
| 318 | // canDiscardResult: Specifies that the result operand can be discarded |
| 319 | // by using the dedicated "0" |
| 320 | // |
| 321 | // op1position, op2position and resultPosition: Specify in which position |
| 322 | // in the machine instruction the 3 operands (arg1, arg2 |
| 323 | // and result) should go. |
| 324 | // |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 325 | //------------------------------------------------------------------------ |
| 326 | |
| 327 | void |
| 328 | Set2OperandsFromInstr(MachineInstr* minstr, |
| 329 | InstructionNode* vmInstrNode, |
| 330 | const TargetMachine& target, |
| 331 | bool canDiscardResult, |
| 332 | int op1Position, |
| 333 | int resultPosition) |
| 334 | { |
| 335 | Set3OperandsFromInstr(minstr, vmInstrNode, target, |
| 336 | canDiscardResult, op1Position, |
| 337 | /*op2Position*/ -1, resultPosition); |
| 338 | } |
| 339 | |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 340 | |
| 341 | void |
| 342 | Set3OperandsFromInstr(MachineInstr* minstr, |
| 343 | InstructionNode* vmInstrNode, |
| 344 | const TargetMachine& target, |
| 345 | bool canDiscardResult, |
| 346 | int op1Position, |
| 347 | int op2Position, |
| 348 | int resultPosition) |
| 349 | { |
| 350 | assert(op1Position >= 0); |
| 351 | assert(resultPosition >= 0); |
| 352 | |
| 353 | // operand 1 |
Vikram S. Adve | 42f6320 | 2002-03-18 03:33:43 +0000 | [diff] [blame] | 354 | minstr->SetMachineOperandVal(op1Position, MachineOperand::MO_VirtualRegister, |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 355 | vmInstrNode->leftChild()->getValue()); |
| 356 | |
| 357 | // operand 2 (if any) |
| 358 | if (op2Position >= 0) |
Vikram S. Adve | 42f6320 | 2002-03-18 03:33:43 +0000 | [diff] [blame] | 359 | minstr->SetMachineOperandVal(op2Position, MachineOperand::MO_VirtualRegister, |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 360 | vmInstrNode->rightChild()->getValue()); |
| 361 | |
| 362 | // result operand: if it can be discarded, use a dead register if one exists |
| 363 | if (canDiscardResult && target.getRegInfo().getZeroRegNum() >= 0) |
Vikram S. Adve | 42f6320 | 2002-03-18 03:33:43 +0000 | [diff] [blame] | 364 | minstr->SetMachineOperandReg(resultPosition, |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 365 | target.getRegInfo().getZeroRegNum()); |
| 366 | else |
Vikram S. Adve | 42f6320 | 2002-03-18 03:33:43 +0000 | [diff] [blame] | 367 | minstr->SetMachineOperandVal(resultPosition, |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 368 | MachineOperand::MO_VirtualRegister, vmInstrNode->getValue()); |
| 369 | } |
| 370 | |
| 371 | |
| 372 | MachineOperand::MachineOperandType |
Vikram S. Adve | fd0ec80 | 2002-09-16 15:15:57 +0000 | [diff] [blame] | 373 | ChooseRegOrImmed(int64_t intValue, |
| 374 | bool isSigned, |
| 375 | MachineOpCode opCode, |
| 376 | const TargetMachine& target, |
| 377 | bool canUseImmed, |
| 378 | unsigned int& getMachineRegNum, |
| 379 | int64_t& getImmedValue) |
| 380 | { |
| 381 | MachineOperand::MachineOperandType opType=MachineOperand::MO_VirtualRegister; |
| 382 | getMachineRegNum = 0; |
| 383 | getImmedValue = 0; |
| 384 | |
| 385 | if (canUseImmed && |
| 386 | target.getInstrInfo().constantFitsInImmedField(opCode, intValue)) |
| 387 | { |
| 388 | opType = isSigned? MachineOperand::MO_SignExtendedImmed |
| 389 | : MachineOperand::MO_UnextendedImmed; |
| 390 | getImmedValue = intValue; |
| 391 | } |
| 392 | else if (intValue == 0 && target.getRegInfo().getZeroRegNum() >= 0) |
| 393 | { |
| 394 | opType = MachineOperand::MO_MachineRegister; |
| 395 | getMachineRegNum = target.getRegInfo().getZeroRegNum(); |
| 396 | } |
| 397 | |
| 398 | return opType; |
| 399 | } |
| 400 | |
| 401 | |
| 402 | MachineOperand::MachineOperandType |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 403 | ChooseRegOrImmed(Value* val, |
| 404 | MachineOpCode opCode, |
| 405 | const TargetMachine& target, |
| 406 | bool canUseImmed, |
| 407 | unsigned int& getMachineRegNum, |
| 408 | int64_t& getImmedValue) |
| 409 | { |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 410 | getMachineRegNum = 0; |
| 411 | getImmedValue = 0; |
Vikram S. Adve | fd0ec80 | 2002-09-16 15:15:57 +0000 | [diff] [blame] | 412 | |
| 413 | // To use reg or immed, constant needs to be integer, bool, or a NULL pointer |
Chris Lattner | e9bb2df | 2001-12-03 22:26:30 +0000 | [diff] [blame] | 414 | Constant *CPV = dyn_cast<Constant>(val); |
Vikram S. Adve | fd0ec80 | 2002-09-16 15:15:57 +0000 | [diff] [blame] | 415 | if (CPV == NULL || |
| 416 | (! CPV->getType()->isIntegral() && |
| 417 | ! (isa<PointerType>(CPV->getType()) && CPV->isNullValue()))) |
| 418 | return MachineOperand::MO_VirtualRegister; |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 419 | |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 420 | // Now get the constant value and check if it fits in the IMMED field. |
| 421 | // Take advantage of the fact that the max unsigned value will rarely |
| 422 | // fit into any IMMED field and ignore that case (i.e., cast smaller |
| 423 | // unsigned constants to signed). |
| 424 | // |
| 425 | int64_t intValue; |
Chris Lattner | 9b62503 | 2002-05-06 16:15:30 +0000 | [diff] [blame] | 426 | if (isa<PointerType>(CPV->getType())) |
Vikram S. Adve | fd0ec80 | 2002-09-16 15:15:57 +0000 | [diff] [blame] | 427 | intValue = 0; // We checked above that it is NULL |
| 428 | else if (ConstantBool* CB = dyn_cast<ConstantBool>(CPV)) |
| 429 | intValue = (int64_t) CB->getValue(); |
Vikram S. Adve | 9e29f78 | 2001-11-14 17:55:02 +0000 | [diff] [blame] | 430 | else if (CPV->getType()->isSigned()) |
Vikram S. Adve | fd0ec80 | 2002-09-16 15:15:57 +0000 | [diff] [blame] | 431 | intValue = cast<ConstantSInt>(CPV)->getValue(); |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 432 | else |
Vikram S. Adve | 1c10f17 | 2002-09-27 14:26:20 +0000 | [diff] [blame] | 433 | { // get the int value and sign-extend if original was less than 64 bits |
| 434 | intValue = (int64_t) cast<ConstantUInt>(CPV)->getValue(); |
| 435 | switch(CPV->getType()->getPrimitiveID()) |
| 436 | { |
| 437 | case Type::UByteTyID: intValue = (int64_t) (int8_t) intValue; break; |
| 438 | case Type::UShortTyID: intValue = (int64_t) (short) intValue; break; |
| 439 | case Type::UIntTyID: intValue = (int64_t) (int) intValue; break; |
| 440 | default: break; |
| 441 | } |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 442 | } |
| 443 | |
Vikram S. Adve | fd0ec80 | 2002-09-16 15:15:57 +0000 | [diff] [blame] | 444 | return ChooseRegOrImmed(intValue, CPV->getType()->isSigned(), |
| 445 | opCode, target, canUseImmed, |
| 446 | getMachineRegNum, getImmedValue); |
Vikram S. Adve | a1d14f3 | 2001-10-10 20:50:43 +0000 | [diff] [blame] | 447 | } |
| 448 | |
Vikram S. Adve | 6d35326 | 2001-10-17 23:57:50 +0000 | [diff] [blame] | 449 | |
| 450 | //--------------------------------------------------------------------------- |
| 451 | // Function: FixConstantOperandsForInstr |
| 452 | // |
| 453 | // Purpose: |
| 454 | // Special handling for constant operands of a machine instruction |
| 455 | // -- if the constant is 0, use the hardwired 0 register, if any; |
| 456 | // -- if the constant fits in the IMMEDIATE field, use that field; |
| 457 | // -- else create instructions to put the constant into a register, either |
| 458 | // directly or by loading explicitly from the constant pool. |
| 459 | // |
| 460 | // In the first 2 cases, the operand of `minstr' is modified in place. |
| 461 | // Returns a vector of machine instructions generated for operands that |
| 462 | // fall under case 3; these must be inserted before `minstr'. |
| 463 | //--------------------------------------------------------------------------- |
| 464 | |
| 465 | vector<MachineInstr*> |
| 466 | FixConstantOperandsForInstr(Instruction* vmInstr, |
| 467 | MachineInstr* minstr, |
| 468 | TargetMachine& target) |
| 469 | { |
| 470 | vector<MachineInstr*> loadConstVec; |
| 471 | |
Vikram S. Adve | fd0ec80 | 2002-09-16 15:15:57 +0000 | [diff] [blame] | 472 | MachineOpCode opCode = minstr->getOpCode(); |
| 473 | const MachineInstrInfo& instrInfo = target.getInstrInfo(); |
Chris Lattner | 8f78027 | 2002-10-29 17:25:41 +0000 | [diff] [blame^] | 474 | int resultPos = instrInfo.getResultPos(opCode); |
Vikram S. Adve | fd0ec80 | 2002-09-16 15:15:57 +0000 | [diff] [blame] | 475 | int immedPos = instrInfo.getImmedConstantPos(opCode); |
| 476 | |
Chris Lattner | 2fbfdcf | 2002-04-07 20:49:59 +0000 | [diff] [blame] | 477 | Function *F = vmInstr->getParent()->getParent(); |
Vikram S. Adve | fd0ec80 | 2002-09-16 15:15:57 +0000 | [diff] [blame] | 478 | |
Vikram S. Adve | 6d35326 | 2001-10-17 23:57:50 +0000 | [diff] [blame] | 479 | for (unsigned op=0; op < minstr->getNumOperands(); op++) |
| 480 | { |
| 481 | const MachineOperand& mop = minstr->getOperand(op); |
| 482 | |
Vikram S. Adve | fd0ec80 | 2002-09-16 15:15:57 +0000 | [diff] [blame] | 483 | // Skip the result position, preallocated machine registers, or operands |
| 484 | // that cannot be constants (CC regs or PC-relative displacements) |
Chris Lattner | 8f78027 | 2002-10-29 17:25:41 +0000 | [diff] [blame^] | 485 | if (resultPos == (int)op || |
Chris Lattner | 133f079 | 2002-10-28 04:45:29 +0000 | [diff] [blame] | 486 | mop.getType() == MachineOperand::MO_MachineRegister || |
| 487 | mop.getType() == MachineOperand::MO_CCRegister || |
| 488 | mop.getType() == MachineOperand::MO_PCRelativeDisp) |
Vikram S. Adve | fd0ec80 | 2002-09-16 15:15:57 +0000 | [diff] [blame] | 489 | continue; |
| 490 | |
Vikram S. Adve | 6d35326 | 2001-10-17 23:57:50 +0000 | [diff] [blame] | 491 | bool constantThatMustBeLoaded = false; |
Vikram S. Adve | fd0ec80 | 2002-09-16 15:15:57 +0000 | [diff] [blame] | 492 | unsigned int machineRegNum = 0; |
| 493 | int64_t immedValue = 0; |
| 494 | Value* opValue = NULL; |
| 495 | MachineOperand::MachineOperandType opType = |
| 496 | MachineOperand::MO_VirtualRegister; |
| 497 | |
| 498 | // Operand may be a virtual register or a compile-time constant |
Chris Lattner | 133f079 | 2002-10-28 04:45:29 +0000 | [diff] [blame] | 499 | if (mop.getType() == MachineOperand::MO_VirtualRegister) |
Vikram S. Adve | 42f6320 | 2002-03-18 03:33:43 +0000 | [diff] [blame] | 500 | { |
Vikram S. Adve | fd0ec80 | 2002-09-16 15:15:57 +0000 | [diff] [blame] | 501 | assert(mop.getVRegValue() != NULL); |
| 502 | opValue = mop.getVRegValue(); |
| 503 | if (Constant *opConst = dyn_cast<Constant>(opValue)) |
| 504 | { |
| 505 | opType = ChooseRegOrImmed(opConst, opCode, target, |
| 506 | (immedPos == (int)op), machineRegNum, immedValue); |
| 507 | if (opType == MachineOperand::MO_VirtualRegister) |
| 508 | constantThatMustBeLoaded = true; |
| 509 | } |
Vikram S. Adve | 94e40ef | 2001-10-28 21:46:23 +0000 | [diff] [blame] | 510 | } |
Vikram S. Adve | fd0ec80 | 2002-09-16 15:15:57 +0000 | [diff] [blame] | 511 | else |
| 512 | { |
Chris Lattner | 133f079 | 2002-10-28 04:45:29 +0000 | [diff] [blame] | 513 | assert(mop.getType() == MachineOperand::MO_SignExtendedImmed || |
| 514 | mop.getType() == MachineOperand::MO_UnextendedImmed); |
Vikram S. Adve | fd0ec80 | 2002-09-16 15:15:57 +0000 | [diff] [blame] | 515 | |
Chris Lattner | 133f079 | 2002-10-28 04:45:29 +0000 | [diff] [blame] | 516 | bool isSigned = (mop.getType() == |
Vikram S. Adve | fd0ec80 | 2002-09-16 15:15:57 +0000 | [diff] [blame] | 517 | MachineOperand::MO_SignExtendedImmed); |
| 518 | |
| 519 | // Bit-selection flags indicate an instruction that is extracting |
| 520 | // bits from its operand so ignore this even if it is a big constant. |
| 521 | if (mop.opHiBits32() || mop.opLoBits32() || |
| 522 | mop.opHiBits64() || mop.opLoBits64()) |
| 523 | continue; |
| 524 | |
| 525 | opType = ChooseRegOrImmed(mop.getImmedValue(), isSigned, |
| 526 | opCode, target, (immedPos == (int)op), |
| 527 | machineRegNum, immedValue); |
| 528 | |
Chris Lattner | 133f079 | 2002-10-28 04:45:29 +0000 | [diff] [blame] | 529 | if (opType == mop.getType()) |
Vikram S. Adve | fd0ec80 | 2002-09-16 15:15:57 +0000 | [diff] [blame] | 530 | continue; // no change: this is the most common case |
| 531 | |
| 532 | if (opType == MachineOperand::MO_VirtualRegister) |
| 533 | { |
| 534 | constantThatMustBeLoaded = true; |
| 535 | opValue = isSigned |
Chris Lattner | 82f05d8 | 2002-09-17 17:23:09 +0000 | [diff] [blame] | 536 | ? (Value*)ConstantSInt::get(Type::LongTy, immedValue) |
| 537 | : (Value*)ConstantUInt::get(Type::ULongTy,(uint64_t)immedValue); |
Vikram S. Adve | fd0ec80 | 2002-09-16 15:15:57 +0000 | [diff] [blame] | 538 | } |
| 539 | } |
| 540 | |
| 541 | if (opType == MachineOperand::MO_MachineRegister) |
| 542 | minstr->SetMachineOperandReg(op, machineRegNum); |
| 543 | else if (opType == MachineOperand::MO_SignExtendedImmed || |
| 544 | opType == MachineOperand::MO_UnextendedImmed) |
| 545 | minstr->SetMachineOperandConst(op, opType, immedValue); |
| 546 | else if (constantThatMustBeLoaded || |
| 547 | (opValue && isa<GlobalValue>(opValue))) |
| 548 | { // opValue is a constant that must be explicitly loaded into a reg |
| 549 | assert(opValue); |
| 550 | TmpInstruction* tmpReg = InsertCodeToLoadConstant(F, opValue, vmInstr, |
| 551 | loadConstVec, target); |
Vikram S. Adve | 42f6320 | 2002-03-18 03:33:43 +0000 | [diff] [blame] | 552 | minstr->SetMachineOperandVal(op, MachineOperand::MO_VirtualRegister, |
| 553 | tmpReg); |
Vikram S. Adve | 6d35326 | 2001-10-17 23:57:50 +0000 | [diff] [blame] | 554 | } |
| 555 | } |
| 556 | |
Vikram S. Adve | 36f0a9e | 2002-05-19 15:34:29 +0000 | [diff] [blame] | 557 | // Also, check for implicit operands used by the machine instruction |
| 558 | // (no need to check those defined since they cannot be constants). |
| 559 | // These include: |
Vikram S. Adve | 6d35326 | 2001-10-17 23:57:50 +0000 | [diff] [blame] | 560 | // -- arguments to a Call |
| 561 | // -- return value of a Return |
| 562 | // Any such operand that is a constant value needs to be fixed also. |
| 563 | // The current instructions with implicit refs (viz., Call and Return) |
| 564 | // have no immediate fields, so the constant always needs to be loaded |
| 565 | // into a register. |
| 566 | // |
Vikram S. Adve | fd0ec80 | 2002-09-16 15:15:57 +0000 | [diff] [blame] | 567 | bool isCall = instrInfo.isCall(opCode); |
Vikram S. Adve | 36f0a9e | 2002-05-19 15:34:29 +0000 | [diff] [blame] | 568 | unsigned lastCallArgNum = 0; // unused if not a call |
| 569 | CallArgsDescriptor* argDesc = NULL; // unused if not a call |
| 570 | if (isCall) |
| 571 | argDesc = CallArgsDescriptor::get(minstr); |
| 572 | |
Vikram S. Adve | 6d35326 | 2001-10-17 23:57:50 +0000 | [diff] [blame] | 573 | for (unsigned i=0, N=minstr->getNumImplicitRefs(); i < N; ++i) |
Chris Lattner | e9bb2df | 2001-12-03 22:26:30 +0000 | [diff] [blame] | 574 | if (isa<Constant>(minstr->getImplicitRef(i)) || |
Vikram S. Adve | 6d35326 | 2001-10-17 23:57:50 +0000 | [diff] [blame] | 575 | isa<GlobalValue>(minstr->getImplicitRef(i))) |
| 576 | { |
Vikram S. Adve | 94e40ef | 2001-10-28 21:46:23 +0000 | [diff] [blame] | 577 | Value* oldVal = minstr->getImplicitRef(i); |
Vikram S. Adve | 6d35326 | 2001-10-17 23:57:50 +0000 | [diff] [blame] | 578 | TmpInstruction* tmpReg = |
Chris Lattner | 2fbfdcf | 2002-04-07 20:49:59 +0000 | [diff] [blame] | 579 | InsertCodeToLoadConstant(F, oldVal, vmInstr, loadConstVec, target); |
Vikram S. Adve | 6d35326 | 2001-10-17 23:57:50 +0000 | [diff] [blame] | 580 | minstr->setImplicitRef(i, tmpReg); |
Vikram S. Adve | 36f0a9e | 2002-05-19 15:34:29 +0000 | [diff] [blame] | 581 | |
| 582 | if (isCall) |
| 583 | { // find and replace the argument in the CallArgsDescriptor |
| 584 | unsigned i=lastCallArgNum; |
| 585 | while (argDesc->getArgInfo(i).getArgVal() != oldVal) |
| 586 | ++i; |
| 587 | assert(i < argDesc->getNumArgs() && |
| 588 | "Constant operands to a call *must* be in the arg list"); |
| 589 | lastCallArgNum = i; |
| 590 | argDesc->getArgInfo(i).replaceArgVal(tmpReg); |
| 591 | } |
Vikram S. Adve | 6d35326 | 2001-10-17 23:57:50 +0000 | [diff] [blame] | 592 | } |
| 593 | |
| 594 | return loadConstVec; |
| 595 | } |
| 596 | |
| 597 | |