[llvm-commits] CVS: llvm/lib/Analysis/BasicAliasAnalysis.cpp
Alkis Evlogimenos
alkis at cs.uiuc.edu
Wed Dec 8 15:56:25 PST 2004
Changes in directory llvm/lib/Analysis:
BasicAliasAnalysis.cpp updated: 1.60 -> 1.61
---
Log message:
Add testcase and fix for yet another case where we query the size an
abstract type.
---
Diffs of the changes: (+11 -9)
Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp
diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.60 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.61
--- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.60 Wed Dec 8 17:42:11 2004
+++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Wed Dec 8 17:56:15 2004
@@ -456,7 +456,7 @@
if (BasePtr1Ty != BasePtr2Ty)
return MayAlias;
- const Type *GEPPointerTy = BasePtr1Ty;
+ const PointerType *GEPPointerTy = cast<PointerType>(BasePtr1Ty);
// Find the (possibly empty) initial sequence of equal values... which are not
// necessarily constants.
@@ -657,14 +657,16 @@
}
}
- int64_t Offset1 = getTargetData().getIndexedOffset(GEPPointerTy, GEP1Ops);
- int64_t Offset2 = getTargetData().getIndexedOffset(GEPPointerTy, GEP2Ops);
- assert(Offset1 < Offset2 &&"There is at least one different constant here!");
-
- if ((uint64_t)(Offset2-Offset1) >= SizeMax) {
- //std::cerr << "Determined that these two GEP's don't alias ["
- // << SizeMax << " bytes]: \n" << *GEP1 << *GEP2;
- return NoAlias;
+ if (GEPPointerTy->getElementType()->isSized()) {
+ int64_t Offset1 = getTargetData().getIndexedOffset(GEPPointerTy, GEP1Ops);
+ int64_t Offset2 = getTargetData().getIndexedOffset(GEPPointerTy, GEP2Ops);
+ assert(Offset1<Offset2 && "There is at least one different constant here!");
+
+ if ((uint64_t)(Offset2-Offset1) >= SizeMax) {
+ //std::cerr << "Determined that these two GEP's don't alias ["
+ // << SizeMax << " bytes]: \n" << *GEP1 << *GEP2;
+ return NoAlias;
+ }
}
return MayAlias;
}
More information about the llvm-commits
mailing list