From 99017253bb697131c3b49b57136429a81314e909 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Sun, 23 Dec 2018 02:39:58 +0000 Subject: [PATCH] [AAEval] Use LocationSize instead of ints; NFC 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 | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/Analysis/AliasAnalysisEvaluator.cpp b/lib/Analysis/AliasAnalysisEvaluator.cpp index 764ae916035..7b4d174949a 100644 --- a/lib/Analysis/AliasAnalysisEvaluator.cpp +++ b/lib/Analysis/AliasAnalysisEvaluator.cpp @@ -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::iterator I1 = Pointers.begin(), E = Pointers.end(); I1 != E; ++I1) { - uint64_t I1Size = MemoryLocation::UnknownSize; + auto I1Size = LocationSize::unknown(); Type *I1ElTy = cast((*I1)->getType())->getElementType(); - if (I1ElTy->isSized()) I1Size = DL.getTypeStoreSize(I1ElTy); + if (I1ElTy->isSized()) + I1Size = LocationSize::precise(DL.getTypeStoreSize(I1ElTy)); for (SetVector::iterator I2 = Pointers.begin(); I2 != I1; ++I2) { - uint64_t I2Size = MemoryLocation::UnknownSize; - Type *I2ElTy =cast((*I2)->getType())->getElementType(); - if (I2ElTy->isSized()) I2Size = DL.getTypeStoreSize(I2ElTy); + auto I2Size = LocationSize::unknown(); + Type *I2ElTy = cast((*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(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: -- 2.50.1