[llvm] r357968 - [ValueTracking] Explicitly specify intersection type; NFC

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 9 00:13:04 PDT 2019


Author: nikic
Date: Tue Apr  9 00:13:03 2019
New Revision: 357968

URL: http://llvm.org/viewvc/llvm-project?rev=357968&view=rev
Log:
[ValueTracking] Explicitly specify intersection type; NFC

Preparation for D60420.

Modified:
    llvm/trunk/lib/Analysis/ValueTracking.cpp

Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=357968&r1=357967&r2=357968&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ValueTracking.cpp (original)
+++ llvm/trunk/lib/Analysis/ValueTracking.cpp Tue Apr  9 00:13:03 2019
@@ -4084,8 +4084,11 @@ static ConstantRange computeConstantRang
     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(




More information about the llvm-commits mailing list