[PATCH] D56214: AggressiveInstCombine: Fold full mul i64 x i64 -> i128

Paweł Bylica via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 2 12:34:00 PST 2019


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


================
Comment at: lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp:255-265
+template <typename LHS>
+inline BinaryOp_match<LHS, specific_intval, Instruction::And>
+m_LowPart(const LHS &L) {
+  return m_And(L, m_SpecificInt(0xffffffff));
+}
+
+template <typename LHS>
----------------
lebedev.ri wrote:
> I don't see why these need to be actual functions, lambdas will do?
Yes, that's true. I was struggling with the matchers at first so I did them by copy&paste. Will fix that, unless this pattern is useful to someone else.


================
Comment at: lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp:312-316
+  if (match(&I, m_c_Or(m_LowPart(m_Value(t0)),
+                       m_Shl(m_c_Add(m_LowPart(m_c_Add(m_HighPart(m_Value(t0a)),
+                                                       m_Value(t1))),
+                                     m_Value(t2)),
+                             m_SpecificInt(32))))) {
----------------
lebedev.ri wrote:
> ```
>   if (match(&I, m_c_Or(m_LowPart(m_Value(t0)),
>                        m_Shl(m_c_Add(m_LowPart(m_c_Add(m_HighPart(m_Deferred(t0)),
>                                                        m_Value(t1))),
>                                      m_Value(t2)),
>                              m_SpecificInt(32))))) {
> ```
That's cool. `m_Deferred` definitely lacks some documentation.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D56214





More information about the llvm-commits mailing list