1 ; RUN: llc < %s -march=xcore | FileCheck %s 2 3 declare void @llvm.xcore.setv.p1i8(i8 addrspace(1)* %r, i8* %p) 4 declare i8* @llvm.xcore.waitevent() 5 declare i8* @llvm.xcore.checkevent(i8*) 6 declare void @llvm.xcore.clre() 7 8 define i32 @f(i8 addrspace(1)* %r) nounwind { 9 ; CHECK: f: 10 entry: 11 ; CHECK: clre 12 call void @llvm.xcore.clre() 13 call void @llvm.xcore.setv.p1i8(i8 addrspace(1)* %r, i8* blockaddress(@f, %L1)) 14 call void @llvm.xcore.setv.p1i8(i8 addrspace(1)* %r, i8* blockaddress(@f, %L2)) 15 %goto_addr = call i8* @llvm.xcore.waitevent() 16 ; CHECK: waiteu 17 indirectbr i8* %goto_addr, [label %L1, label %L2] 18 L1: 19 br label %ret 20 L2: 21 br label %ret 22 ret: 23 %retval = phi i32 [1, %L1], [2, %L2] 24 ret i32 %retval 25 } 26 27 define i32 @g(i8 addrspace(1)* %r) nounwind { 28 ; CHECK: g: 29 entry: 30 ; CHECK: clre 31 call void @llvm.xcore.clre() 32 call void @llvm.xcore.setv.p1i8(i8 addrspace(1)* %r, i8* blockaddress(@f, %L1)) 33 %goto_addr = call i8* @llvm.xcore.checkevent(i8 *blockaddress(@f, %L2)) 34 ; CHECK: setsr 1 35 ; CHECK: clrsr 1 36 indirectbr i8* %goto_addr, [label %L1, label %L2] 37 L1: 38 br label %ret 39 L2: 40 br label %ret 41 ret: 42 %retval = phi i32 [1, %L1], [2, %L2] 43 ret i32 %retval 44 } 45