summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/AMDGPU/inline-asm.ll
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2016-02-12 23:45:29 +0000
committerTom Stellard <thomas.stellard@amd.com>2016-02-12 23:45:29 +0000
commitbc4497b13ccc73e1c8c156350cc7fe50f9beae93 (patch)
tree71e7e13564f64f708f17731941d9b73818cb5be9 /llvm/test/CodeGen/AMDGPU/inline-asm.ll
parent0de36ec169b8c818487606658ed2504c88f4c0e7 (diff)
downloadbcm5719-llvm-bc4497b13ccc73e1c8c156350cc7fe50f9beae93.tar.gz
bcm5719-llvm-bc4497b13ccc73e1c8c156350cc7fe50f9beae93.zip
AMDGPU/SI: Detect uniform branches and emit s_cbranch instructions
Reviewers: arsenm Subscribers: mareko, MatzeB, qcolombet, arsenm, llvm-commits Differential Revision: http://reviews.llvm.org/D16603 llvm-svn: 260765
Diffstat (limited to 'llvm/test/CodeGen/AMDGPU/inline-asm.ll')
-rw-r--r--llvm/test/CodeGen/AMDGPU/inline-asm.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AMDGPU/inline-asm.ll b/llvm/test/CodeGen/AMDGPU/inline-asm.ll
index 9c8d3534f8a..92214312273 100644
--- a/llvm/test/CodeGen/AMDGPU/inline-asm.ll
+++ b/llvm/test/CodeGen/AMDGPU/inline-asm.ll
@@ -21,3 +21,21 @@ entry:
}
attributes #0 = { "ShaderType"="0" }
+
+
+; CHECK: {{^}}branch_on_asm:
+; Make sure inline assembly is treted as divergent.
+; CHECK: s_mov_b32 s{{[0-9]+}}, 0
+; CHECK: s_and_saveexec_b64
+define void @branch_on_asm(i32 addrspace(1)* %out) {
+ %zero = call i32 asm "s_mov_b32 $0, 0", "=s"()
+ %cmp = icmp eq i32 %zero, 0
+ br i1 %cmp, label %if, label %endif
+
+if:
+ store i32 0, i32 addrspace(1)* %out
+ br label %endif
+
+endif:
+ ret void
+}
OpenPOWER on IntegriCloud