Index: include/llvm/Analysis/PHITransAddr.h =================================================================== --- include/llvm/Analysis/PHITransAddr.h +++ include/llvm/Analysis/PHITransAddr.h @@ -50,8 +50,9 @@ SmallVector InstInputs; public: - PHITransAddr(Value *addr, const DataLayout &DL, AssumptionCache *AC) - : Addr(addr), DL(DL), TLI(nullptr), AC(AC) { + PHITransAddr(Value *addr, const DataLayout &DL, const TargetLibraryInfo *TLI, + AssumptionCache *AC) + : Addr(addr), DL(DL), TLI(TLI), AC(AC) { // If the address is an instruction, the whole thing is considered an input. if (Instruction *I = dyn_cast(Addr)) InstInputs.push_back(I); Index: include/llvm/Transforms/Utils/MemorySSA.h =================================================================== --- include/llvm/Transforms/Utils/MemorySSA.h +++ include/llvm/Transforms/Utils/MemorySSA.h @@ -918,7 +918,8 @@ if (WalkingPhi && Location.Ptr) { PHITransAddr Translator( const_cast(Location.Ptr), - OriginalAccess->getBlock()->getModule()->getDataLayout(), nullptr); + OriginalAccess->getBlock()->getModule()->getDataLayout(), nullptr, + nullptr); if (!Translator.PHITranslateValue(OriginalAccess->getBlock(), DefIterator.getPhiArgBlock(), nullptr, false)) Index: lib/Analysis/MemoryDependenceAnalysis.cpp =================================================================== --- lib/Analysis/MemoryDependenceAnalysis.cpp +++ lib/Analysis/MemoryDependenceAnalysis.cpp @@ -909,7 +909,7 @@ return; } const DataLayout &DL = FromBB->getModule()->getDataLayout(); - PHITransAddr Address(const_cast(Loc.Ptr), DL, &AC); + PHITransAddr Address(const_cast(Loc.Ptr), DL, &TLI, &AC); // This is the set of blocks we've inspected, and the pointer we consider in // each block. Because of critical edges, we currently bail out if querying Index: lib/Analysis/PHITransAddr.cpp =================================================================== --- lib/Analysis/PHITransAddr.cpp +++ lib/Analysis/PHITransAddr.cpp @@ -371,7 +371,7 @@ SmallVectorImpl &NewInsts) { // See if we have a version of this value already available and dominating // PredBB. If so, there is no need to insert a new instance of it. - PHITransAddr Tmp(InVal, DL, AC); + PHITransAddr Tmp(InVal, DL, TLI, AC); if (!Tmp.PHITranslateValue(CurBB, PredBB, &DT, /*MustDominate=*/true)) return Tmp.getAddr(); Index: lib/Transforms/Scalar/GVN.cpp =================================================================== --- lib/Transforms/Scalar/GVN.cpp +++ lib/Transforms/Scalar/GVN.cpp @@ -1494,7 +1494,7 @@ // If all preds have a single successor, then we know it is safe to insert // the load on the pred (?!?), so we can insert code to materialize the // pointer if it is not available. - PHITransAddr Address(LI->getPointerOperand(), DL, AC); + PHITransAddr Address(LI->getPointerOperand(), DL, TLI, AC); Value *LoadPtr = nullptr; LoadPtr = Address.PHITranslateWithInsertion(LoadBB, UnavailablePred, *DT, NewInsts);