@@ -8608,7 +8608,11 @@ void SPIRVTranslator::ConstructJob(Compilation &C, const JobAction &JA,
8608
8608
TranslatorArgs.push_back (Output.getFilename ());
8609
8609
if (getToolChain ().getTriple ().isSYCLDeviceEnvironment ()) {
8610
8610
TranslatorArgs.push_back (" -spirv-max-version=1.3" );
8611
- TranslatorArgs.push_back (" -spirv-debug-info-version=ocl-100" );
8611
+ // TODO: align debug info for FPGA H/W when its SPIR-V consumer is ready
8612
+ if (C.getDriver ().isFPGAEmulationMode ())
8613
+ TranslatorArgs.push_back (" -spirv-debug-info-version=ocl-100" );
8614
+ else
8615
+ TranslatorArgs.push_back (" -spirv-debug-info-version=legacy" );
8612
8616
// Prevent crash in the translator if input IR contains DIExpression
8613
8617
// operations which don't have mapping to OpenCL.DebugInfo.100 spec.
8614
8618
TranslatorArgs.push_back (" -spirv-allow-extra-diexpressions" );
@@ -8639,23 +8643,14 @@ void SPIRVTranslator::ConstructJob(Compilation &C, const JobAction &JA,
8639
8643
" ,+SPV_INTEL_long_constant_composite"
8640
8644
" ,+SPV_INTEL_fpga_invocation_pipelining_attributes" ;
8641
8645
ExtArg = ExtArg + DefaultExtArg + INTELExtArg;
8642
- if (getToolChain ().getTriple ().getSubArch () ==
8643
- llvm::Triple::SPIRSubArch_fpga) {
8644
- for (auto *A : TCArgs) {
8645
- if (A->getOption ().matches (options::OPT_Xs_separate) ||
8646
- A->getOption ().matches (options::OPT_Xs)) {
8647
- StringRef ArgString (A->getValue ());
8648
- // Enable SPV_INTEL_usm_storage_classes only for FPGA hardware,
8649
- // since it adds new storage classes that represent global_device and
8650
- // global_host address spaces, which are not supported for all
8651
- // targets. With the extension disabled the storage classes will be
8652
- // lowered to CrossWorkgroup storage class that is mapped to just
8653
- // global address space.
8654
- if (ArgString == " hardware" || ArgString == " simulation" )
8655
- ExtArg += " ,+SPV_INTEL_usm_storage_classes" ;
8656
- }
8657
- }
8658
- }
8646
+ if (!C.getDriver ().isFPGAEmulationMode ())
8647
+ // Enable SPV_INTEL_usm_storage_classes only for FPGA hardware,
8648
+ // since it adds new storage classes that represent global_device and
8649
+ // global_host address spaces, which are not supported for all
8650
+ // targets. With the extension disabled the storage classes will be
8651
+ // lowered to CrossWorkgroup storage class that is mapped to just
8652
+ // global address space.
8653
+ ExtArg += " ,+SPV_INTEL_usm_storage_classes" ;
8659
8654
TranslatorArgs.push_back (TCArgs.MakeArgString (ExtArg));
8660
8655
}
8661
8656
for (auto I : Inputs) {
0 commit comments