This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Add an additional test for D34888
ClosedPublic

Authored by gtbercea on Sep 19 2017, 8:51 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

gtbercea created this revision.Sep 19 2017, 8:51 AM
tra added a subscriber: tra.Sep 19 2017, 10:31 AM

LGTM in general.

test/OpenMP/target_map_codegen.cpp
4845

Please break the line to make it easier to read.

gtbercea updated this revision to Diff 115947.Sep 19 2017, 6:12 PM
tra added inline comments.Sep 20 2017, 9:41 AM
test/OpenMP/target_map_codegen.cpp
4845

Better, but the line still wraps. I'd split it again somewhere between -emit-llvm and -fopenmp.
BTW, you have -fopenmp specified twice. Is that intentional?

Hahnfeld edited edge metadata.Sep 21 2017, 1:46 PM

Hi Doru,

if I remember correctly I submitted D34888 for a crash when mapping a scalar value with nested regions.
I've marked another test in this file that the codegen for tofrom is correct. So I don't know if this test checks some other conditions?

Jonas

test/OpenMP/target_map_codegen.cpp
1773

tofrom is tested here...

Hi Doru,

if I remember correctly I submitted D34888 for a crash when mapping a scalar value with nested regions.
I've marked another test in this file that the codegen for tofrom is correct. So I don't know if this test checks some other conditions?

Jonas

Hi Jonas,

The test is verifying whether the parameter is passed to the kernel correctly. I believe it was not passed as a reference before the patch.

In addition to that, something that was in my previous patch is related to this code:

DSAStack->checkMappableExprComponentListsForDeclAtLevel(
        D, Level, [&](OMPClauseMappableExprCommon::MappableExprComponentListRef

In particular with the Level variable. Should the Level variable actually be Level + 1 in this case?

Thanks,

--Doru

The test is verifying whether the parameter is passed to the kernel correctly. I believe it was not passed as a reference before the patch.

Ah, right: This isn't checked anywhere before. Maybe add a comment about what's tested here?
Do we want to check the rest of the codegen with a focus that the variable is passed as a reference?

In addition to that, something that was in my previous patch is related to this code:

DSAStack->checkMappableExprComponentListsForDeclAtLevel(
        D, Level, [&](OMPClauseMappableExprCommon::MappableExprComponentListRef

In particular with the Level variable. Should the Level variable actually be Level + 1 in this case?

I'm not sure, the current public clang-ykt has Level: https://github.com/clang-ykt/clang/blob/d181aed/lib/Sema/SemaOpenMP.cpp#L1361

The test is verifying whether the parameter is passed to the kernel correctly. I believe it was not passed as a reference before the patch.

Ah, right: This isn't checked anywhere before. Maybe add a comment about what's tested here?
Do we want to check the rest of the codegen with a focus that the variable is passed as a reference?

In addition to that, something that was in my previous patch is related to this code:

DSAStack->checkMappableExprComponentListsForDeclAtLevel(
        D, Level, [&](OMPClauseMappableExprCommon::MappableExprComponentListRef

In particular with the Level variable. Should the Level variable actually be Level + 1 in this case?

I'm not sure, the current public clang-ykt has Level: https://github.com/clang-ykt/clang/blob/d181aed/lib/Sema/SemaOpenMP.cpp#L1361

You're right!

gtbercea updated this revision to Diff 116664.Sep 26 2017, 7:30 AM

Fix test.

This revision is now accepted and ready to land.Sep 26 2017, 7:48 AM
gtbercea closed this revision.Sep 26 2017, 7:58 AM
This revision is now accepted and ready to land.Sep 26 2017, 8:26 AM
gtbercea updated this revision to Diff 116671.Sep 26 2017, 8:45 AM

Add nocudalib flag.

gtbercea closed this revision.Sep 26 2017, 11:13 AM
Harbormaster completed remote builds in B10599: Diff 116671.
This revision is now accepted and ready to land.Sep 26 2017, 5:58 PM
gtbercea updated this revision to Diff 116747.Sep 26 2017, 6:58 PM

Fix test.

gtbercea closed this revision.Sep 27 2017, 7:32 AM