[Flang][OpenMP] Add support for logical and reduction in worksharing-loop
authorDylan Fleming <Dylan.Fleming@arm.com>
Fri, 9 Sep 2022 17:18:27 +0000 (17:18 +0000)
committerDylan Fleming <Dylan.Fleming@arm.com>
Fri, 9 Sep 2022 17:29:49 +0000 (17:29 +0000)
commitddc0465369a373f2022283905fdc7677eeaf9525
treeaf9bf089d5f6f551c43b64bfa9e6cc74084a9047
parent5e0464e38bcb63186e5c5eaafe550e92143cab43
[Flang][OpenMP] Add support for logical and reduction in worksharing-loop

Adds support for .and. reductions with logical types.

Because arith.addi doesn'to work with fir.logical<4> types
logical<4> must be converted to i1 prior to the operation.

This means that the pattern matched by integer reductions
(load -> op -> store) will not match logical reductions.
Instead, the pattern being searched for here is
load -> convert(logical<4> to i1) -> op -> convert(i1 to logical<4>) -> store

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D132228
flang/include/flang/Lower/OpenMP.h
flang/lib/Lower/OpenMP.cpp
flang/test/Lower/OpenMP/Todo/reduction-and.f90 [deleted file]
flang/test/Lower/OpenMP/wsloop-reduction-logical-and.f90 [new file with mode: 0644]