This is an archive of the discontinued LLVM Phabricator instance.

The device expression must evaluate to a non-negative integer value.
ClosedPublic

Authored by Harshil-Jani on Feb 7 2022, 7:14 AM.

Details

Summary

Device clause when it occurs with target enter data and target exit data must be declared with some non negative value. So some changes were made to evaluate the device clause argument to non negative value and throw the expected error when it takes negative value as argument.

Diff Detail

Event Timeline

Harshil-Jani requested review of this revision.Feb 7 2022, 7:14 AM
Harshil-Jani created this revision.
clementval requested changes to this revision.Feb 7 2022, 7:39 AM
clementval added inline comments.
flang/lib/Semantics/check-omp-structure.cpp
39

Please use RequiresPositiveParameter. It does the same check.

This revision now requires changes to proceed.Feb 7 2022, 7:39 AM
clementval added inline comments.Feb 7 2022, 7:41 AM
flang/lib/Semantics/check-omp-structure.cpp
39

If you want to accept 0 as well it probably better to add an argument to the current check

clementval added inline comments.Feb 8 2022, 4:37 AM
flang/lib/Semantics/check-directive-structure.h
553

The diff looks odd. Looks like you just uploaded the change over your previous patch. You should squash your commits so we can see the change compare to the current main.

The precheck is still failing. Please have a look why the patch application fails.

flang/lib/Semantics/check-directive-structure.h
557

Since you want to accept 0 please add a valid test with 0 so that we will catch any change in the future.

llvm/lib/Support/FormatVariadic.cpp
21 ↗(On Diff #406775)

Unrelated change. Please remove.

Can you add a valid test for 0?

clementval accepted this revision.Feb 12 2022, 3:17 AM

LGTM. Just move the valid test into the correct file.

flang/test/Semantics/omp-device-constructs.f90
144
This revision is now accepted and ready to land.Feb 12 2022, 3:17 AM
Harshil-Jani marked 2 inline comments as done.
clementval accepted this revision.Feb 14 2022, 1:03 AM

Still LGTM.

Herald added a project: Restricted Project. · View Herald TranscriptMar 13 2022, 6:15 AM
NimishMishra closed this revision.Mar 13 2022, 6:15 AM