Skip to content

[AMDGPU] Pre-commit fdot2 test. NFC. #72622

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

Merged
merged 1 commit into from
Nov 17, 2023
Merged

[AMDGPU] Pre-commit fdot2 test. NFC. #72622

merged 1 commit into from
Nov 17, 2023

Conversation

rampitec
Copy link
Collaborator

This test exposes a bug where we violate constant bus restriction.

This test exposes a bug where we violate constant bus restriction.
@llvmbot
Copy link
Member

llvmbot commented Nov 17, 2023

@llvm/pr-subscribers-backend-amdgpu

Author: Stanislav Mekhanoshin (rampitec)

Changes

This test exposes a bug where we violate constant bus restriction.


Full diff: https://github.com/llvm/llvm-project/pull/72622.diff

1 Files Affected:

  • (modified) llvm/test/CodeGen/AMDGPU/llvm.amdgcn.fdot2.bf16.bf16.ll (+19)
diff --git a/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.fdot2.bf16.bf16.ll b/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.fdot2.bf16.bf16.ll
index 3a6df1dcc515b6d..3d3bf7bbb54f9a3 100644
--- a/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.fdot2.bf16.bf16.ll
+++ b/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.fdot2.bf16.bf16.ll
@@ -72,4 +72,23 @@ entry:
   ret void
 }
 
+; FIXME: This test violates constant bus restriction.
+
+define amdgpu_ps void @test_llvm_amdgcn_fdot2_bf16_bf16_sis(
+; GFX11-LABEL: test_llvm_amdgcn_fdot2_bf16_bf16_sis:
+; GFX11:       ; %bb.0: ; %entry
+; GFX11-NEXT:    v_dot2_bf16_bf16 v2, s0, 0x10001, s1
+; GFX11-NEXT:    global_store_b16 v[0:1], v2, off
+; GFX11-NEXT:    s_nop 0
+; GFX11-NEXT:    s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
+; GFX11-NEXT:    s_endpgm
+    ptr addrspace(1) %r,
+    <2 x i16> inreg %a,
+    i16 inreg %c) {
+entry:
+  %r.val = call i16 @llvm.amdgcn.fdot2.bf16.bf16(<2 x i16> %a, <2 x i16> <i16 1, i16 1>, i16 %c)
+  store i16 %r.val, ptr addrspace(1) %r
+  ret void
+}
+
 declare i32 @llvm.amdgcn.update.dpp.i32(i32, i32, i32, i32, i32, i1)

@@ -72,4 +72,23 @@ entry:
ret void
}

; FIXME: This test violates constant bus restriction.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this test will fail the verifier? Does it need to start in a separate xfailed test?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it does not. This is considered a legal immediate. It is legal indeed, but only with op_sel_hi selecting low 16 bits. There is code in the SIFoldOperands to do so, but if this code is not run for any reason isImmLegal (or whatever it is) says its is legal and we just happily inline it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I.e. this is a bug very hard to run into.

@rampitec rampitec merged commit 7057f8f into llvm:main Nov 17, 2023
@rampitec rampitec deleted the test branch November 17, 2023 17:32
sr-tream pushed a commit to sr-tream/llvm-project that referenced this pull request Nov 20, 2023
This test exposes a bug where we violate constant bus restriction.
zahiraam pushed a commit to zahiraam/llvm-project that referenced this pull request Nov 20, 2023
This test exposes a bug where we violate constant bus restriction.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants