[llvm] [ValueTracking] a - b == NonZero -> a != b (PR #159792)

Andreas Jonson via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 19 12:08:04 PDT 2025


================
@@ -9425,6 +9425,21 @@ isImpliedCondICmps(CmpPredicate LPred, const Value *L0, const Value *L1,
       return true;
   }
 
+  // a - b == NonZero -> a != b
+  // ptrtoint(a) - ptrtoint(b) == NonZero -> a != b
+  const APInt *RHSC;
----------------
andjo403 wrote:

minor nit think that the name RHSC is a bit confusing when there is RHS that is a icmp already. maybe L1C

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


More information about the llvm-commits mailing list