-
Notifications
You must be signed in to change notification settings - Fork 798
[SYCL] Fix libspirv invalid path in -### #19784
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
In our downstream repo, bf21b9d exposed a regression that libspirv path is invalid in -### output. Before bf21b9d, the path was correctly found by `searchAt(D.ResourceDir, "..", "..", "clc")`, which was deleted by the commit. Root cause is that in -### mode the process should not early return upon the first candidate, which may do not exist. Instead, it should evaluate all candidates.
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.
NAK.
You're effectively changing that the output of -###
from the first candidate to the last one. I don't see why this would be anymore "correct" than the first.
The special handling of -###
should just be removed and the tests that depend on it fixed (either by adding -ccc-install-dir %/S/Inputs/SYCL/bin
or -fsycl-no-libspirv
as appropriate). I had this in mind when doing the linked PR chain, but didn't get to it in the end.
-###
is not a "testing" option, as it's description notes:
Print (but do not run) the commands to run for this compilation
(clang/include/clang/Driver/Options.td:721)
So it should print the exact same commands that would be run without -###
, which this patch or the original code does not do. If we are going to fix this, lets do it properly.
|
When none of the candidates are valid we should just raise an error, just like normal compilation without |
this is a different issue than you raised before, right? and this issue exists before my PR. |
No, this is the issue I meant by my first comment. Yes, you're correct that the issue is still there before this PR, but I believe it IS the same issue you're setting out to solve in the PR description: "When The root cause of this is that we special case If you really rather not do it, I can prepare a PR, the work mostly comes down to fixing (hopefully) a few clang driver tests. |
Do you mean raise following error?
If the error is reported, then -### won't print anything to the screen. How is that useful for debugging? I see another place that can use invalid path in -### mode: llvm/clang/lib/Driver/ToolChains/ZOS.cpp Lines 312 to 323 in f763de4
|
Current logic of outputting invalid libspirv path when none of the candidates exist does have a small benefit: |
Yes.
What would you be debugging in that case? The original command also raised that error, it also tells the user exactly what's wrong. If you mean that you want to debug something else than why libspirv is missing in a clang setup without libspirv built, then you can either pass
When clang searches for other device libraries like cuda libdevice or ocml for AMDGPU also raise an error, in my opinion ZOS is also probably in the wrong, but I don't know enough context to be sure. @intel/dpcpp-clang-driver-reviewers can you please chime in if special casing |
FTFY: After not finding any of the candidates the compiler pretends that it found it at the last location it would search at, and print that and only that location. Even though |
As you said, I normally using -### for debugging. |
I have nothing to add to this, I have stated my opinion in the comment you're referencing. Let's wait for the driver reviewers opinion on the topic, it is ultimately what matters :) |
In our downstream repo, bf21b9d exposed a regression that libspirv path is invalid in -### output. Before bf21b9d, the path was correctly found by
searchAt(D.ResourceDir, "..", "..", "clc")
, which was deleted by the commit.Root cause is that in -### mode the process should not early return upon the first candidate, which may not exist. Instead, it should evaluate all candidates.