Index: lib/Target/AMDGPU/AMDKernelCodeT.h =================================================================== --- lib/Target/AMDGPU/AMDKernelCodeT.h +++ lib/Target/AMDGPU/AMDKernelCodeT.h @@ -551,14 +551,8 @@ int64_t kernel_code_prefetch_byte_offset; uint64_t kernel_code_prefetch_byte_size; - /// Number of bytes of scratch backing memory required for full - /// occupancy of target chip. This takes into account the number of - /// bytes of scratch per work-item, the wavefront size, the maximum - /// number of wavefronts per CU, and the number of CUs. This is an - /// upper limit on scratch. If the grid being dispatched is small it - /// may only need less than this. If the kernel uses no scratch, or - /// the Finalizer has not computed this value, it must be 0. - uint64_t max_scratch_backing_memory_byte_size; + /// Reserved. Must be 0. + uint64_t reserved0; /// Shader program settings for CS. Contains COMPUTE_PGM_RSRC1 and /// COMPUTE_PGM_RSRC2 registers. Index: lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp =================================================================== --- lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp +++ lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp @@ -2608,6 +2608,13 @@ bool AMDGPUAsmParser::ParseAMDKernelCodeTValue(StringRef ID, amd_kernel_code_t &Header) { + // max_scratch_backing_memory_byte_size is deprecated. Ignore it while parsing + // assembly for backwards compatibility. + if (ID == "max_scratch_backing_memory_byte_size") { + Parser.eatToEndOfStatement(); + return false; + } + SmallString<40> ErrStr; raw_svector_ostream Err(ErrStr); if (!parseAmdKernelCodeField(ID, getParser(), Header, Err)) { Index: lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp =================================================================== --- lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp +++ lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp @@ -423,7 +423,7 @@ memset(&Header, 0, sizeof(Header)); Header.amd_kernel_code_version_major = 1; - Header.amd_kernel_code_version_minor = 1; + Header.amd_kernel_code_version_minor = 2; Header.amd_machine_kind = 1; // AMD_MACHINE_KIND_AMDGPU Header.amd_machine_version_major = ISA.Major; Header.amd_machine_version_minor = ISA.Minor; Index: lib/Target/AMDGPU/Utils/AMDKernelCodeTInfo.h =================================================================== --- lib/Target/AMDGPU/Utils/AMDKernelCodeTInfo.h +++ lib/Target/AMDGPU/Utils/AMDKernelCodeTInfo.h @@ -73,7 +73,6 @@ FIELD(kernel_code_entry_byte_offset), FIELD(kernel_code_prefetch_byte_size), -FIELD(max_scratch_backing_memory_byte_size), COMPPGM1(granulated_workitem_vgpr_count, compute_pgm_rsrc1_vgprs, VGPRS), COMPPGM1(granulated_wavefront_sgpr_count, compute_pgm_rsrc1_sgprs, SGPRS), Index: test/MC/AMDGPU/hsa-exp.s =================================================================== --- test/MC/AMDGPU/hsa-exp.s +++ test/MC/AMDGPU/hsa-exp.s @@ -65,14 +65,13 @@ // ASM-LABEL: {{^}}amd_kernel_code_t_minimal: // ASM: .amd_kernel_code_t // ASM: amd_code_version_major = 7 -// ASM: amd_code_version_minor = 1 +// ASM: amd_code_version_minor = 2 // ASM: amd_machine_kind = 1 // ASM: amd_machine_version_major = 7 // ASM: amd_machine_version_minor = 0 // ASM: amd_machine_version_stepping = 0 // ASM: kernel_code_entry_byte_offset = 256 // ASM: kernel_code_prefetch_byte_size = 0 -// ASM: max_scratch_backing_memory_byte_size = 0 // ASM: granulated_workitem_vgpr_count = 1 // ASM: granulated_wavefront_sgpr_count = 1 // ASM: priority = 0 Index: test/MC/AMDGPU/hsa.s =================================================================== --- test/MC/AMDGPU/hsa.s +++ test/MC/AMDGPU/hsa.s @@ -135,7 +135,6 @@ // ASM: amd_machine_version_stepping = 5 // ASM: kernel_code_entry_byte_offset = 512 // ASM: kernel_code_prefetch_byte_size = 1 -// ASM: max_scratch_backing_memory_byte_size = 1 // ASM: granulated_workitem_vgpr_count = 1 // ASM: granulated_wavefront_sgpr_count = 1 // ASM: priority = 1 @@ -212,14 +211,13 @@ // ASM-LABEL: {{^}}amd_kernel_code_t_minimal: // ASM: .amd_kernel_code_t // ASM: amd_code_version_major = 1 -// ASM: amd_code_version_minor = 1 +// ASM: amd_code_version_minor = 2 // ASM: amd_machine_kind = 1 // ASM: amd_machine_version_major = 7 // ASM: amd_machine_version_minor = 0 // ASM: amd_machine_version_stepping = 0 // ASM: kernel_code_entry_byte_offset = 256 // ASM: kernel_code_prefetch_byte_size = 0 -// ASM: max_scratch_backing_memory_byte_size = 0 // ASM: granulated_workitem_vgpr_count = 1 // ASM: granulated_wavefront_sgpr_count = 1 // ASM: priority = 0