blob: 513efe0ac2278ea2beaec42a9cf781484dd6f4d0 [file] [log] [blame]
Chris Lattner369bbeb2001-07-20 19:17:55 +00001//===- Expressions.cpp - Expression Analysis Utilities ----------------------=//
2//
3// This file defines a package of expression analysis utilties:
4//
5// ClassifyExpression: Analyze an expression to determine the complexity of the
6// expression, and which other variables it depends on.
7//
8//===----------------------------------------------------------------------===//
9
10#include "llvm/Analysis/Expressions.h"
Chris Lattner968ddc92002-04-08 20:18:09 +000011#include "llvm/ConstantHandling.h"
Chris Lattnere590ff22002-03-26 17:55:33 +000012#include "llvm/Function.h"
Chris Lattner19f31f22001-07-21 19:07:19 +000013
Chris Lattner69f8ce02001-09-11 04:27:34 +000014ExprType::ExprType(Value *Val) {
Chris Lattner1d87bcf2001-10-01 20:11:19 +000015 if (Val)
Chris Lattnere9bb2df2001-12-03 22:26:30 +000016 if (ConstantInt *CPI = dyn_cast<ConstantInt>(Val)) {
Chris Lattner1d87bcf2001-10-01 20:11:19 +000017 Offset = CPI;
18 Var = 0;
19 ExprTy = Constant;
20 Scale = 0;
21 return;
22 }
23
24 Var = Val; Offset = 0;
25 ExprTy = Var ? Linear : Constant;
Chris Lattner69f8ce02001-09-11 04:27:34 +000026 Scale = 0;
27}
28
Chris Lattnere9bb2df2001-12-03 22:26:30 +000029ExprType::ExprType(const ConstantInt *scale, Value *var,
30 const ConstantInt *offset) {
Chris Lattner50020222001-11-26 18:53:07 +000031 Scale = var ? scale : 0; Var = var; Offset = offset;
Chris Lattner69f8ce02001-09-11 04:27:34 +000032 ExprTy = Scale ? ScaledLinear : (Var ? Linear : Constant);
Chris Lattnerce8a1492002-09-03 01:05:48 +000033 if (Scale && Scale->isNullValue()) { // Simplify 0*Var + const
Chris Lattner69f8ce02001-09-11 04:27:34 +000034 Scale = 0; Var = 0;
35 ExprTy = Constant;
36 }
37}
38
39
40const Type *ExprType::getExprType(const Type *Default) const {
41 if (Offset) return Offset->getType();
42 if (Scale) return Scale->getType();
43 return Var ? Var->getType() : Default;
44}
45
46
47
Chris Lattner19f31f22001-07-21 19:07:19 +000048class DefVal {
Chris Lattnere9bb2df2001-12-03 22:26:30 +000049 const ConstantInt * const Val;
Chris Lattner19f31f22001-07-21 19:07:19 +000050 const Type * const Ty;
51protected:
Chris Lattnere9bb2df2001-12-03 22:26:30 +000052 inline DefVal(const ConstantInt *val, const Type *ty) : Val(val), Ty(ty) {}
Chris Lattner19f31f22001-07-21 19:07:19 +000053public:
54 inline const Type *getType() const { return Ty; }
Chris Lattnere9bb2df2001-12-03 22:26:30 +000055 inline const ConstantInt *getVal() const { return Val; }
56 inline operator const ConstantInt * () const { return Val; }
57 inline const ConstantInt *operator->() const { return Val; }
Chris Lattner19f31f22001-07-21 19:07:19 +000058};
59
60struct DefZero : public DefVal {
Chris Lattnere9bb2df2001-12-03 22:26:30 +000061 inline DefZero(const ConstantInt *val, const Type *ty) : DefVal(val, ty) {}
62 inline DefZero(const ConstantInt *val) : DefVal(val, val->getType()) {}
Chris Lattner19f31f22001-07-21 19:07:19 +000063};
64
65struct DefOne : public DefVal {
Chris Lattnere9bb2df2001-12-03 22:26:30 +000066 inline DefOne(const ConstantInt *val, const Type *ty) : DefVal(val, ty) {}
Chris Lattner19f31f22001-07-21 19:07:19 +000067};
68
Chris Lattner369bbeb2001-07-20 19:17:55 +000069
Chris Lattner9b534262002-03-14 22:35:50 +000070// getUnsignedConstant - Return a constant value of the specified type. If the
71// constant value is not valid for the specified type, return null. This cannot
72// happen for values in the range of 0 to 127.
73//
Chris Lattnere9bb2df2001-12-03 22:26:30 +000074static ConstantInt *getUnsignedConstant(uint64_t V, const Type *Ty) {
Chris Lattner9b625032002-05-06 16:15:30 +000075 if (isa<PointerType>(Ty)) Ty = Type::ULongTy;
Chris Lattner9b534262002-03-14 22:35:50 +000076 if (Ty->isSigned()) {
77 // If this value is not a valid unsigned value for this type, return null!
78 if (V > 127 && ((int64_t)V < 0 ||
79 !ConstantSInt::isValueValidForType(Ty, (int64_t)V)))
80 return 0;
81 return ConstantSInt::get(Ty, V);
82 } else {
83 // If this value is not a valid unsigned value for this type, return null!
84 if (V > 255 && !ConstantUInt::isValueValidForType(Ty, V))
85 return 0;
86 return ConstantUInt::get(Ty, V);
87 }
Chris Lattner369bbeb2001-07-20 19:17:55 +000088}
89
Chris Lattner369bbeb2001-07-20 19:17:55 +000090// Add - Helper function to make later code simpler. Basically it just adds
91// the two constants together, inserts the result into the constant pool, and
92// returns it. Of course life is not simple, and this is no exception. Factors
93// that complicate matters:
94// 1. Either argument may be null. If this is the case, the null argument is
95// treated as either 0 (if DefOne = false) or 1 (if DefOne = true)
96// 2. Types get in the way. We want to do arithmetic operations without
97// regard for the underlying types. It is assumed that the constants are
98// integral constants. The new value takes the type of the left argument.
99// 3. If DefOne is true, a null return value indicates a value of 1, if DefOne
100// is false, a null return value indicates a value of 0.
101//
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000102static const ConstantInt *Add(const ConstantInt *Arg1,
103 const ConstantInt *Arg2, bool DefOne) {
Chris Lattner369bbeb2001-07-20 19:17:55 +0000104 assert(Arg1 && Arg2 && "No null arguments should exist now!");
Chris Lattner19f31f22001-07-21 19:07:19 +0000105 assert(Arg1->getType() == Arg2->getType() && "Types must be compatible!");
Chris Lattner369bbeb2001-07-20 19:17:55 +0000106
107 // Actually perform the computation now!
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000108 Constant *Result = *Arg1 + *Arg2;
Chris Lattner19f31f22001-07-21 19:07:19 +0000109 assert(Result && Result->getType() == Arg1->getType() &&
110 "Couldn't perform addition!");
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000111 ConstantInt *ResultI = cast<ConstantInt>(Result);
Chris Lattner369bbeb2001-07-20 19:17:55 +0000112
113 // Check to see if the result is one of the special cases that we want to
114 // recognize...
Chris Lattner69f8ce02001-09-11 04:27:34 +0000115 if (ResultI->equalsInt(DefOne ? 1 : 0))
116 return 0; // Yes it is, simply return null.
Chris Lattner369bbeb2001-07-20 19:17:55 +0000117
Chris Lattner369bbeb2001-07-20 19:17:55 +0000118 return ResultI;
119}
120
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000121inline const ConstantInt *operator+(const DefZero &L, const DefZero &R) {
Chris Lattner19f31f22001-07-21 19:07:19 +0000122 if (L == 0) return R;
123 if (R == 0) return L;
Chris Lattner8e195e02001-09-07 16:31:04 +0000124 return Add(L, R, false);
Chris Lattner19f31f22001-07-21 19:07:19 +0000125}
Chris Lattner369bbeb2001-07-20 19:17:55 +0000126
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000127inline const ConstantInt *operator+(const DefOne &L, const DefOne &R) {
Chris Lattner19f31f22001-07-21 19:07:19 +0000128 if (L == 0) {
129 if (R == 0)
Chris Lattner69f8ce02001-09-11 04:27:34 +0000130 return getUnsignedConstant(2, L.getType());
Chris Lattner19f31f22001-07-21 19:07:19 +0000131 else
Chris Lattner69f8ce02001-09-11 04:27:34 +0000132 return Add(getUnsignedConstant(1, L.getType()), R, true);
Chris Lattner19f31f22001-07-21 19:07:19 +0000133 } else if (R == 0) {
Chris Lattner69f8ce02001-09-11 04:27:34 +0000134 return Add(L, getUnsignedConstant(1, L.getType()), true);
Chris Lattner19f31f22001-07-21 19:07:19 +0000135 }
Chris Lattner8e195e02001-09-07 16:31:04 +0000136 return Add(L, R, true);
Chris Lattner369bbeb2001-07-20 19:17:55 +0000137}
138
139
Chris Lattner19f31f22001-07-21 19:07:19 +0000140// Mul - Helper function to make later code simpler. Basically it just
Chris Lattner369bbeb2001-07-20 19:17:55 +0000141// multiplies the two constants together, inserts the result into the constant
142// pool, and returns it. Of course life is not simple, and this is no
143// exception. Factors that complicate matters:
144// 1. Either argument may be null. If this is the case, the null argument is
145// treated as either 0 (if DefOne = false) or 1 (if DefOne = true)
146// 2. Types get in the way. We want to do arithmetic operations without
147// regard for the underlying types. It is assumed that the constants are
148// integral constants.
149// 3. If DefOne is true, a null return value indicates a value of 1, if DefOne
150// is false, a null return value indicates a value of 0.
151//
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000152inline const ConstantInt *Mul(const ConstantInt *Arg1,
153 const ConstantInt *Arg2, bool DefOne) {
Chris Lattner369bbeb2001-07-20 19:17:55 +0000154 assert(Arg1 && Arg2 && "No null arguments should exist now!");
Chris Lattner19f31f22001-07-21 19:07:19 +0000155 assert(Arg1->getType() == Arg2->getType() && "Types must be compatible!");
Chris Lattner369bbeb2001-07-20 19:17:55 +0000156
157 // Actually perform the computation now!
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000158 Constant *Result = *Arg1 * *Arg2;
Chris Lattner19f31f22001-07-21 19:07:19 +0000159 assert(Result && Result->getType() == Arg1->getType() &&
Chris Lattner50020222001-11-26 18:53:07 +0000160 "Couldn't perform multiplication!");
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000161 ConstantInt *ResultI = cast<ConstantInt>(Result);
Chris Lattner369bbeb2001-07-20 19:17:55 +0000162
163 // Check to see if the result is one of the special cases that we want to
164 // recognize...
Chris Lattner69f8ce02001-09-11 04:27:34 +0000165 if (ResultI->equalsInt(DefOne ? 1 : 0))
166 return 0; // Yes it is, simply return null.
Chris Lattner369bbeb2001-07-20 19:17:55 +0000167
Chris Lattner369bbeb2001-07-20 19:17:55 +0000168 return ResultI;
169}
170
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000171inline const ConstantInt *operator*(const DefZero &L, const DefZero &R) {
Chris Lattner19f31f22001-07-21 19:07:19 +0000172 if (L == 0 || R == 0) return 0;
Chris Lattner8e195e02001-09-07 16:31:04 +0000173 return Mul(L, R, false);
Chris Lattner19f31f22001-07-21 19:07:19 +0000174}
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000175inline const ConstantInt *operator*(const DefOne &L, const DefZero &R) {
Chris Lattner69f8ce02001-09-11 04:27:34 +0000176 if (R == 0) return getUnsignedConstant(0, L.getType());
Chris Lattner19f31f22001-07-21 19:07:19 +0000177 if (L == 0) return R->equalsInt(1) ? 0 : R.getVal();
Chris Lattner50020222001-11-26 18:53:07 +0000178 return Mul(L, R, true);
Chris Lattner19f31f22001-07-21 19:07:19 +0000179}
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000180inline const ConstantInt *operator*(const DefZero &L, const DefOne &R) {
Chris Lattner50020222001-11-26 18:53:07 +0000181 if (L == 0 || R == 0) return L.getVal();
182 return Mul(R, L, false);
Chris Lattner19f31f22001-07-21 19:07:19 +0000183}
184
Chris Lattner69f8ce02001-09-11 04:27:34 +0000185// handleAddition - Add two expressions together, creating a new expression that
186// represents the composite of the two...
187//
188static ExprType handleAddition(ExprType Left, ExprType Right, Value *V) {
189 const Type *Ty = V->getType();
190 if (Left.ExprTy > Right.ExprTy)
Chris Lattner697954c2002-01-20 22:54:45 +0000191 std::swap(Left, Right); // Make left be simpler than right
Chris Lattner69f8ce02001-09-11 04:27:34 +0000192
193 switch (Left.ExprTy) {
194 case ExprType::Constant:
Chris Lattner50020222001-11-26 18:53:07 +0000195 return ExprType(Right.Scale, Right.Var,
196 DefZero(Right.Offset, Ty) + DefZero(Left.Offset, Ty));
Chris Lattner69f8ce02001-09-11 04:27:34 +0000197 case ExprType::Linear: // RHS side must be linear or scaled
198 case ExprType::ScaledLinear: // RHS must be scaled
199 if (Left.Var != Right.Var) // Are they the same variables?
Chris Lattner50020222001-11-26 18:53:07 +0000200 return V; // if not, we don't know anything!
Chris Lattner69f8ce02001-09-11 04:27:34 +0000201
202 return ExprType(DefOne(Left.Scale , Ty) + DefOne(Right.Scale , Ty),
Chris Lattner50020222001-11-26 18:53:07 +0000203 Right.Var,
Chris Lattner69f8ce02001-09-11 04:27:34 +0000204 DefZero(Left.Offset, Ty) + DefZero(Right.Offset, Ty));
205 default:
206 assert(0 && "Dont' know how to handle this case!");
207 return ExprType();
208 }
209}
210
211// negate - Negate the value of the specified expression...
212//
213static inline ExprType negate(const ExprType &E, Value *V) {
214 const Type *Ty = V->getType();
Chris Lattnercb05e782002-03-11 20:50:24 +0000215 ConstantInt *Zero = getUnsignedConstant(0, Ty);
216 ConstantInt *One = getUnsignedConstant(1, Ty);
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000217 ConstantInt *NegOne = cast<ConstantInt>(*Zero - *One);
Chris Lattner69f8ce02001-09-11 04:27:34 +0000218 if (NegOne == 0) return V; // Couldn't subtract values...
219
220 return ExprType(DefOne (E.Scale , Ty) * NegOne, E.Var,
221 DefZero(E.Offset, Ty) * NegOne);
222}
Chris Lattner19f31f22001-07-21 19:07:19 +0000223
Chris Lattner369bbeb2001-07-20 19:17:55 +0000224
225// ClassifyExpression: Analyze an expression to determine the complexity of the
226// expression, and which other values it depends on.
227//
228// Note that this analysis cannot get into infinite loops because it treats PHI
229// nodes as being an unknown linear expression.
230//
Chris Lattnerc74cb862002-08-30 22:53:53 +0000231ExprType ClassifyExpression(Value *Expr) {
Chris Lattner369bbeb2001-07-20 19:17:55 +0000232 assert(Expr != 0 && "Can't classify a null expression!");
Chris Lattner0da29c82001-12-05 19:38:29 +0000233 if (Expr->getType() == Type::FloatTy || Expr->getType() == Type::DoubleTy)
234 return Expr; // FIXME: Can't handle FP expressions
235
Chris Lattner369bbeb2001-07-20 19:17:55 +0000236 switch (Expr->getValueType()) {
237 case Value::InstructionVal: break; // Instruction... hmmm... investigate.
238 case Value::TypeVal: case Value::BasicBlockVal:
Chris Lattner96d0f302002-04-28 04:50:00 +0000239 case Value::FunctionVal: default:
Chris Lattner481fafe2001-12-13 00:45:06 +0000240 //assert(0 && "Unexpected expression type to classify!");
Chris Lattner697954c2002-01-20 22:54:45 +0000241 std::cerr << "Bizarre thing to expr classify: " << Expr << "\n";
Chris Lattner481fafe2001-12-13 00:45:06 +0000242 return Expr;
Chris Lattnere590ff22002-03-26 17:55:33 +0000243 case Value::GlobalVariableVal: // Global Variable & Function argument:
Chris Lattner73e21422002-04-09 19:48:49 +0000244 case Value::ArgumentVal: // nothing known, return variable itself
Chris Lattner369bbeb2001-07-20 19:17:55 +0000245 return Expr;
246 case Value::ConstantVal: // Constant value, just return constant
Chris Lattnerac7ad682003-04-16 22:50:19 +0000247 if (ConstantInt *CPI = dyn_cast<ConstantInt>(cast<Constant>(Expr)))
248 // It's an integral constant!
Chris Lattnerce8a1492002-09-03 01:05:48 +0000249 return ExprType(CPI->isNullValue() ? 0 : CPI);
Chris Lattner369bbeb2001-07-20 19:17:55 +0000250 return Expr;
251 }
252
Chris Lattner9636a912001-10-01 16:18:37 +0000253 Instruction *I = cast<Instruction>(Expr);
Chris Lattner19f31f22001-07-21 19:07:19 +0000254 const Type *Ty = I->getType();
Chris Lattner369bbeb2001-07-20 19:17:55 +0000255
256 switch (I->getOpcode()) { // Handle each instruction type seperately
257 case Instruction::Add: {
Chris Lattner19f31f22001-07-21 19:07:19 +0000258 ExprType Left (ClassifyExpression(I->getOperand(0)));
259 ExprType Right(ClassifyExpression(I->getOperand(1)));
Chris Lattner69f8ce02001-09-11 04:27:34 +0000260 return handleAddition(Left, Right, I);
Chris Lattner369bbeb2001-07-20 19:17:55 +0000261 } // end case Instruction::Add
262
Chris Lattner69f8ce02001-09-11 04:27:34 +0000263 case Instruction::Sub: {
264 ExprType Left (ClassifyExpression(I->getOperand(0)));
265 ExprType Right(ClassifyExpression(I->getOperand(1)));
Chris Lattner50020222001-11-26 18:53:07 +0000266 ExprType RightNeg = negate(Right, I);
267 if (RightNeg.Var == I && !RightNeg.Offset && !RightNeg.Scale)
268 return I; // Could not negate value...
269 return handleAddition(Left, RightNeg, I);
Chris Lattner69f8ce02001-09-11 04:27:34 +0000270 } // end case Instruction::Sub
271
Chris Lattner369bbeb2001-07-20 19:17:55 +0000272 case Instruction::Shl: {
Chris Lattner19f31f22001-07-21 19:07:19 +0000273 ExprType Right(ClassifyExpression(I->getOperand(1)));
274 if (Right.ExprTy != ExprType::Constant) break;
275 ExprType Left(ClassifyExpression(I->getOperand(0)));
276 if (Right.Offset == 0) return Left; // shl x, 0 = x
277 assert(Right.Offset->getType() == Type::UByteTy &&
Chris Lattner369bbeb2001-07-20 19:17:55 +0000278 "Shift amount must always be a unsigned byte!");
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000279 uint64_t ShiftAmount = ((ConstantUInt*)Right.Offset)->getValue();
280 ConstantInt *Multiplier = getUnsignedConstant(1ULL << ShiftAmount, Ty);
Chris Lattner9b534262002-03-14 22:35:50 +0000281
282 // We don't know how to classify it if they are shifting by more than what
283 // is reasonable. In most cases, the result will be zero, but there is one
284 // class of cases where it is not, so we cannot optimize without checking
285 // for it. The case is when you are shifting a signed value by 1 less than
286 // the number of bits in the value. For example:
287 // %X = shl sbyte %Y, ubyte 7
288 // will try to form an sbyte multiplier of 128, which will give a null
289 // multiplier, even though the result is not 0. Until we can check for this
290 // case, be conservative. TODO.
291 //
292 if (Multiplier == 0)
293 return Expr;
294
Chris Lattner8e195e02001-09-07 16:31:04 +0000295 return ExprType(DefOne(Left.Scale, Ty) * Multiplier, Left.Var,
296 DefZero(Left.Offset, Ty) * Multiplier);
Chris Lattner369bbeb2001-07-20 19:17:55 +0000297 } // end case Instruction::Shl
298
Chris Lattner19f31f22001-07-21 19:07:19 +0000299 case Instruction::Mul: {
300 ExprType Left (ClassifyExpression(I->getOperand(0)));
301 ExprType Right(ClassifyExpression(I->getOperand(1)));
302 if (Left.ExprTy > Right.ExprTy)
Chris Lattner697954c2002-01-20 22:54:45 +0000303 std::swap(Left, Right); // Make left be simpler than right
Chris Lattner19f31f22001-07-21 19:07:19 +0000304
305 if (Left.ExprTy != ExprType::Constant) // RHS must be > constant
306 return I; // Quadratic eqn! :(
307
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000308 const ConstantInt *Offs = Left.Offset;
Chris Lattner19f31f22001-07-21 19:07:19 +0000309 if (Offs == 0) return ExprType();
Chris Lattner8e195e02001-09-07 16:31:04 +0000310 return ExprType( DefOne(Right.Scale , Ty) * Offs, Right.Var,
311 DefZero(Right.Offset, Ty) * Offs);
Chris Lattner19f31f22001-07-21 19:07:19 +0000312 } // end case Instruction::Mul
313
314 case Instruction::Cast: {
315 ExprType Src(ClassifyExpression(I->getOperand(0)));
Chris Lattner69f8ce02001-09-11 04:27:34 +0000316 const Type *DestTy = I->getType();
Chris Lattner9b625032002-05-06 16:15:30 +0000317 if (isa<PointerType>(DestTy))
Chris Lattner69f8ce02001-09-11 04:27:34 +0000318 DestTy = Type::ULongTy; // Pointer types are represented as ulong
Chris Lattner19f31f22001-07-21 19:07:19 +0000319
Chris Lattner882572a2001-11-26 16:53:50 +0000320 /*
Misha Brukmanf117cc92003-05-20 18:45:36 +0000321 if (!Src.getExprType(0)->isLosslesslyConvertibleTo(DestTy)) {
Chris Lattner882572a2001-11-26 16:53:50 +0000322 if (Src.ExprTy != ExprType::Constant)
323 return I; // Converting cast, and not a constant value...
324 }
325 */
Chris Lattner19f31f22001-07-21 19:07:19 +0000326
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000327 const ConstantInt *Offset = Src.Offset;
328 const ConstantInt *Scale = Src.Scale;
Chris Lattner882572a2001-11-26 16:53:50 +0000329 if (Offset) {
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000330 const Constant *CPV = ConstantFoldCastInstruction(Offset, DestTy);
Chris Lattner882572a2001-11-26 16:53:50 +0000331 if (!CPV) return I;
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000332 Offset = cast<ConstantInt>(CPV);
Chris Lattner882572a2001-11-26 16:53:50 +0000333 }
334 if (Scale) {
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000335 const Constant *CPV = ConstantFoldCastInstruction(Scale, DestTy);
Chris Lattner882572a2001-11-26 16:53:50 +0000336 if (!CPV) return I;
Chris Lattnere9bb2df2001-12-03 22:26:30 +0000337 Scale = cast<ConstantInt>(CPV);
Chris Lattner882572a2001-11-26 16:53:50 +0000338 }
339 return ExprType(Scale, Src.Var, Offset);
Chris Lattner19f31f22001-07-21 19:07:19 +0000340 } // end case Instruction::Cast
Chris Lattner793d6782001-07-25 22:47:32 +0000341 // TODO: Handle SUB, SHR?
Chris Lattner369bbeb2001-07-20 19:17:55 +0000342
343 } // end switch
344
345 // Otherwise, I don't know anything about this value!
Chris Lattner19f31f22001-07-21 19:07:19 +0000346 return I;
Chris Lattner369bbeb2001-07-20 19:17:55 +0000347}