From dbe7fdc24b95422bde906fc657398bca04f1d43b Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 9 Apr 2019 07:13:03 +0000 Subject: [PATCH] [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 --- lib/Analysis/ValueTracking.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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( -- 2.50.1