Skip to content

[spirv-to-ir-wrapper] Prevent non-IR from being passed along #5688

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

Merged
merged 5 commits into from
Mar 10, 2022

Conversation

mdtoguchi
Copy link
Contributor

@mdtoguchi mdtoguchi commented Feb 28, 2022

Introduce an option -skip-unknown-input which can be used to prevent unknown
files from being passed through the tool. There are usage models involving
archives in which the 'fat archives' do not contain all fat objects. In
the case where this occurs, provide a way to prevent the non-IR object
from the device side to be passed through as it is not valid at the
device link step.

Introduce an option -skip-non-llvmir which can be used to prevent non-IR
files from being passed through the tool.  There are usage models involving
archives in which the 'fat archives' do not contain all fat objects.  In
the case where this occurs, provide a way to prevent the non-IR object
from the device side to be passed thorugh as it is not valid at the
device link step.
@mdtoguchi mdtoguchi requested a review from a team as a code owner February 28, 2022 21:50
@@ -46,6 +47,11 @@ static cl::opt<std::string>
LlvmSpirvOpts("llvm-spirv-opts", cl::value_desc("llvm-spirv options"),
cl::desc("options to pass to llvm-spirv"));

// SkipNonLLVMIR - Skip non-LLVM-IR files (create empty output instead)
static cl::opt<bool>
SkipNonLLVMIR("skip-non-llvmir",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be not important, but at first when I read 'skip-non-llvmir' name I thought that this option turns off processing of non-IR files leaving them as is. However, those files are cleared.
I suppose that it may be not simple to make short and clear name for this option. What do you think about 'clear-non-llvmir'?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tool always creates an output file, it does not modify inputs in any scenario. Therefore, an option skip-something which creates an empty output file seems to be correct.

However, I'm more concerned about non-llvmir part of it, because SPIR-V is not an LLVM IR, but it is still being handled even when the option is present. Would it be better to name it like do-not-copy-unknown-inputs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about -skip-unknown-inputs?

@mdtoguchi
Copy link
Contributor Author

The SYCL / Linux / OCL GEN9 LLVM Test Suite failures shouldn't be related - my changes introduce an option which should be a no-op in testing.

@bader bader merged commit 45ab7c9 into intel:sycl Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants