-
Notifications
You must be signed in to change notification settings - Fork 220
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
Improve matrices translation with SPV_KHR_untyped_pointers #2857
base: main
Are you sure you want to change the base?
Conversation
; CHECK-SPIRV: UntypedAccessChainKHR [[#TypePtr]] [[#Res:]] [[#TypeMatrix]] [[#VarMatrixPtr]] [[#Const1]] | ||
; CHECK-SPIRV: Store [[#Res]] [[#Const42]] | ||
|
||
; CHECK-LLVM: %0 = alloca target("spirv.CooperativeMatrixKHR", i32, 3, 12, 12, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
; CHECK-LLVM: %0 = alloca target("spirv.CooperativeMatrixKHR", i32, 3, 12, 12, 0) | |
; CHECK-LLVM: %[[#Matrix:]] = alloca target("spirv.CooperativeMatrixKHR", i32, 3, 12, 12, 0) |
and so on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's basically just a copy of access_store.ll
test :) do we need these checks there too?
else if (RetTy->isVectorTy()) | ||
Ty = cast<VectorType>(RetTy)->getElementType(); | ||
else | ||
Ty = RetTy; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So for store pointer parameter would be considered as void *
? If so it doesn't feel right, can we instead query type of the value operand of the store?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I don't get this at all. Don't we already query the type from the llvm instructions? Or do you mean specific SPIR-V opcode in mind?
Ensure that we do correct translation of matrices (
SPV_KHR_cooperative_matrix
andSPV_INTEL_joint_matrix
extensions) when untyped pointers are enabled.This mainly fixes mangling issues in reverse translation for the untyped pointer.
Also added handling for typed and untyped SPIR-V friendly access chain instructions in forward translation (a point to review and discuss).