[Mlir-commits] [mlir] [mlir][spirv] Split codegen for float min/max reductions and others (NFC) (PR #69023)

Daniil Dudkin llvmlistbot at llvm.org
Mon Nov 6 07:39:08 PST 2023


unterumarmung wrote:

@kuhar, I apologize for disappearing for such a long time. I've tried to rewrite this by extracting just one function, but, frankly speaking, it does not make much sense to me. The reason is that we have template parameters in the class, and the `reduceExtracted` part depends on them. We could split the class to handle only specific pairs of Min and Max operations, but we still have the Mul and Add operations to consider, and we would have to include them for each such pair of Min and Max, which seems excessive. I believe this is why I've unconsciously chosen to refactor this code using CRTP in the first place. It appears there are only two options to solve the problem: either we proceed with the CRTP refactoring as demonstrated here, or we do not refactor at all and use the approach in #69053, which seems quite neat, in my honest opinion.

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


More information about the Mlir-commits mailing list