-
Notifications
You must be signed in to change notification settings - Fork 45
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
It seems the SPIRV serialization has issue in translating the block parameter (SSA in MLIR) into the Phi node (SSA in SPIRV IR) #646
Comments
The test can passed with the work around by removing the canonicalize pass. Although we have the work around, but I think we should take it as a high priority on this issue. F.Y.I:
The corresponding SPIRV IR:
|
Can we raise the priority to this issue? |
We have a simple test case in the Triton for if-else:
The vanilla SPIRV dialect after code lowering is:
And after some SPIRV dialect canonicalize:
The canonicalize merge the Ture and False blocks into one, and it uses the block parameter for the branch divergency.
spirv.BranchConditional %3, ^bb3(%arg1 : !spirv.ptr<i32, CrossWorkgroup>), ^bb3(%arg2 : !spirv.ptr<i32, CrossWorkgroup>) ^bb3(%4: !spirv.ptr<i32, CrossWorkgroup>): // 2 preds: ^bb2, ^bb2
You can see for the true condition, it uses the arg1 as the parameter. for the false condition, it uses the arg2 as the parameter.
I think the optimize pass is working correctly.
But it seems issue happened when serialization to SPIRV IR:
The Phi node uses the same ptr for two pred blocks.
%26 = OpPhi %_ptr_CrossWorkgroup_uint %11 %21 %11 %21
(There is no two physical blocks in SPIRV IR. I think it is optimized. But logically we should have two blocks one for true and one for false.)
The text was updated successfully, but these errors were encountered: