[llvm] bebf3a9 - [AMDGPU] - Add bitreplicate const folding tests (#72649)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 21 00:06:08 PST 2023
Author: Jessica Del
Date: 2023-11-21T09:06:04+01:00
New Revision: bebf3a9b8a53169e97e6965b42e73792d8ce88bc
URL: https://github.com/llvm/llvm-project/commit/bebf3a9b8a53169e97e6965b42e73792d8ce88bc
DIFF: https://github.com/llvm/llvm-project/commit/bebf3a9b8a53169e97e6965b42e73792d8ce88bc.diff
LOG: [AMDGPU] - Add bitreplicate const folding tests (#72649)
Add more test cases for `s_bitreplicate` constant folding.
Added:
Modified:
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.bitreplicate.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.bitreplicate.ll b/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.bitreplicate.ll
index 0937280e6352c80..815e5c709ff7cb9 100644
--- a/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.bitreplicate.ll
+++ b/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.bitreplicate.ll
@@ -16,6 +16,52 @@ entry:
ret i64 %br
}
+define i64 @test_s_bitreplicate_constant_zero() {
+; GFX11-LABEL: test_s_bitreplicate_constant_zero:
+; GFX11: ; %bb.0: ; %entry
+; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GFX11-NEXT: v_dual_mov_b32 v0, 0 :: v_dual_mov_b32 v1, 0
+; GFX11-NEXT: s_setpc_b64 s[30:31]
+entry:
+ %br = call i64 @llvm.amdgcn.s.bitreplicate(i32 0)
+ ret i64 %br
+}
+
+define i64 @test_s_bitreplicate_constant_neg_one() {
+; GFX11-LABEL: test_s_bitreplicate_constant_neg_one:
+; GFX11: ; %bb.0: ; %entry
+; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GFX11-NEXT: v_dual_mov_b32 v0, -1 :: v_dual_mov_b32 v1, -1
+; GFX11-NEXT: s_setpc_b64 s[30:31]
+entry:
+ %br = call i64 @llvm.amdgcn.s.bitreplicate(i32 -1)
+ ret i64 %br
+}
+
+define i64 @test_s_bitreplicate_constant_undef() {
+; GFX11-LABEL: test_s_bitreplicate_constant_undef:
+; GFX11: ; %bb.0: ; %entry
+; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GFX11-NEXT: s_bitreplicate_b64_b32 s[0:1], s0
+; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
+; GFX11-NEXT: s_setpc_b64 s[30:31]
+entry:
+ %br = call i64 @llvm.amdgcn.s.bitreplicate(i32 undef)
+ ret i64 %br
+}
+
+define i64 @test_s_bitreplicate_constant_poison() {
+; GFX11-LABEL: test_s_bitreplicate_constant_poison:
+; GFX11: ; %bb.0: ; %entry
+; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GFX11-NEXT: s_bitreplicate_b64_b32 s[0:1], s0
+; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
+; GFX11-NEXT: s_setpc_b64 s[30:31]
+entry:
+ %br = call i64 @llvm.amdgcn.s.bitreplicate(i32 poison)
+ ret i64 %br
+}
+
define amdgpu_cs void @test_s_bitreplicate_sgpr(i32 inreg %mask, ptr addrspace(1) %out) {
; GFX11-LABEL: test_s_bitreplicate_sgpr:
; GFX11: ; %bb.0: ; %entry
More information about the llvm-commits
mailing list