[PM/AA] Simplify the AliasAnalysis interface by removing a wrapper
around a DataLayout interface in favor of directly querying DataLayout.
This wrapper specifically helped handle the case where this no
DataLayout, but LLVM now requires it simplifynig all of this. I've
updated callers to directly query DataLayout. This in turn exposed
a bunch of places where we should have DataLayout readily available but
don't which I've fixed. This then in turn exposed that we were passing
DataLayout around in a bunch of arguments rather than making it readily
available so I've also fixed that.
No functionality changed.
llvm-svn: 244189
diff --git a/llvm/lib/Analysis/AliasSetTracker.cpp b/llvm/lib/Analysis/AliasSetTracker.cpp
index 05bbe9b..f9d3126 100644
--- a/llvm/lib/Analysis/AliasSetTracker.cpp
+++ b/llvm/lib/Analysis/AliasSetTracker.cpp
@@ -17,6 +17,7 @@
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
+#include "llvm/IR/Module.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Type.h"
#include "llvm/Pass.h"
@@ -306,8 +307,9 @@
AliasSet::AccessLattice Access = AliasSet::RefAccess;
bool NewPtr;
+ const DataLayout &DL = LI->getModule()->getDataLayout();
AliasSet &AS = addPointer(LI->getOperand(0),
- AA.getTypeStoreSize(LI->getType()),
+ DL.getTypeStoreSize(LI->getType()),
AAInfo, Access, NewPtr);
if (LI->isVolatile()) AS.setVolatile();
return NewPtr;
@@ -321,9 +323,10 @@
AliasSet::AccessLattice Access = AliasSet::ModAccess;
bool NewPtr;
+ const DataLayout &DL = SI->getModule()->getDataLayout();
Value *Val = SI->getOperand(0);
AliasSet &AS = addPointer(SI->getOperand(1),
- AA.getTypeStoreSize(Val->getType()),
+ DL.getTypeStoreSize(Val->getType()),
AAInfo, Access, NewPtr);
if (SI->isVolatile()) AS.setVolatile();
return NewPtr;
@@ -440,7 +443,8 @@
}
bool AliasSetTracker::remove(LoadInst *LI) {
- uint64_t Size = AA.getTypeStoreSize(LI->getType());
+ const DataLayout &DL = LI->getModule()->getDataLayout();
+ uint64_t Size = DL.getTypeStoreSize(LI->getType());
AAMDNodes AAInfo;
LI->getAAMetadata(AAInfo);
@@ -452,7 +456,8 @@
}
bool AliasSetTracker::remove(StoreInst *SI) {
- uint64_t Size = AA.getTypeStoreSize(SI->getOperand(0)->getType());
+ const DataLayout &DL = SI->getModule()->getDataLayout();
+ uint64_t Size = DL.getTypeStoreSize(SI->getOperand(0)->getType());
AAMDNodes AAInfo;
SI->getAAMetadata(AAInfo);