[PATCH] D136015: [InstCombine] Fold series of instructions into mull

chenglin.bi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 15 06:28:12 PDT 2022


bcl5980 added a comment.

What is the motivation of this change? I feel a little strange to do this in instcombine.
And if we really need to do this, we do need more negative tests.



================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:856
+Value *InstCombinerImpl::SimplifyMull(BinaryOperator &I) {
+  if (!(I.getType()->isIntegerTy() && I.getType()->getIntegerBitWidth() == 64))
+    return nullptr;
----------------
This pattern can work for any types with even bit width I think, not only i64.


================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:864
+  // ResLo = m00 + (addc >> 32);
+  bool IsMulLow = match(&I, m_c_Add(m_Value(M00),
+                                    m_Shl(m_Value(Addc), m_SpecificInt(32)))) &&
----------------
Need one-use here for addc.


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

https://reviews.llvm.org/D136015



More information about the llvm-commits mailing list