@@ -10706,38 +10706,21 @@ static void getSPIRVBackendOpts(const llvm::opt::ArgList &TCArgs,
1070610706 ArgStringList &BackendArgs) {
1070710707 BackendArgs.push_back (TCArgs.MakeArgString (" -filetype=obj" ));
1070810708 BackendArgs.push_back (
10709- TCArgs.MakeArgString (" -mtriple=spirv64-unknown-unknown" ));
10710- // TODO: Optimization level is currently forced to -O0 due to some testing
10711- // issues. Update optimization level after testing issues are resolved.
10712- BackendArgs.push_back (TCArgs.MakeArgString (" -O0" ));
10709+ TCArgs.MakeArgString (" -mtriple=spirv64v1.6-unknown-unknown" ));
1071310710 BackendArgs.push_back (
1071410711 TCArgs.MakeArgString (" --avoid-spirv-capabilities=Shader" ));
1071510712 BackendArgs.push_back (
1071610713 TCArgs.MakeArgString (" --translator-compatibility-mode" ));
10717-
10718- // TODO: There is some overlap between the lists of extensions in SPIR-V
10719- // backend and SPIR-V Trnaslator). We will try to combine them when SPIR-V
10720- // backdn is ready.
10721- std::string ExtArg (" --spirv-ext=" );
10722- std::string DefaultExtArg =
10723- " +SPV_EXT_shader_atomic_float_add,+SPV_EXT_shader_atomic_float_min_max"
10724- " ,+SPV_KHR_no_integer_wrap_decoration,+SPV_KHR_float_controls"
10725- " ,+SPV_KHR_expect_assume,+SPV_KHR_linkonce_odr" ;
10726- std::string INTELExtArg = " ,+SPV_INTEL_subgroups,+SPV_INTEL_function_pointers"
10727- " ,+SPV_INTEL_arbitrary_precision_integers"
10728- " ,+SPV_INTEL_variable_length_array" ;
10729- ExtArg = ExtArg + DefaultExtArg + INTELExtArg;
10730-
10731- // Other args
10732- ExtArg += " ,+SPV_INTEL_bfloat16_conversion"
10733- " ,+SPV_KHR_uniform_group_instructions"
10734- " ,+SPV_INTEL_optnone"
10735- " ,+SPV_KHR_subgroup_rotate"
10736- " ,+SPV_INTEL_usm_storage_classes"
10737- " ,+SPV_EXT_shader_atomic_float16_add"
10738- " ,+SPV_KHR_bit_instructions" ;
10739-
10740- BackendArgs.push_back (TCArgs.MakeArgString (ExtArg));
10714+ // TODO: A list of SPIR-V extensions that are supported by the SPIR-V backend
10715+ // is growing. Let's postpone the decision on which extensions to enable until
10716+ // - the list is stable, and
10717+ // - we decide on a mapping of user requested extensions into backend's ones.
10718+ // Meanwhile we enable all the SPIR-V backend extensions.
10719+ BackendArgs.push_back (TCArgs.MakeArgString (" --spirv-ext=all" ));
10720+ // TODO:
10721+ // - handle -Xspirv-translator option to avoid "argument unused during
10722+ // compilation" error
10723+ // - handle --spirv-ext=+<extension> and --spirv-ext=-<extension> options
1074110724}
1074210725
1074310726// Utility function to gather all llvm-spirv options.
0 commit comments