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

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Tue Dec 19 03:06:31 PST 2023


tblah 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.

Ahh you are quite right. Apologies for the confusion. Please wait for Jean or Slava to take a look before merging.

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


More information about the flang-commits mailing list