This is an archive of the discontinued LLVM Phabricator instance.

[Flang][OpenMP] Add support for logical neqv reduction in worksharing-loop
ClosedPublic

Authored by do on Apr 5 2023, 7:53 PM.

Details

Diff Detail

Event Timeline

do created this revision.Apr 5 2023, 7:53 PM
do requested review of this revision.Apr 5 2023, 7:53 PM
kiranchandramohan requested changes to this revision.Apr 6 2023, 4:08 AM

See comment inline.

flang/lib/Lower/OpenMP.cpp
1319

This does not look correct.

If .eqv. uses

Value cmpiOp = builder.create<mlir::arith::CmpIOp>(
    loc, arith::CmpIPredicate::eq, op1I1, op2I1);

then shouldn't .neqv. use

Value cmpiOp = builder.create<mlir::arith::CmpIOp>(
    loc, arith::CmpIPredicate::ne, op1I1, op2I1);

?
Note the different predicate used (eq vs ne).

This revision now requires changes to proceed.Apr 6 2023, 4:08 AM
do updated this revision to Diff 511439.Apr 6 2023, 9:17 AM

addressed comments

do updated this revision to Diff 511695.Apr 7 2023, 7:45 AM
kiranchandramohan accepted this revision.Apr 7 2023, 1:49 PM

LGTM. See Nit comment inline.

flang/test/Lower/OpenMP/wsloop-reduction-logical-neqv.f90
43

Nit: A better initial value for .neqv. tests is .false. here and in the other tests below.

This revision is now accepted and ready to land.Apr 7 2023, 1:49 PM
flang/lib/Lower/OpenMP.cpp