[llvm] [InstCombine] Fold binary op of reductions. (PR #121567)

Mikhail Gudim via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 8 14:13:24 PST 2025


================
@@ -2313,6 +2313,62 @@ Instruction *InstCombinerImpl::foldVectorBinop(BinaryOperator &Inst) {
   return nullptr;
 }
 
+static Intrinsic::ID getReductionForBinop(Instruction::BinaryOps Opc) {
+  switch (Opc) {
+  default:
+    break;
+  case Instruction::Add:
----------------
mgudim wrote:

I think `or disjoint` should get canonicalized first to add.

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


More information about the llvm-commits mailing list