@@ -1566,7 +1566,6 @@ void LazyValueInfoImpl::threadEdge(BasicBlock *PredBB, BasicBlock *OldSucc,
15661566
15671567bool LazyValueInfoWrapperPass::runOnFunction (Function &F) {
15681568 Info.AC = &getAnalysis<AssumptionCacheTracker>().getAssumptionCache (F);
1569- Info.TLI = &getAnalysis<TargetLibraryInfoWrapperPass>().getTLI (F);
15701569
15711570 if (auto *Impl = Info.getImpl ())
15721571 Impl->clear ();
@@ -1627,9 +1626,8 @@ void LazyValueInfoWrapperPass::releaseMemory() { Info.releaseMemory(); }
16271626LazyValueInfo LazyValueAnalysis::run (Function &F,
16281627 FunctionAnalysisManager &FAM) {
16291628 auto &AC = FAM.getResult <AssumptionAnalysis>(F);
1630- auto &TLI = FAM.getResult <TargetLibraryAnalysis>(F);
16311629
1632- return LazyValueInfo (&AC, &F.getParent ()->getDataLayout (), &TLI );
1630+ return LazyValueInfo (&AC, &F.getParent ()->getDataLayout ());
16331631}
16341632
16351633// / Returns true if we can statically tell that this value will never be a
@@ -1714,11 +1712,11 @@ ConstantRange LazyValueInfo::getConstantRangeOnEdge(Value *V,
17141712
17151713static LazyValueInfo::Tristate
17161714getPredicateResult (unsigned Pred, Constant *C, const ValueLatticeElement &Val,
1717- const DataLayout &DL, TargetLibraryInfo *TLI ) {
1715+ const DataLayout &DL) {
17181716 // If we know the value is a constant, evaluate the conditional.
17191717 Constant *Res = nullptr ;
17201718 if (Val.isConstant ()) {
1721- Res = ConstantFoldCompareInstOperands (Pred, Val.getConstant (), C, DL, TLI );
1719+ Res = ConstantFoldCompareInstOperands (Pred, Val.getConstant (), C, DL);
17221720 if (ConstantInt *ResCI = dyn_cast_or_null<ConstantInt>(Res))
17231721 return ResCI->isZero () ? LazyValueInfo::False : LazyValueInfo::True;
17241722 return LazyValueInfo::Unknown;
@@ -1759,15 +1757,13 @@ getPredicateResult(unsigned Pred, Constant *C, const ValueLatticeElement &Val,
17591757 if (Pred == ICmpInst::ICMP_EQ) {
17601758 // !C1 == C -> false iff C1 == C.
17611759 Res = ConstantFoldCompareInstOperands (ICmpInst::ICMP_NE,
1762- Val.getNotConstant (), C, DL,
1763- TLI);
1760+ Val.getNotConstant (), C, DL);
17641761 if (Res && Res->isNullValue ())
17651762 return LazyValueInfo::False;
17661763 } else if (Pred == ICmpInst::ICMP_NE) {
17671764 // !C1 != C -> true iff C1 == C.
17681765 Res = ConstantFoldCompareInstOperands (ICmpInst::ICMP_NE,
1769- Val.getNotConstant (), C, DL,
1770- TLI);
1766+ Val.getNotConstant (), C, DL);
17711767 if (Res && Res->isNullValue ())
17721768 return LazyValueInfo::True;
17731769 }
@@ -1787,7 +1783,7 @@ LazyValueInfo::getPredicateOnEdge(unsigned Pred, Value *V, Constant *C,
17871783 ValueLatticeElement Result =
17881784 getOrCreateImpl (M).getValueOnEdge (V, FromBB, ToBB, CxtI);
17891785
1790- return getPredicateResult (Pred, C, Result, M->getDataLayout (), TLI );
1786+ return getPredicateResult (Pred, C, Result, M->getDataLayout ());
17911787}
17921788
17931789LazyValueInfo::Tristate
@@ -1811,7 +1807,7 @@ LazyValueInfo::getPredicateAt(unsigned Pred, Value *V, Constant *C,
18111807 ValueLatticeElement Result =
18121808 UseBlockValue ? Impl.getValueInBlock (V, CxtI->getParent (), CxtI)
18131809 : Impl.getValueAt (V, CxtI);
1814- Tristate Ret = getPredicateResult (Pred, C, Result, DL, TLI );
1810+ Tristate Ret = getPredicateResult (Pred, C, Result, DL);
18151811 if (Ret != Unknown)
18161812 return Ret;
18171813
0 commit comments