Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport to 14] Add return type for OpReadClockKHR SPIR-V friendly IR #2970

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/SPIRV/SPIRVReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3563,6 +3563,7 @@ Instruction *SPIRVToLLVM::transSPIRVBuiltinFromInst(SPIRVInstruction *BI,
case OpSDotAccSatKHR:
case OpUDotAccSatKHR:
case OpSUDotAccSatKHR:
case OpReadClockKHR:
case internal::OpJointMatrixLoadINTEL:
case OpCooperativeMatrixLoadKHR:
case internal::OpCooperativeMatrixLoadCheckedINTEL:
Expand All @@ -3584,6 +3585,7 @@ Instruction *SPIRVToLLVM::transSPIRVBuiltinFromInst(SPIRVInstruction *BI,
case OpUConvert:
case OpUDotKHR:
case OpUDotAccSatKHR:
case OpReadClockKHR:
IsRetSigned = false;
break;
case OpImageRead:
Expand Down
4 changes: 2 additions & 2 deletions test/extensions/KHR/SPV_KHR_shader_clock/shader_clock.ll
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ target triple = "spir64-unknown-unknown"
; CHECK-SPIRV: ReadClockKHR [[#I32v2Ty]] [[#]] [[I32ValId]]
; CHECK-SPIRV: ReadClockKHR [[#I64Ty]] [[#]] [[I32ValId]]

; CHECK-LLVM: call spir_func <2 x i32> @_Z20__spirv_ReadClockKHR
; CHECK-LLVM: call spir_func i64 @_Z20__spirv_ReadClockKHR
; CHECK-LLVM: call spir_func <2 x i32> @_Z27__spirv_ReadClockKHR_Ruint2i(
; CHECK-LLVM: call spir_func i64 @_Z27__spirv_ReadClockKHR_Rulongi(

define spir_func void @_Z7read_types(i32 %a) {
%1 = tail call spir_func <2 x i32> @_Z20__spirv_ReadClockKHRIDv2_jET_j(i32 %a)
Expand Down
Loading