diff options
author | Richard Osborne <richard@xmos.com> | 2011-02-23 18:35:59 +0000 |
---|---|---|
committer | Richard Osborne <richard@xmos.com> | 2011-02-23 18:35:59 +0000 |
commit | 9935bd0819dcc3fe316a7c5c25ee245540df2ecf (patch) | |
tree | 26716892c0bd969e8009d23c2c3e8db357269e55 /test/CodeGen/XCore/events.ll | |
parent | c70f687dce99ea48ca779e6767006f6663781132 (diff) | |
download | external_llvm-9935bd0819dcc3fe316a7c5c25ee245540df2ecf.zip external_llvm-9935bd0819dcc3fe316a7c5c25ee245540df2ecf.tar.gz external_llvm-9935bd0819dcc3fe316a7c5c25ee245540df2ecf.tar.bz2 |
Add llvm.xcore.waitevent intrinsic. The effect of this intrinsic is to enable
events on the thread and wait until a resource is ready to event. The vector
of the resource that is ready is returned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126320 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/XCore/events.ll')
-rw-r--r-- | test/CodeGen/XCore/events.ll | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/CodeGen/XCore/events.ll b/test/CodeGen/XCore/events.ll new file mode 100644 index 0000000..32b5a60 --- /dev/null +++ b/test/CodeGen/XCore/events.ll @@ -0,0 +1,21 @@ +; RUN: llc < %s -march=xcore | FileCheck %s + +declare void @llvm.xcore.setv.p1i8(i8 addrspace(1)* %r, i8* %p) +declare i8* @llvm.xcore.waitevent() + +define i32 @f(i8 addrspace(1)* %r) nounwind { +; CHECK: f: +entry: + call void @llvm.xcore.setv.p1i8(i8 addrspace(1)* %r, i8* blockaddress(@f, %L1)) + call void @llvm.xcore.setv.p1i8(i8 addrspace(1)* %r, i8* blockaddress(@f, %L2)) + %goto_addr = call i8* @llvm.xcore.waitevent() +; CHECK: waiteu + indirectbr i8* %goto_addr, [label %L1, label %L2] +L1: + br label %ret +L2: + br label %ret +ret: + %retval = phi i32 [1, %L1], [2, %L2] + ret i32 %retval +} |