This is an archive of the discontinued LLVM Phabricator instance.

[clang][driver][AIX] Add OpenMP runtime if -fopenmp specified
ClosedPublic

Authored by xingxue on Jan 16 2023, 9:24 AM.

Details

Summary

This patch adds OpenMP runtime to the linker command line if -fopenmp is specifed.

Diff Detail

Event Timeline

xingxue created this revision.Jan 16 2023, 9:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 16 2023, 9:24 AM
xingxue requested review of this revision.Jan 16 2023, 9:24 AM
Herald added a project: Restricted Project. · View Herald Transcript

Needs a test, I think we should add a couple of -fopenmp=foo run lines to clang/test/Driver/aix-ld.c to verify that the correct linker options are produced for each.

xingxue updated this revision to Diff 490167.Jan 18 2023, 8:01 AM

Addressed comments.

  • added test scenarios for option fopenmp in clang/test/Driver/aix-ld.c
daltenty accepted this revision.Jan 19 2023, 8:44 AM

Some minor nits about how we can shorten the test, but otherwise LGTM

clang/test/Driver/aix-ld.c
1027

nit: since the output for these tests are really the same, apart from one line with the library name, we could use two prefixes, a common one and a specific one to avoid repetition:

// RUN:   | FileCheck --check-prefixes=CHECK-FOPENMP,CHECK-FOPENMP-OMP %s

and then the CHECK block can go something like this:

...
// CHECK-FOPENMP-NOT: "-lm"
// CHECK-FOPENMP-OMP:     "-lomp"
// CHECK-FOPENMP-IOMP5:  "-liomp5"
// CHECK-FOPENMP-GOMP:   "-lgomp
// CHECK-FOPENMP:     "-lc"
...
This revision is now accepted and ready to land.Jan 19 2023, 8:44 AM
xingxue added inline comments.Jan 19 2023, 9:31 AM
clang/test/Driver/aix-ld.c
1027

Good suggestion, thanks!

This revision was landed with ongoing or failed builds.Jan 19 2023, 9:47 AM
This revision was automatically updated to reflect the committed changes.
xingxue marked an inline comment as done.