[PATCH] D159203: [InstCombine] Fold (A/-B)==(A/B) to (A/B)==0

Marc Auberer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 19 13:37:36 PDT 2023


marcauberer marked an inline comment as done.
marcauberer added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:5215
+    if (match(Op0, m_OneUse(m_SDiv(m_Value(A), m_OneUse(m_Neg(m_Value(B)))))) &&
+        match(Op1, m_SDiv(m_Specific(A), m_Specific(B)))) {
+      // Check if A is known to be != INT_MIN
----------------
goldstein.w.n wrote:
> NB: A missing todo is if `B` is contant and `Op1` uses -B.
> Can you either add TODO comment or implement that.
Added a ToDo.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D159203



More information about the llvm-commits mailing list