[llvm] [ValueTracking] Improve `isImpliedCondICmps` to handle binops (PR #69840)

via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 21 10:17:53 PDT 2023


================
@@ -8298,6 +8306,32 @@ static std::optional<bool> isImpliedCondICmps(const ICmpInst *LHS,
       return LPred == RPred;
   }
 
+  // handle R0 = L0 binop V
+  Value *R0Op1 = nullptr;
+  if (match(L1, m_APInt(LC)) && match(R1, m_APInt(RC)) &&
----------------
goldsteinn wrote:

Maybe init `LC` and `RC` to nullptr above and use the `APInt` matches above? (Although will need to switch the apint matchers to before the `L0 == R0`.

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


More information about the llvm-commits mailing list