-
Notifications
You must be signed in to change notification settings - Fork 800
[Driver][SYCL] Compile source file for integration header generation #20818
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
base: sycl
Are you sure you want to change the base?
Conversation
When compiler for preprocessing only, the preprocessing step that occurs does not generate the integration header/footer information that is used during the host compilation step. To generate the integration information in this case, the driver inserts an additional compilation step that creates the files to be consumed at the host step. The compilation step to produce the integration information is using the generated preprocessed file. For cases where there are build warnings that are emitted during this step, use of -Werror will cause the compilation to fail. These diagnostics are typically suppressed when not performing preprocess only compilations, but due to the fact that the build step against the preprocessed file does not know to suppress the diagnostics from system headers, compilation behaviors are at a disconnect. To fix this, the behavior when creating a preprocessed file (i.e. when we are using -E and stopping compilation), the driver will now compile the original source file instead of the preprocessed file.
|
@intel/dpcpp-clang-driver-reviewers, please take a look |
clang/lib/Driver/Driver.cpp
Outdated
| A->setCannotBeCollapsedWithNextDependentAction(); | ||
| Action *CompileAction = | ||
| C.MakeAction<CompileJobAction>(A, types::TY_Nothing); | ||
| // The input to the preprocessed job is the compilation job. |
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.
Typically, the preprocessed code is input to the compiler.
The input to the preprocessed job is the compilation job
Can you elaborate what this line means?
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.
Oh, that's backwards. I'll update the comment.
Just to confirm I understood correctly, |
yes, the new compilation step is the device compilation step. There isn't really a new compilation step being introduced, it has always been there when doing preprocessing only. The difference is just the input file being the source file instead of the preprocessed file. |
Can you share why compilation against the preprocessed file does not have the context to suppress these diagnostics from the system headers? |
When compiler for preprocessing only, the preprocessing step that occurs does not generate the integration header/footer information that is used during the host compilation step. To generate the integration information in this case, the driver inserts an additional compilation step that creates the files to be consumed at the host step.
The compilation step to produce the integration information is using the generated preprocessed file. For cases where there are build warnings that are emitted during this step, use of -Werror will cause the compilation to fail. These diagnostics are typically suppressed when not performing preprocess only compilations, but due to the fact that the build step against the preprocessed file does not know to suppress the diagnostics from system headers, compilation behaviors are at a disconnect.
To fix this, the behavior when creating a preprocessed file (i.e. when we are using -E and stopping compilation), the driver will now compile the original source file instead of the preprocessed file.