[llvm] [InstCombine] Fold binary op of reductions. (PR #121567)
Mikhail Gudim via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 8 14:35:05 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:
> You could also fold or disjoint with vector_reduce_add
what would be the benefit of doing this?
https://github.com/llvm/llvm-project/pull/121567
More information about the llvm-commits
mailing list