[clang] [llvm] [ValueTracking] Extend computeConstantRange for add/sub, sext/zext/trunc (PR #181110)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 20 02:58:10 PST 2026


================
@@ -9818,10 +9818,14 @@ std::optional<bool> llvm::isImpliedByDomCondition(CmpPredicate Pred,
   return std::nullopt;
 }
 
-static void setLimitsForBinOp(const BinaryOperator &BO, APInt &Lower,
-                              APInt &Upper, const InstrInfoQuery &IIQ,
-                              bool PreferSignedRange) {
-  unsigned Width = Lower.getBitWidth();
+static ConstantRange getRangeForBinOp(const BinaryOperator &BO, bool ForSigned,
+                                      bool UseInstrInfo, AssumptionCache *AC,
+                                      const Instruction *CtxI,
+                                      const DominatorTree *DT, unsigned Depth) {
----------------
arsenm wrote:

All of these functions should probably be refactored to use SimplifyQuery 

https://github.com/llvm/llvm-project/pull/181110


More information about the cfe-commits mailing list