summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/AMDGPU/s_addk_i32.ll
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2016-09-08 17:35:41 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2016-09-08 17:35:41 +0000
commitbe90f70d3abb5c56ca6d38438b8db4aa480328d9 (patch)
tree880300d10274aac064ed3593ab681b0800c0a70f /llvm/test/CodeGen/AMDGPU/s_addk_i32.ll
parent98ddbdb563bb6d6c2161fd50173137bdbe148e2c (diff)
downloadbcm5719-llvm-be90f70d3abb5c56ca6d38438b8db4aa480328d9.tar.gz
bcm5719-llvm-be90f70d3abb5c56ca6d38438b8db4aa480328d9.zip
AMDGPU: Try to commute when selecting s_addk_i32/s_mulk_i32
llvm-svn: 280972
Diffstat (limited to 'llvm/test/CodeGen/AMDGPU/s_addk_i32.ll')
-rw-r--r--llvm/test/CodeGen/AMDGPU/s_addk_i32.ll16
1 files changed, 16 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 }
OpenPOWER on IntegriCloud