-
Notifications
You must be signed in to change notification settings - Fork 787
[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
Conversation
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.
@@ -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", |
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.
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'?
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 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
?
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.
How about -skip-unknown-inputs
?
The |
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.