-
Notifications
You must be signed in to change notification settings - Fork 755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Driver][SYCL] warning emitted when compiling wrapped object #16397
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10344,9 +10344,16 @@ void OffloadWrapper::ConstructJob(Compilation &C, const JobAction &JA, | |
|
||
if (WrapperCompileEnabled) { | ||
// TODO Use TC.SelectTool(). | ||
// Pass -Wno-override-module to the compilation to restrict the warning | ||
// that is emitted due to the target in the generated IR from the wrapping | ||
// step. | ||
ArgStringList ClangArgs{ | ||
TCArgs.MakeArgString("--target=" + TC.getAuxTriple()->str()), "-c", | ||
"-o", Output.getFilename(), WrapperFileName}; | ||
TCArgs.MakeArgString("--target=" + TC.getAuxTriple()->str()), | ||
"-Wno-override-module", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can a test be added to verify that the warning no longer occurs? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will require a non-driver LIT test to verify (some kind of E2E test that allows for full compilation). OK to add later? |
||
"-c", | ||
"-o", | ||
Output.getFilename(), | ||
WrapperFileName}; | ||
llvm::Reloc::Model RelocationModel; | ||
unsigned PICLevel; | ||
bool IsPIE; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate this sentence?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
clang-offload-wrapper
will wrap the device object in an IR file that needs to be compiled. The-host
setting sets up the target triple. I did some additional experimentation and I believe we may be able to fix this by providing a more complete-host
value.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you clarify which
-host
setting is being referred here?Also, the example warning mentioned in the description (x86_64-pc-windows-msvc) specifies a windows target triple.
Will this change based on the
--target
value?Can a test be added to verify if the warning is not thrown when
-Wno-override-module
is passed?Lastly, why do we need to suppress this warning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm referring to the
-host
option that is used during theclang-offload-wrapper
call. This information is used when generating the IR for the wrapped binary. Having the-host
value for theclang-offload-wrapper
call match the--target
value for theclang
call should prevent the diagnostic from being emitted.The changes I am working on shouldn't require the
-Wno-override-module
option anymore.As for a test, a driver specific test probably isn't ideal here, as the warning is only emitted during the device linking stage. What is interesting here, is that the diagnostic is emitted from an internal call to 'clang' and there is no way to disable it.