Pass through of target features to llvm-bitcode-linker and handling them
The .ptx version produced by llc can be specified by passing it with --mattr. Currently it is not possible to specify the .ptx version with -Ctarget-feature because these are not passed through to llvm-bitcode-linker and handled by it. This commit adds both. --target-feature and -mattr are passed with equals to mitigate issues when the value starts with a - (minus).
This commit is contained in:
parent
2445dd794e
commit
831d9f39e9
3 changed files with 23 additions and 2 deletions
|
@ -2518,6 +2518,12 @@ fn add_order_independent_options(
|
|||
"--target-cpu",
|
||||
&codegen_results.crate_info.target_cpu,
|
||||
]);
|
||||
if codegen_results.crate_info.target_features.len() > 0 {
|
||||
cmd.link_arg(&format!(
|
||||
"--target-feature={}",
|
||||
&codegen_results.crate_info.target_features.join(",")
|
||||
));
|
||||
}
|
||||
} else if flavor == LinkerFlavor::Ptx {
|
||||
cmd.link_args(&["--fallback-arch", &codegen_results.crate_info.target_cpu]);
|
||||
} else if flavor == LinkerFlavor::Bpf {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue