2011-04-20 17:37:17 +02:00
|
|
|
; RUN: llc < %s -march=ptx32 | FileCheck %s
|
2011-03-18 12:08:52 +01:00
|
|
|
|
|
|
|
define ptx_device void @test_bra_direct() {
|
|
|
|
; CHECK: bra $L__BB0_1;
|
|
|
|
entry:
|
|
|
|
br label %loop
|
|
|
|
loop:
|
|
|
|
br label %loop
|
|
|
|
}
|
|
|
|
|
|
|
|
define ptx_device i32 @test_bra_cond_direct(i32 %x, i32 %y) {
|
|
|
|
entry:
|
2011-09-22 18:45:51 +02:00
|
|
|
; CHECK: setp.le.u32 %p0, %r[[R0:[0-9]+]], %r[[R1:[0-9]+]]
|
2011-03-18 12:08:52 +01:00
|
|
|
%p = icmp ugt i32 %x, %y
|
2011-09-22 18:45:51 +02:00
|
|
|
; CHECK-NEXT: @%p0 bra
|
2011-03-22 15:12:00 +01:00
|
|
|
; CHECK-NOT: bra
|
2011-03-18 12:08:52 +01:00
|
|
|
br i1 %p, label %clause.if, label %clause.else
|
|
|
|
clause.if:
|
2011-09-22 18:45:51 +02:00
|
|
|
; CHECK: mov.u32 %ret{{[0-9]+}}, %r[[R0]]
|
2011-03-18 12:08:52 +01:00
|
|
|
ret i32 %x
|
|
|
|
clause.else:
|
2011-09-22 18:45:51 +02:00
|
|
|
; CHECK: mov.u32 %ret{{[0-9]+}}, %r[[R1]]
|
2011-03-18 12:08:52 +01:00
|
|
|
ret i32 %y
|
|
|
|
}
|