Regression tests for PR258 and PR259.
[oota-llvm.git] / lib / Analysis / BasicAliasAnalysis.cpp
1 //===- BasicAliasAnalysis.cpp - Local Alias Analysis Impl -----------------===//
2 // 
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 // 
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines the default implementation of the Alias Analysis interface
11 // that simply implements a few identities (two different globals cannot alias,
12 // etc), but otherwise does no analysis.
13 //
14 // FIXME: This could be extended for a very simple form of mod/ref information.
15 // If a pointer is locally allocated (either malloc or alloca) and never passed
16 // into a call or stored to memory, then we know that calls will not mod/ref the
17 // memory.  This can be important for tailcallelim.
18 //
19 //===----------------------------------------------------------------------===//
20
21 #include "llvm/Analysis/AliasAnalysis.h"
22 #include "llvm/Pass.h"
23 #include "llvm/Argument.h"
24 #include "llvm/iOther.h"
25 #include "llvm/iMemory.h"
26 #include "llvm/Constants.h"
27 #include "llvm/GlobalVariable.h"
28 #include "llvm/DerivedTypes.h"
29 #include "llvm/Target/TargetData.h"
30 #include "llvm/Support/GetElementPtrTypeIterator.h"
31 using namespace llvm;
32
33 // Make sure that anything that uses AliasAnalysis pulls in this file...
34 void llvm::BasicAAStub() {}
35
36 namespace {
37   struct BasicAliasAnalysis : public ImmutablePass, public AliasAnalysis {
38     
39     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
40       AliasAnalysis::getAnalysisUsage(AU);
41     }
42     
43     virtual void initializePass();
44
45     AliasResult alias(const Value *V1, unsigned V1Size,
46                       const Value *V2, unsigned V2Size);
47
48     /// pointsToConstantMemory - Chase pointers until we find a (constant
49     /// global) or not.
50     bool pointsToConstantMemory(const Value *P);
51
52   private:
53     // CheckGEPInstructions - Check two GEP instructions with known
54     // must-aliasing base pointers.  This checks to see if the index expressions
55     // preclude the pointers from aliasing...
56     AliasResult
57     CheckGEPInstructions(const Type* BasePtr1Ty, std::vector<Value*> &GEP1Ops,
58                          unsigned G1Size,
59                          const Type *BasePtr2Ty, std::vector<Value*> &GEP2Ops,
60                          unsigned G2Size);
61   };
62  
63   // Register this pass...
64   RegisterOpt<BasicAliasAnalysis>
65   X("basicaa", "Basic Alias Analysis (default AA impl)");
66
67   // Declare that we implement the AliasAnalysis interface
68   RegisterAnalysisGroup<AliasAnalysis, BasicAliasAnalysis, true> Y;
69 }  // End of anonymous namespace
70
71 void BasicAliasAnalysis::initializePass() {
72   InitializeAliasAnalysis(this);
73 }
74
75 // hasUniqueAddress - Return true if the specified value points to something
76 // with a unique, discernable, address.
77 static inline bool hasUniqueAddress(const Value *V) {
78   return isa<GlobalValue>(V) || isa<AllocationInst>(V);
79 }
80
81 // getUnderlyingObject - This traverses the use chain to figure out what object
82 // the specified value points to.  If the value points to, or is derived from, a
83 // unique object or an argument, return it.
84 static const Value *getUnderlyingObject(const Value *V) {
85   if (!isa<PointerType>(V->getType())) return 0;
86
87   // If we are at some type of object... return it.
88   if (hasUniqueAddress(V) || isa<Argument>(V)) return V;
89   
90   // Traverse through different addressing mechanisms...
91   if (const Instruction *I = dyn_cast<Instruction>(V)) {
92     if (isa<CastInst>(I) || isa<GetElementPtrInst>(I))
93       return getUnderlyingObject(I->getOperand(0));
94   } else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) {
95     if (CE->getOpcode() == Instruction::Cast ||
96         CE->getOpcode() == Instruction::GetElementPtr)
97       return getUnderlyingObject(CE->getOperand(0));
98   } else if (const ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(V)) {
99     return CPR->getValue();
100   }
101   return 0;
102 }
103
104 static const User *isGEP(const Value *V) {
105   if (isa<GetElementPtrInst>(V) ||
106       (isa<ConstantExpr>(V) &&
107        cast<ConstantExpr>(V)->getOpcode() == Instruction::GetElementPtr))
108     return cast<User>(V);
109   return 0;
110 }
111
112 static const Value *GetGEPOperands(const Value *V, std::vector<Value*> &GEPOps){
113   assert(GEPOps.empty() && "Expect empty list to populate!");
114   GEPOps.insert(GEPOps.end(), cast<User>(V)->op_begin()+1,
115                 cast<User>(V)->op_end());
116
117   // Accumulate all of the chained indexes into the operand array
118   V = cast<User>(V)->getOperand(0);
119
120   while (const User *G = isGEP(V)) {
121     if (!isa<Constant>(GEPOps[0]) ||
122         !cast<Constant>(GEPOps[0])->isNullValue())
123       break;  // Don't handle folding arbitrary pointer offsets yet...
124     GEPOps.erase(GEPOps.begin());   // Drop the zero index
125     GEPOps.insert(GEPOps.begin(), G->op_begin()+1, G->op_end());
126     V = G->getOperand(0);
127   }
128   return V;
129 }
130
131 /// pointsToConstantMemory - Chase pointers until we find a (constant
132 /// global) or not.
133 bool BasicAliasAnalysis::pointsToConstantMemory(const Value *P) {
134   if (const Value *V = getUnderlyingObject(P))
135     if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(V))
136       return GV->isConstant();
137   return false;
138 }
139
140 // alias - Provide a bunch of ad-hoc rules to disambiguate in common cases, such
141 // as array references.  Note that this function is heavily tail recursive.
142 // Hopefully we have a smart C++ compiler.  :)
143 //
144 AliasAnalysis::AliasResult
145 BasicAliasAnalysis::alias(const Value *V1, unsigned V1Size,
146                           const Value *V2, unsigned V2Size) {
147   // Strip off any constant expression casts if they exist
148   if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(V1))
149     if (CE->getOpcode() == Instruction::Cast)
150       V1 = CE->getOperand(0);
151   if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(V2))
152     if (CE->getOpcode() == Instruction::Cast)
153       V2 = CE->getOperand(0);
154
155   // Strip off constant pointer refs if they exist
156   if (const ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(V1))
157     V1 = CPR->getValue();
158   if (const ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(V2))
159     V2 = CPR->getValue();
160
161   // Are we checking for alias of the same value?
162   if (V1 == V2) return MustAlias;
163
164   if ((!isa<PointerType>(V1->getType()) || !isa<PointerType>(V2->getType())) &&
165       V1->getType() != Type::LongTy && V2->getType() != Type::LongTy)
166     return NoAlias;  // Scalars cannot alias each other
167
168   // Strip off cast instructions...
169   if (const Instruction *I = dyn_cast<CastInst>(V1))
170     return alias(I->getOperand(0), V1Size, V2, V2Size);
171   if (const Instruction *I = dyn_cast<CastInst>(V2))
172     return alias(V1, V1Size, I->getOperand(0), V2Size);
173
174   // Figure out what objects these things are pointing to if we can...
175   const Value *O1 = getUnderlyingObject(V1);
176   const Value *O2 = getUnderlyingObject(V2);
177
178   // Pointing at a discernible object?
179   if (O1 && O2) {
180     if (isa<Argument>(O1)) {
181       // Incoming argument cannot alias locally allocated object!
182       if (isa<AllocationInst>(O2)) return NoAlias;
183       // Otherwise, nothing is known...
184     } else if (isa<Argument>(O2)) {
185       // Incoming argument cannot alias locally allocated object!
186       if (isa<AllocationInst>(O1)) return NoAlias;
187       // Otherwise, nothing is known...
188     } else {
189       // If they are two different objects, we know that we have no alias...
190       if (O1 != O2) return NoAlias;
191     }
192
193     // If they are the same object, they we can look at the indexes.  If they
194     // index off of the object is the same for both pointers, they must alias.
195     // If they are provably different, they must not alias.  Otherwise, we can't
196     // tell anything.
197   } else if (O1 && !isa<Argument>(O1) && isa<ConstantPointerNull>(V2)) {
198     return NoAlias;                    // Unique values don't alias null
199   } else if (O2 && !isa<Argument>(O2) && isa<ConstantPointerNull>(V1)) {
200     return NoAlias;                    // Unique values don't alias null
201   }
202
203   // If we have two gep instructions with must-alias'ing base pointers, figure
204   // out if the indexes to the GEP tell us anything about the derived pointer.
205   // Note that we also handle chains of getelementptr instructions as well as
206   // constant expression getelementptrs here.
207   //
208   if (isGEP(V1) && isGEP(V2)) {
209     // Drill down into the first non-gep value, to test for must-aliasing of
210     // the base pointers.
211     const Value *BasePtr1 = V1, *BasePtr2 = V2;
212     do {
213       BasePtr1 = cast<User>(BasePtr1)->getOperand(0);
214     } while (isGEP(BasePtr1) &&
215              cast<User>(BasePtr1)->getOperand(1) == 
216        Constant::getNullValue(cast<User>(BasePtr1)->getOperand(1)->getType()));
217     do {
218       BasePtr2 = cast<User>(BasePtr2)->getOperand(0);
219     } while (isGEP(BasePtr2) &&
220              cast<User>(BasePtr2)->getOperand(1) == 
221        Constant::getNullValue(cast<User>(BasePtr2)->getOperand(1)->getType()));
222
223     // Do the base pointers alias?
224     AliasResult BaseAlias = alias(BasePtr1, V1Size, BasePtr2, V2Size);
225     if (BaseAlias == NoAlias) return NoAlias;
226     if (BaseAlias == MustAlias) {
227       // If the base pointers alias each other exactly, check to see if we can
228       // figure out anything about the resultant pointers, to try to prove
229       // non-aliasing.
230
231       // Collect all of the chained GEP operands together into one simple place
232       std::vector<Value*> GEP1Ops, GEP2Ops;
233       BasePtr1 = GetGEPOperands(V1, GEP1Ops);
234       BasePtr2 = GetGEPOperands(V2, GEP2Ops);
235
236       AliasResult GAlias =
237         CheckGEPInstructions(BasePtr1->getType(), GEP1Ops, V1Size,
238                              BasePtr2->getType(), GEP2Ops, V2Size);
239       if (GAlias != MayAlias)
240         return GAlias;
241     }
242   }
243
244   // Check to see if these two pointers are related by a getelementptr
245   // instruction.  If one pointer is a GEP with a non-zero index of the other
246   // pointer, we know they cannot alias.
247   //
248   if (isGEP(V2)) {
249     std::swap(V1, V2);
250     std::swap(V1Size, V2Size);
251   }
252
253   if (V1Size != ~0U && V2Size != ~0U)
254     if (const User *GEP = isGEP(V1)) {
255       std::vector<Value*> GEPOperands;
256       const Value *BasePtr = GetGEPOperands(V1, GEPOperands);
257
258       AliasResult R = alias(BasePtr, V1Size, V2, V2Size);
259       if (R == MustAlias) {
260         // If there is at least one non-zero constant index, we know they cannot
261         // alias.
262         bool ConstantFound = false;
263         bool AllZerosFound = true;
264         for (unsigned i = 0, e = GEPOperands.size(); i != e; ++i)
265           if (const Constant *C = dyn_cast<Constant>(GEPOperands[i])) {
266             if (!C->isNullValue()) {
267               ConstantFound = true;
268               AllZerosFound = false;
269               break;
270             }
271           } else {
272             AllZerosFound = false;
273           }
274
275         // If we have getelementptr <ptr>, 0, 0, 0, 0, ... and V2 must aliases
276         // the ptr, the end result is a must alias also.
277         if (AllZerosFound)
278           return MustAlias;
279
280         if (ConstantFound) {
281           if (V2Size <= 1 && V1Size <= 1)  // Just pointer check?
282             return NoAlias;
283           
284           // Otherwise we have to check to see that the distance is more than
285           // the size of the argument... build an index vector that is equal to
286           // the arguments provided, except substitute 0's for any variable
287           // indexes we find...
288           for (unsigned i = 0; i != GEPOperands.size(); ++i)
289             if (!isa<Constant>(GEPOperands[i]) ||
290                 isa<ConstantExpr>(GEPOperands[i]))
291               GEPOperands[i] =Constant::getNullValue(GEPOperands[i]->getType());
292           int64_t Offset = getTargetData().getIndexedOffset(BasePtr->getType(),
293                                                             GEPOperands);
294           if (Offset >= (int64_t)V2Size || Offset <= -(int64_t)V1Size)
295             return NoAlias;
296         }
297       }
298     }
299   
300   return MayAlias;
301 }
302
303 /// CheckGEPInstructions - Check two GEP instructions with known must-aliasing
304 /// base pointers.  This checks to see if the index expressions preclude the
305 /// pointers from aliasing...
306 AliasAnalysis::AliasResult BasicAliasAnalysis::
307 CheckGEPInstructions(const Type* BasePtr1Ty, std::vector<Value*> &GEP1Ops,
308                      unsigned G1S,
309                      const Type *BasePtr2Ty, std::vector<Value*> &GEP2Ops,
310                      unsigned G2S) {
311   // We currently can't handle the case when the base pointers have different
312   // primitive types.  Since this is uncommon anyway, we are happy being
313   // extremely conservative.
314   if (BasePtr1Ty != BasePtr2Ty)
315     return MayAlias;
316
317   const Type *GEPPointerTy = BasePtr1Ty;
318
319   // Find the (possibly empty) initial sequence of equal values... which are not
320   // necessarily constants.
321   unsigned NumGEP1Operands = GEP1Ops.size(), NumGEP2Operands = GEP2Ops.size();
322   unsigned MinOperands = std::min(NumGEP1Operands, NumGEP2Operands);
323   unsigned MaxOperands = std::max(NumGEP1Operands, NumGEP2Operands);
324   unsigned UnequalOper = 0;
325   while (UnequalOper != MinOperands &&
326          GEP1Ops[UnequalOper] == GEP2Ops[UnequalOper]) {
327     // Advance through the type as we go...
328     ++UnequalOper;
329     if (const CompositeType *CT = dyn_cast<CompositeType>(BasePtr1Ty))
330       BasePtr1Ty = CT->getTypeAtIndex(GEP1Ops[UnequalOper-1]);
331     else {
332       // If all operands equal each other, then the derived pointers must
333       // alias each other...
334       BasePtr1Ty = 0;
335       assert(UnequalOper == NumGEP1Operands && UnequalOper == NumGEP2Operands &&
336              "Ran out of type nesting, but not out of operands?");
337       return MustAlias;
338     }
339   }
340
341   // If we have seen all constant operands, and run out of indexes on one of the
342   // getelementptrs, check to see if the tail of the leftover one is all zeros.
343   // If so, return mustalias.
344   if (UnequalOper == MinOperands) {
345     if (GEP1Ops.size() < GEP2Ops.size()) std::swap(GEP1Ops, GEP2Ops);
346     
347     bool AllAreZeros = true;
348     for (unsigned i = UnequalOper; i != MaxOperands; ++i)
349       if (!isa<Constant>(GEP1Ops[i]) ||
350           !cast<Constant>(GEP1Ops[i])->isNullValue()) {
351         AllAreZeros = false;
352         break;
353       }
354     if (AllAreZeros) return MustAlias;
355   }
356
357     
358   // So now we know that the indexes derived from the base pointers,
359   // which are known to alias, are different.  We can still determine a
360   // no-alias result if there are differing constant pairs in the index
361   // chain.  For example:
362   //        A[i][0] != A[j][1] iff (&A[0][1]-&A[0][0] >= std::max(G1S, G2S))
363   //
364   unsigned SizeMax = std::max(G1S, G2S);
365   if (SizeMax == ~0U) return MayAlias; // Avoid frivolous work...
366
367   // Scan for the first operand that is constant and unequal in the
368   // two getelemenptrs...
369   unsigned FirstConstantOper = UnequalOper;
370   for (; FirstConstantOper != MinOperands; ++FirstConstantOper) {
371     const Value *G1Oper = GEP1Ops[FirstConstantOper];
372     const Value *G2Oper = GEP2Ops[FirstConstantOper];
373     
374     if (G1Oper != G2Oper)   // Found non-equal constant indexes...
375       if (Constant *G1OC = dyn_cast<Constant>(const_cast<Value*>(G1Oper)))
376         if (Constant *G2OC = dyn_cast<Constant>(const_cast<Value*>(G2Oper))) {
377           // Make sure they are comparable (ie, not constant expressions)...
378           // and make sure the GEP with the smaller leading constant is GEP1.
379           Constant *Compare = ConstantExpr::get(Instruction::SetGT, G1OC, G2OC);
380           if (ConstantBool *CV = dyn_cast<ConstantBool>(Compare)) {
381             if (CV->getValue())   // If they are comparable and G2 > G1
382               std::swap(GEP1Ops, GEP2Ops);  // Make GEP1 < GEP2
383             break;
384           }
385         }
386     BasePtr1Ty = cast<CompositeType>(BasePtr1Ty)->getTypeAtIndex(G1Oper);
387   }
388   
389   // No shared constant operands, and we ran out of common operands.  At this
390   // point, the GEP instructions have run through all of their operands, and we
391   // haven't found evidence that there are any deltas between the GEP's.
392   // However, one GEP may have more operands than the other.  If this is the
393   // case, there may still be hope.  This this now.
394   if (FirstConstantOper == MinOperands) {
395     // Make GEP1Ops be the longer one if there is a longer one.
396     if (GEP1Ops.size() < GEP2Ops.size())
397       std::swap(GEP1Ops, GEP2Ops);
398
399     // Is there anything to check?
400     if (GEP1Ops.size() > MinOperands) {
401       for (unsigned i = FirstConstantOper; i != MaxOperands; ++i)
402         if (isa<Constant>(GEP1Ops[i]) && !isa<ConstantExpr>(GEP1Ops[i]) &&
403             !cast<Constant>(GEP1Ops[i])->isNullValue()) {
404           // Yup, there's a constant in the tail.  Set all variables to
405           // constants in the GEP instruction to make it suiteable for
406           // TargetData::getIndexedOffset.
407           for (i = 0; i != MaxOperands; ++i)
408             if (!isa<Constant>(GEP1Ops[i]) || isa<ConstantExpr>(GEP1Ops[i]))
409               GEP1Ops[i] = Constant::getNullValue(GEP1Ops[i]->getType());
410           // Okay, now get the offset.  This is the relative offset for the full
411           // instruction.
412           const TargetData &TD = getTargetData();
413           int64_t Offset1 = TD.getIndexedOffset(GEPPointerTy, GEP1Ops);
414
415           // Now crop off any constants from the end...
416           GEP1Ops.resize(MinOperands);
417           int64_t Offset2 = TD.getIndexedOffset(GEPPointerTy, GEP1Ops);
418         
419           // If the tail provided a bit enough offset, return noalias!
420           if ((uint64_t)(Offset2-Offset1) >= SizeMax)
421             return NoAlias;
422         }
423     }
424     
425     // Couldn't find anything useful.
426     return MayAlias;
427   }
428
429   // If there are non-equal constants arguments, then we can figure
430   // out a minimum known delta between the two index expressions... at
431   // this point we know that the first constant index of GEP1 is less
432   // than the first constant index of GEP2.
433
434   // Advance BasePtr[12]Ty over this first differing constant operand.
435   BasePtr2Ty = cast<CompositeType>(BasePtr1Ty)->getTypeAtIndex(GEP2Ops[FirstConstantOper]);
436   BasePtr1Ty = cast<CompositeType>(BasePtr1Ty)->getTypeAtIndex(GEP1Ops[FirstConstantOper]);
437   
438   // We are going to be using TargetData::getIndexedOffset to determine the
439   // offset that each of the GEP's is reaching.  To do this, we have to convert
440   // all variable references to constant references.  To do this, we convert the
441   // initial equal sequence of variables into constant zeros to start with.
442   for (unsigned i = 0; i != FirstConstantOper; ++i) {
443     if (!isa<Constant>(GEP1Ops[i]) || isa<ConstantExpr>(GEP1Ops[i]) ||
444         !isa<Constant>(GEP2Ops[i]) || isa<ConstantExpr>(GEP2Ops[i])) {
445       GEP1Ops[i] = Constant::getNullValue(GEP1Ops[i]->getType());
446       GEP2Ops[i] = Constant::getNullValue(GEP2Ops[i]->getType());
447     }
448   }
449
450   // We know that GEP1Ops[FirstConstantOper] & GEP2Ops[FirstConstantOper] are ok
451   
452   // Loop over the rest of the operands...
453   for (unsigned i = FirstConstantOper+1; i != MaxOperands; ++i) {
454     const Value *Op1 = i < GEP1Ops.size() ? GEP1Ops[i] : 0;
455     const Value *Op2 = i < GEP2Ops.size() ? GEP2Ops[i] : 0;
456     // If they are equal, use a zero index...
457     if (Op1 == Op2 && BasePtr1Ty == BasePtr2Ty) {
458       if (!isa<Constant>(Op1) || isa<ConstantExpr>(Op1))
459         GEP1Ops[i] = GEP2Ops[i] = Constant::getNullValue(Op1->getType());
460       // Otherwise, just keep the constants we have.
461     } else {
462       if (Op1) {
463         if (const ConstantInt *Op1C = dyn_cast<ConstantInt>(Op1)) {
464           // If this is an array index, make sure the array element is in range.
465           if (const ArrayType *AT = dyn_cast<ArrayType>(BasePtr1Ty))
466             if (Op1C->getRawValue() >= AT->getNumElements())
467               return MayAlias;  // Be conservative with out-of-range accesses
468           
469         } else {
470           // GEP1 is known to produce a value less than GEP2.  To be
471           // conservatively correct, we must assume the largest possible
472           // constant is used in this position.  This cannot be the initial
473           // index to the GEP instructions (because we know we have at least one
474           // element before this one with the different constant arguments), so
475           // we know that the current index must be into either a struct or
476           // array.  Because we know it's not constant, this cannot be a
477           // structure index.  Because of this, we can calculate the maximum
478           // value possible.
479           //
480           if (const ArrayType *AT = dyn_cast<ArrayType>(BasePtr1Ty))
481             GEP1Ops[i] = ConstantSInt::get(Type::LongTy,AT->getNumElements()-1);
482         }
483       }
484       
485       if (Op2) {
486         if (const ConstantInt *Op2C = dyn_cast<ConstantInt>(Op2)) {
487           // If this is an array index, make sure the array element is in range.
488           if (const ArrayType *AT = dyn_cast<ArrayType>(BasePtr1Ty))
489             if (Op2C->getRawValue() >= AT->getNumElements())
490               return MayAlias;  // Be conservative with out-of-range accesses
491         } else {  // Conservatively assume the minimum value for this index
492           GEP2Ops[i] = Constant::getNullValue(Op2->getType());
493         }
494       }
495     }
496
497     if (BasePtr1Ty && Op1) {
498       if (const CompositeType *CT = dyn_cast<CompositeType>(BasePtr1Ty))
499         BasePtr1Ty = CT->getTypeAtIndex(GEP1Ops[i]);
500       else
501         BasePtr1Ty = 0;
502     }
503
504     if (BasePtr2Ty && Op2) {
505       if (const CompositeType *CT = dyn_cast<CompositeType>(BasePtr2Ty))
506         BasePtr2Ty = CT->getTypeAtIndex(GEP2Ops[i]);
507       else
508         BasePtr2Ty = 0;
509     }
510   }
511   
512   int64_t Offset1 = getTargetData().getIndexedOffset(GEPPointerTy, GEP1Ops);
513   int64_t Offset2 = getTargetData().getIndexedOffset(GEPPointerTy, GEP2Ops);
514   assert(Offset1 < Offset2 &&"There is at least one different constant here!");
515
516   if ((uint64_t)(Offset2-Offset1) >= SizeMax) {
517     //std::cerr << "Determined that these two GEP's don't alias [" 
518     //          << SizeMax << " bytes]: \n" << *GEP1 << *GEP2;
519     return NoAlias;
520   }
521   return MayAlias;
522 }
523