[PATCH] D152838: [ValueTracking] Add range computation from dominating conditions

Aleksandr Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 15 05:41:05 PDT 2023


aleksandr.popov updated this revision to Diff 531711.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152838/new/

https://reviews.llvm.org/D152838

Files:
  llvm/lib/Analysis/ValueTracking.cpp


Index: llvm/lib/Analysis/ValueTracking.cpp
===================================================================
--- llvm/lib/Analysis/ValueTracking.cpp
+++ llvm/lib/Analysis/ValueTracking.cpp
@@ -6046,14 +6046,12 @@
     return LHSR.intersectWith(RHSR);
   }
 
-  unsigned BitWidth = V->getType()->getScalarSizeInBits();
   CmpInst::Predicate Pred;
   const APInt *C;
   if (match(Condition, m_ICmp(Pred, m_Specific(V), m_APInt(C))))
-    if (C->getBitWidth() == BitWidth)
-      return ConstantRange::makeExactICmpRegion(Pred, *C);
+    return ConstantRange::makeExactICmpRegion(Pred, *C);
 
-  return ConstantRange::getFull(BitWidth);
+  return ConstantRange::getFull(V->getType()->getScalarSizeInBits());
 }
 
 static ConstantRange


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152838.531711.patch
Type: text/x-patch
Size: 734 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230615/33dd47de/attachment.bin>


More information about the llvm-commits mailing list