[PATCH] D135380: [GlobalISel] Combine (X op Y) == X --> Y == 0

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 6 13:57:07 PDT 2022


paquette added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:6062
+  Register LHS, RHS;
+  mi_match(Dst, MRI, m_GICmp(m_Pred(Pred), m_Reg(LHS), m_Reg(RHS)));
+  if (!ICmpInst::isEquality(Pred))
----------------
tschuett wrote:
> arsenm wrote:
> > Can you really get away without checking the mi_match result?
> There is no `[[nodiscard]]` on `mi_match`?
I didn't get a warning, but maybe other compilers would warn?

(I should add an assert that `MI` is a G_ICMP at the top though)


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

https://reviews.llvm.org/D135380



More information about the llvm-commits mailing list