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

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 29 11:30:47 PST 2021


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:2625
 
+  // or (mul X, CV), X --> mul X, CV+1
+  if (match(&I,
----------------



================
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))
----------------
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.


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

https://reviews.llvm.org/D114729



More information about the llvm-commits mailing list