summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/AMDGPU/s_addk_i32.ll16
-rw-r--r--llvm/test/CodeGen/AMDGPU/s_mulk_i32.ll16
2 files changed, 32 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AMDGPU/s_addk_i32.ll b/llvm/test/CodeGen/AMDGPU/s_addk_i32.ll
index 987056010e6..bd6596a1492 100644
--- a/llvm/test/CodeGen/AMDGPU/s_addk_i32.ll
+++ b/llvm/test/CodeGen/AMDGPU/s_addk_i32.ll
@@ -91,3 +91,19 @@ define void @no_s_addk_i32_k0(i32 addrspace(1)* %out, i32 %b) {
store i32 %add, i32 addrspace(1)* %out
ret void
}
+
+@lds = addrspace(3) global [512 x i32] undef, align 4
+
+; SI-LABEL: {{^}}commute_s_addk_i32:
+; SI: s_addk_i32 s{{[0-9]+}}, 0x800{{$}}
+define void @commute_s_addk_i32(i32 addrspace(1)* %out, i32 %b) #0 {
+ %size = call i32 @llvm.amdgcn.groupstaticsize()
+ %add = add i32 %size, %b
+ call void asm sideeffect "; foo $0, $1", "v,s"([512 x i32] addrspace(3)* @lds, i32 %add)
+ ret void
+}
+
+declare i32 @llvm.amdgcn.groupstaticsize() #1
+
+attributes #0 = { nounwind }
+attributes #1 = { nounwind readnone }
diff --git a/llvm/test/CodeGen/AMDGPU/s_mulk_i32.ll b/llvm/test/CodeGen/AMDGPU/s_mulk_i32.ll
index 33d7eeacdb8..a1462193ebb 100644
--- a/llvm/test/CodeGen/AMDGPU/s_mulk_i32.ll
+++ b/llvm/test/CodeGen/AMDGPU/s_mulk_i32.ll
@@ -39,3 +39,19 @@ define void @no_s_mulk_i32_k0(i32 addrspace(1)* %out, i32 %b) {
store i32 %mul, i32 addrspace(1)* %out
ret void
}
+
+@lds = addrspace(3) global [512 x i32] undef, align 4
+
+; SI-LABEL: {{^}}commute_s_mulk_i32:
+; SI: s_mulk_i32 s{{[0-9]+}}, 0x800{{$}}
+define void @commute_s_mulk_i32(i32 addrspace(1)* %out, i32 %b) #0 {
+ %size = call i32 @llvm.amdgcn.groupstaticsize()
+ %add = mul i32 %size, %b
+ call void asm sideeffect "; foo $0, $1", "v,s"([512 x i32] addrspace(3)* @lds, i32 %add)
+ ret void
+}
+
+declare i32 @llvm.amdgcn.groupstaticsize() #1
+
+attributes #0 = { nounwind }
+attributes #1 = { nounwind readnone }
OpenPOWER on IntegriCloud