Skip to content

Commit 0497291

Browse files
authored
[SPV_INTEL_bindless_images] Add ret type to convert-SampledImage builtin name (#2576)
Similar as ConvertHandleToImageINTEL, ConvertHandleToSampledImageINTEL builtin may have the same argument type but different return types. So we need to add ret type as name suffix when translating to LLVM IR.
1 parent 5e8c5df commit 0497291

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/SPIRV/SPIRVReader.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3388,6 +3388,7 @@ Instruction *SPIRVToLLVM::transSPIRVBuiltinFromInst(SPIRVInstruction *BI,
33883388
case internal::OpCooperativeMatrixLoadCheckedINTEL:
33893389
case internal::OpTaskSequenceCreateINTEL:
33903390
case internal::OpConvertHandleToImageINTEL:
3391+
case internal::OpConvertHandleToSampledImageINTEL:
33913392
AddRetTypePostfix = true;
33923393
break;
33933394
default: {

test/extensions/INTEL/SPV_INTEL_bindless_images/bindless_images_generic.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ target triple = "spir64-unknown-unknown"
3030

3131
; CHECK-LLVM: call spir_func target("spirv.Image", i64, 2, 0, 0, 0, 0, 0, 0) @_Z76__spirv_ConvertHandleToImageINTEL_RPU3AS133__spirv_Image__long_2_0_0_0_0_0_0m(i64 %{{.*}})
3232
; CHECK-LLVM: call spir_func target("spirv.Sampler") @_Z35__spirv_ConvertHandleToSamplerINTELm(i64 42)
33-
; CHECK-LLVM: call spir_func target("spirv.SampledImage", i64, 1, 0, 0, 0, 0, 0, 0) @_Z40__spirv_ConvertHandleToSampledImageINTELm(i64 43)
33+
; CHECK-LLVM: call spir_func target("spirv.SampledImage", i64, 1, 0, 0, 0, 0, 0, 0) @_Z90__spirv_ConvertHandleToSampledImageINTEL_RPU3AS140__spirv_SampledImage__long_1_0_0_0_0_0_0m(i64 43)
3434

3535
define spir_func void @foo(i64 %in) {
3636
%img = call spir_func target("spirv.Image", i64, 2, 0, 0, 0, 0, 0, 0) @_Z33__spirv_ConvertHandleToImageINTELl(i64 %in)

0 commit comments

Comments
 (0)