[PATCH] D157312: [InstCombine] Add transforms for `(or/and (icmp eq/ne X,0),(icmp eq/ne X,Pow2OrZero))`

Allen zhong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 24 07:25:25 PDT 2023


Allen added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:764
+  // RHS: (icmp eq/ne X, Pow2OrZero)
+  if (!match(LHS, m_ICmp(Pred, m_Value(Op), m_Zero())) ||
+      !match(RHS, m_c_ICmp(Pred, m_Specific(Op), m_Value(Pow2))) ||
----------------
LHS and RHS are commutative . Do we need to consider it? 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157312



More information about the llvm-commits mailing list