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

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 12 14:07:49 PDT 2023


goldstein.w.n 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
----------------
NB: A missing todo is if `B` is contant and `Op1` uses -B.
Can you either add TODO comment or implement that.


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