summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/AliasSetTracker.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2018-08-16 20:11:15 +0000
committerPhilip Reames <listmail@philipreames.com>2018-08-16 20:11:15 +0000
commit0e2f9b9e30fedd13f8c68d92787fd636ea45c1ba (patch)
tree45ce4bd21a161207d375d96432266a01980a5a65 /llvm/lib/Analysis/AliasSetTracker.cpp
parent33ed57eebd408a5345b61c4075b730e990b70e62 (diff)
downloadbcm5719-llvm-0e2f9b9e30fedd13f8c68d92787fd636ea45c1ba.tar.gz
bcm5719-llvm-0e2f9b9e30fedd13f8c68d92787fd636ea45c1ba.zip
[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
Diffstat (limited to 'llvm/lib/Analysis/AliasSetTracker.cpp')
-rw-r--r--llvm/lib/Analysis/AliasSetTracker.cpp13
1 files changed, 7 insertions, 6 deletions
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<Value*>(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)) {
OpenPOWER on IntegriCloud