]> granicus.if.org Git - llvm/commitdiff
[LVI] Add Datalayout to the class LazyValueInfo since all its Impls require it. NFC
authorAnna Thomas <anna@azul.com>
Sun, 12 Mar 2017 14:06:41 +0000 (14:06 +0000)
committerAnna Thomas <anna@azul.com>
Sun, 12 Mar 2017 14:06:41 +0000 (14:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297583 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/LazyValueInfo.h
lib/Analysis/LazyValueInfo.cpp

index ef0762079d924b62aac99c9e9c46df1734f84aab..37f2756d578b6dca985d5c2dc5f01f02a7d9515e 100644 (file)
@@ -32,6 +32,7 @@ namespace llvm {
 class LazyValueInfo {
   friend class LazyValueInfoWrapperPass;
   AssumptionCache *AC = nullptr;
+  const DataLayout *DL = nullptr;
   class TargetLibraryInfo *TLI = nullptr;
   DominatorTree *DT = nullptr;
   void *PImpl = nullptr;
@@ -40,16 +41,17 @@ class LazyValueInfo {
 public:
   ~LazyValueInfo();
   LazyValueInfo() {}
-  LazyValueInfo(AssumptionCache *AC_, TargetLibraryInfo *TLI_,
+  LazyValueInfo(AssumptionCache *AC_, const DataLayout *DL_, TargetLibraryInfo *TLI_,
                 DominatorTree *DT_)
-      : AC(AC_), TLI(TLI_), DT(DT_) {}
+      : AC(AC_), DL(DL_), TLI(TLI_), DT(DT_) {}
   LazyValueInfo(LazyValueInfo &&Arg)
-      : AC(Arg.AC), TLI(Arg.TLI), DT(Arg.DT), PImpl(Arg.PImpl) {
+      : AC(Arg.AC), DL(Arg.DL), TLI(Arg.TLI), DT(Arg.DT), PImpl(Arg.PImpl) {
     Arg.PImpl = nullptr;
   }
   LazyValueInfo &operator=(LazyValueInfo &&Arg) {
     releaseMemory();
     AC = Arg.AC;
+    DL = Arg.DL;
     TLI = Arg.TLI;
     DT = Arg.DT;
     PImpl = Arg.PImpl;
index 9e40b0553669ac50a46496caecbaa1194fd1cb0f..7a740e9b3dbdc9fe349c223ef4ca6b2c4690b4dd 100644 (file)
@@ -1554,7 +1554,7 @@ LazyValueInfo LazyValueAnalysis::run(Function &F, FunctionAnalysisManager &FAM)
   auto &TLI = FAM.getResult<TargetLibraryAnalysis>(F);
   auto *DT = FAM.getCachedResult<DominatorTreeAnalysis>(F);
 
-  return LazyValueInfo(&AC, &TLI, DT);
+  return LazyValueInfo(&AC, &F.getParent()->getDataLayout(), &TLI, DT);
 }
 
 /// Returns true if we can statically tell that this value will never be a