]> granicus.if.org Git - llvm/commitdiff
[ValueTracking] Explicitly specify intersection type; NFC
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 9 Apr 2019 07:13:03 +0000 (07:13 +0000)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 9 Apr 2019 07:13:03 +0000 (07:13 +0000)
Preparation for D60420.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357968 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ValueTracking.cpp

index e18679cf7bb44729d471bb81231ed2518e735771..23835bd8676c560010f481d2b27c9d6006cded58 100644 (file)
@@ -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(