From 0e2f9b9e30fedd13f8c68d92787fd636ea45c1ba Mon Sep 17 00:00:00 2001 From: Philip Reames Date: Thu, 16 Aug 2018 20:11:15 +0000 Subject: [LICM][NFC] Restructure pointer invalidation API in terms of MemoryLocation Main value is just simplifying code. I'll further simply the argument handling case in a bit, but that involved a slightly orthogonal change so I went with the mildy ugly intermediate for this patch. Note that the isSized check in the old LICM code was not carried across. It turns out that check was dead. a) no test exercised it, and b) langref and verifier had been updated to disallow unsized types used in loads. llvm-svn: 339930 --- llvm/lib/Analysis/AliasSetTracker.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'llvm/lib/Analysis/AliasSetTracker.cpp') diff --git a/llvm/lib/Analysis/AliasSetTracker.cpp b/llvm/lib/Analysis/AliasSetTracker.cpp index 1a495ec3000..2879dea9f58 100644 --- a/llvm/lib/Analysis/AliasSetTracker.cpp +++ b/llvm/lib/Analysis/AliasSetTracker.cpp @@ -307,11 +307,12 @@ AliasSet *AliasSetTracker::findAliasSetForUnknownInst(Instruction *Inst) { return FoundSet; } -/// getAliasSetForPointer - Return the alias set that the specified pointer -/// lives in. -AliasSet &AliasSetTracker::getAliasSetForPointer(Value *Pointer, - LocationSize Size, - const AAMDNodes &AAInfo) { +AliasSet &AliasSetTracker::getAliasSetFor(const MemoryLocation &MemLoc) { + + Value * const Pointer = const_cast(MemLoc.Ptr); + const LocationSize Size = MemLoc.Size; + const AAMDNodes &AAInfo = MemLoc.AATags; + AliasSet::PointerRec &Entry = getEntryFor(Pointer); if (AliasAnyAS) { @@ -567,7 +568,7 @@ AliasSet &AliasSetTracker::mergeAllAliasSets() { AliasSet &AliasSetTracker::addPointer(Value *P, LocationSize Size, const AAMDNodes &AAInfo, AliasSet::AccessLattice E) { - AliasSet &AS = getAliasSetForPointer(P, Size, AAInfo); + AliasSet &AS = getAliasSetFor(MemoryLocation(P, Size, AAInfo)); AS.Access |= E; if (!AliasAnyAS && (TotalMayAliasSetSize > SaturationThreshold)) { -- cgit v1.2.3