[flang-commits] [flang] [Flang] Generate inline reduction loops for elemental count intrinsics (PR #75774)

David Green via flang-commits flang-commits at lists.llvm.org
Mon Dec 18 05:47:54 PST 2023


davemgreen wrote:

> This looks good, but I agree with @jeanPerier that this would be better done with another hlfir.elemental and then however many elementals can be inlined together in the elemental inlining pass. But if there are good reasons why that would not be possible, this current implementation is good.

Hi. Could you explain more about what those elementals would look like? As far as I understood elementals acted on each element in a shape (a map step), where as these operations (count, any, all), would be reductions to a scalar.

So the idea is that we already optimize any elementals together, then perform a reduction to a scalar with the code in this patch. Let me know if you think it should work differently.

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


More information about the flang-commits mailing list