[PATCH] D126040: [InstCombine] Fold a mul with bool value into and

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 20 00:38:55 PDT 2022


xbolva00 added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp:312
+        match(Op1, m_And(m_Value(Y), m_One())))
+      return BinaryOperator::CreateAnd(Op0, Op1);
+  }
----------------
grandinj wrote:
> Surely the more general case is something like:
> 
>     if (ComputeMaxSignificantBits(Op0) ==1 ||
>         ComputeMaxSignificantBits(Op1)==1)
> 
> ?
> 
Yeah, please more general case.


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

https://reviews.llvm.org/D126040



More information about the llvm-commits mailing list