This is an archive of the discontinued LLVM Phabricator instance.

[Clang][OpenMP] Fix handling of -mcode-object-version for OpenMP
AbandonedPublic

Authored by saiislam on Jan 18 2023, 7:29 AM.

Details

Summary

Code object version flag for AMDGPU was not being honored by the
driver. It was required to be passed as derived arg so that correct
bitcode library can be linked.

Diff Detail

Event Timeline

saiislam created this revision.Jan 18 2023, 7:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 18 2023, 7:29 AM
saiislam requested review of this revision.Jan 18 2023, 7:29 AM
Herald added a project: Restricted Project. · View Herald Transcript
yaxunl added inline comments.Jan 18 2023, 8:21 AM
clang/lib/Driver/ToolChains/Clang.cpp
7116

why do you need to change Args to C.getArgs() ?

saiislam updated this revision to Diff 490204.Jan 18 2023, 9:38 AM

Removed the unnecessary call to getArgs() and added test cases.

saiislam marked an inline comment as done.Jan 18 2023, 9:39 AM
saiislam added inline comments.
clang/lib/Driver/ToolChains/Clang.cpp
7116

You are right. Don't need it. Removed.

Is this patch really necessary? -mcode-object-version= option does not go through any translation in derived args. If it is in derived args, it should also be in the original args. HIPAMD toolchain just uses the original driver args. Why OpenMP toolchain needs to use the derived args?

yaxunl added inline comments.Jun 13 2023, 12:53 PM
clang/lib/Driver/ToolChains/Clang.cpp
8090

should use Args instead of C.getArgs()

saiislam abandoned this revision.Aug 4 2023, 11:43 AM
saiislam marked an inline comment as done.