[PATCH] D114729: [InstCombine] try to fold 'or' into 'mul' operand

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 29 12:14:57 PST 2021


spatel marked 2 inline comments as done.
spatel added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:2627
+  if (match(&I,
+            m_c_Or(m_OneUse(m_Mul(m_Value(X), m_APInt(CV))), m_Deferred(X))))
+    if (haveNoCommonBitsSet(Op0, Op1, DL))
----------------
lebedev.ri wrote:
> Why APInt? This should probably be ImmConstant,
> though i would think that if mul is one-use, reducing use count on X may be worthwhile still.
Yes, reducing uses of X does look better. And the 'add' version of this does that already, so it will be symmetric.


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

https://reviews.llvm.org/D114729



More information about the llvm-commits mailing list