[llvm] [InstCombine] Add ctpop(A | B) + ctpop(A & B) -> ctpop(A) + ctpop(B) (PR #79089)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 22 20:03:03 PST 2024


================
@@ -1718,6 +1718,25 @@ Instruction *InstCombinerImpl::visitAdd(BinaryOperator &I) {
         Builder.CreateIntrinsic(Intrinsic::umax, {I.getType()}, {A, B}));
   }
 
+  // ctpop(A | B) + ctpop(A & B) -> ctpop(A) + ctpop(B)
----------------
dtcxzyw wrote:

https://alive2.llvm.org/ce/z/NmOVOO

https://github.com/llvm/llvm-project/pull/79089


More information about the llvm-commits mailing list