This is an archive of the discontinued LLVM Phabricator instance.

Fix diag for read-only target features
ClosedPublic

Authored by yaxunl on Jun 16 2023, 4:55 AM.

Details

Summary

Currently the diag is emitted even when there is no
target feature specified on command line for OpenMP.
This is because the function to initialize feature map
is also used with cached feature string. The fix is to
only diag when the feature map is initialized with
feature strings from command line options.

Diff Detail

Event Timeline

yaxunl created this revision.Jun 16 2023, 4:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 16 2023, 4:55 AM
yaxunl requested review of this revision.Jun 16 2023, 4:55 AM
arsenm added inline comments.Jun 16 2023, 5:11 AM
clang/test/OpenMP/driver-openmp-amdgpu.c
8 ↗(On Diff #532094)

Can you use -verify and expected-no-diagnostics? CHECK-NOT is really fragile

yaxunl added inline comments.Jun 16 2023, 6:35 AM
clang/test/OpenMP/driver-openmp-amdgpu.c
8 ↗(On Diff #532094)

-verify only works with clang -cc1, whereas we want to make sure there is no warning for the whole compilation invoked by clang driver

jdoerfert added inline comments.Jun 16 2023, 11:15 AM
clang/test/OpenMP/driver-openmp-amdgpu.c
8 ↗(On Diff #532094)

let's then check-not for any warning?

jhuber6 added inline comments.Jun 16 2023, 11:31 AM
clang/test/OpenMP/driver-openmp-amdgpu.c
8 ↗(On Diff #532094)

It's probably reasonable that this shouldn't return any random errors so I'm fine with false positives.

yaxunl updated this revision to Diff 532284.Jun 16 2023, 1:46 PM

use -verify in test

jhuber6 accepted this revision.Jun 16 2023, 1:47 PM
This revision is now accepted and ready to land.Jun 16 2023, 1:47 PM
This revision was landed with ongoing or failed builds.Jun 16 2023, 2:49 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 16 2023, 2:49 PM