-
Notifications
You must be signed in to change notification settings - Fork 770
[SYCL] Fix debug info generation when integration footer is present #6774
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
Conversation
Signed-off-by: Zahira Ammarguellat <zahira.ammarguellat@intel.com>
Signed-off-by: Zahira Ammarguellat <zahira.ammarguellat@intel.com>
/verify with intel/llvm-test-suite#1264 |
Signed-off-by: Zahira Ammarguellat <zahira.ammarguellat@intel.com>
Signed-off-by: Zahira Ammarguellat <zahira.ammarguellat@intel.com>
Signed-off-by: Zahira Ammarguellat <zahira.ammarguellat@intel.com>
FYI, I did some debug info testing with the current change set. It does resolve the originally reported issue with breakpoints on Windows and also removes any references to the temporary file. I did not encounter any negative impact from the change set. |
@stevemerr thanks for taking the time! |
Not really sure what the issue is with CUDA testing. It's failing after 1mn with this error: |
@intel/dpcpp-cfe-reviewers Can you please review the patch? Thanks. |
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 not familiar with this at all. @premanandrao can you please take a look?
Signed-off-by: Zahira Ammarguellat <zahira.ammarguellat@intel.com>
Signed-off-by: Zahira Ammarguellat <zahira.ammarguellat@intel.com>
|
||
if (IsSYCL || Args.hasArg(options::OPT_fsycl_footer_path_EQ)) { |
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.
Is the IsSYCL check needed here?
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.
Not sure. Does Args.hasArg(options::OPT_fsycl_footer_path_EQ) == true implies IsSYCL?
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 talked to Mike Rice and it looks like OpenMP doesn't use footers. So I can presumably just check for the option and not test for IsSycl.
Signed-off-by: Zahira Ammarguellat <zahira.ammarguellat@intel.com>
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.
LGTM
Just heard from @stevemerr that the additional specific debugger testing passed with this patch. Thanks Steve! |
Could you please take a look at failing test? |
sycl-intelfpga-return-check and debug-info-srcspos-kernel.cpp. Both are using the -fsycl-is-device and -fsycl-device-only repectively. When these options are used isSYCL returns false. So it's needed in the condition, in order to set the option "full-main-file-name". Signed-off-by: Zahira Ammarguellat <zahira.ammarguellat@intel.com>
|
@premanandrao , @Fznamznon at your convenience can you please review this? Thanks. |
Thanks for the explanation. |
@intel/llvm-gatekeepers PR is ready for review and merge. Thanks. |
@zahiraam, please follow up on post-commit issue on Windows: https://github.com/intel/llvm/actions/runs/3153782586
|
@pvchupin I tried to reproduce the issue locally. Although the test is failing, I don't get the same fail. The one I get is the same than the one we get for CodeGen/debug-info-file-checksum.c on Windows; the checksums are different on windows and Linux because of some environmental line ending issue. That's a known issue and there is some on-going fix for it in community. |
@zahiraam, I'm getting the same crash locally. I'm using MSVC2022 if it helps. |
@zahiraam, here is the backtrace from debug version:
|
Yes I think I understand the issue. The problem is coming from the "append-file" command in the LIT test. The appended file in Linux has this shape: On Windows this is the shape of the appended file: It's using the backward "". The call here https://github.com/intel/llvm/blob/sycl/clang/lib/CodeGen/CGDebugInfo.cpp#L404 is returning for Linux the correct filename and for Windows it's returning something like this: "D:IUSERSzahiraamsycl-bpllvmclang\testCodeGenSYCLInputschecksum.cpp" . The crash happens because this file is bogus and ExpectedFileRef here https://github.com/intel/llvm/blob/sycl/clang/lib/CodeGen/CGDebugInfo.cpp#L385 returns an error. The string filenames are computed here: https://github.com/intel/llvm/blob/sycl/clang/lib/Lex/PPDirectives.cpp#L1434 |
@zahiraam, sounds good to me. Should I revert this change as a whole to give you more time for analysis? Or you have a workaround? Or should we disable the test if the rest of the compiler is not impacted? |
@pvchupin To fix the literal string parser will take some more analysis and time. I want to try a fix in CGDebugInfo.cpp and see if that doesn't break other tests. But I will do that Monday. If you want post-commit to be green today, you can disable the LIT test and I will work on a fix one way or the other. Thanks. |
We have changed the code in #6774, but we did wrong resolution recently.
This patch is to fix two known issues with debugging caused by integration footer presence, without redesigning the integration footer approach.
One issue is the missing checksum for the main file on Windows. This causes the breakpoints not being hit.
The other issue being that the host compilation's DICompileUnit points to the temporary
file created instead of the original source file. So file names and checksums are different for host and compilation.
The changes made to fix the issues are:
Joint work with @AlexeySachkov