From: Nikita Popov Date: Tue, 9 Apr 2019 07:13:03 +0000 (+0000) Subject: [ValueTracking] Explicitly specify intersection type; NFC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dbe7fdc24b95422bde906fc657398bca04f1d43b;p=llvm [ValueTracking] Explicitly specify intersection type; NFC Preparation for D60420. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357968 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/ValueTracking.cpp b/lib/Analysis/ValueTracking.cpp index e18679cf7bb..23835bd8676 100644 --- a/lib/Analysis/ValueTracking.cpp +++ b/lib/Analysis/ValueTracking.cpp @@ -4084,8 +4084,11 @@ static ConstantRange computeConstantRangeIncludingKnownBits( OptimizationRemarkEmitter *ORE = nullptr, bool UseInstrInfo = true) { KnownBits Known = computeKnownBits( V, DL, Depth, AC, CxtI, DT, ORE, UseInstrInfo); - ConstantRange CR = computeConstantRange(V, UseInstrInfo); - return ConstantRange::fromKnownBits(Known, ForSigned).intersectWith(CR); + ConstantRange CR1 = ConstantRange::fromKnownBits(Known, ForSigned); + ConstantRange CR2 = computeConstantRange(V, UseInstrInfo); + // TODO: Use ForSigned to determine preferred range. + ConstantRange::PreferredRangeType RangeType = ConstantRange::Smallest; + return CR1.intersectWith(CR2, RangeType); } OverflowResult llvm::computeOverflowForUnsignedAdd(