]> granicus.if.org Git - llvm/commitdiff
[AAEval] Use LocationSize instead of ints; NFC
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Sun, 23 Dec 2018 02:39:58 +0000 (02:39 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Sun, 23 Dec 2018 02:39:58 +0000 (02:39 +0000)
Keeping these patches super small so they're easily post-commit
verifiable, as requested in D44748.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350014 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/AliasAnalysisEvaluator.cpp

index 764ae9160350586781141ccb8f28005dbe64fe8c..7b4d174949a938001a4741e522bfbca14c3f36fd 100644 (file)
@@ -141,14 +141,16 @@ void AAEvaluator::runInternal(Function &F, AAResults &AA) {
   // iterate over the worklist, and run the full (n^2)/2 disambiguations
   for (SetVector<Value *>::iterator I1 = Pointers.begin(), E = Pointers.end();
        I1 != E; ++I1) {
-    uint64_t I1Size = MemoryLocation::UnknownSize;
+    auto I1Size = LocationSize::unknown();
     Type *I1ElTy = cast<PointerType>((*I1)->getType())->getElementType();
-    if (I1ElTy->isSized()) I1Size = DL.getTypeStoreSize(I1ElTy);
+    if (I1ElTy->isSized())
+      I1Size = LocationSize::precise(DL.getTypeStoreSize(I1ElTy));
 
     for (SetVector<Value *>::iterator I2 = Pointers.begin(); I2 != I1; ++I2) {
-      uint64_t I2Size = MemoryLocation::UnknownSize;
-      Type *I2ElTy =cast<PointerType>((*I2)->getType())->getElementType();
-      if (I2ElTy->isSized()) I2Size = DL.getTypeStoreSize(I2ElTy);
+      auto I2Size = LocationSize::unknown();
+      Type *I2ElTy = cast<PointerType>((*I2)->getType())->getElementType();
+      if (I2ElTy->isSized())
+        I2Size = LocationSize::precise(DL.getTypeStoreSize(I2ElTy));
 
       AliasResult AR = AA.alias(*I1, I1Size, *I2, I2Size);
       switch (AR) {
@@ -232,9 +234,10 @@ void AAEvaluator::runInternal(Function &F, AAResults &AA) {
     Instruction *I = C.getInstruction();
 
     for (auto Pointer : Pointers) {
-      uint64_t Size = MemoryLocation::UnknownSize;
+      auto Size = LocationSize::unknown();
       Type *ElTy = cast<PointerType>(Pointer->getType())->getElementType();
-      if (ElTy->isSized()) Size = DL.getTypeStoreSize(ElTy);
+      if (ElTy->isSized())
+        Size = LocationSize::precise(DL.getTypeStoreSize(ElTy));
 
       switch (AA.getModRefInfo(C, Pointer, Size)) {
       case ModRefInfo::NoModRef: