1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 2
2 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=tahiti -run-pass=legalizer -o - %s | FileCheck -check-prefix=GCN %s
4 # Check edge cases for trap legalization
7 name: test_fallthrough_after_trap
9 ; GCN-LABEL: name: test_fallthrough_after_trap
11 ; GCN-NEXT: successors: %bb.1(0x80000000), %bb.2(0x00000000)
13 ; GCN-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
14 ; GCN-NEXT: [[C1:%[0-9]+]]:_(p1) = G_CONSTANT i64 0
15 ; GCN-NEXT: S_CBRANCH_EXECNZ %bb.2, implicit $exec
18 ; GCN-NEXT: successors: {{$}}
20 ; GCN-NEXT: G_STORE [[C]](s32), [[C1]](p1) :: (store (s8), addrspace 1)
23 ; GCN-NEXT: S_ENDPGM 0
25 %0:_(s8) = G_CONSTANT i8 0
26 %1:_(p1) = G_CONSTANT i64 0
27 G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.trap)
30 G_STORE %0, %1 :: (store 1, addrspace 1)
35 name: test_def_fallthrough_after_trap
37 ; GCN-LABEL: name: test_def_fallthrough_after_trap
39 ; GCN-NEXT: successors: %bb.2(0x40000000), %bb.3(0x40000000)
41 ; GCN-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
42 ; GCN-NEXT: S_CBRANCH_EXECNZ %bb.3, implicit $exec
45 ; GCN-NEXT: successors: %bb.1(0x80000000)
47 ; GCN-NEXT: [[C1:%[0-9]+]]:_(p1) = G_CONSTANT i64 0
50 ; GCN-NEXT: successors: {{$}}
52 ; GCN-NEXT: G_STORE [[C]](s32), [[C1]](p1) :: (store (s8), addrspace 1)
55 ; GCN-NEXT: S_ENDPGM 0
57 %0:_(s8) = G_CONSTANT i8 0
58 G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.trap)
59 %1:_(p1) = G_CONSTANT i64 0
62 G_STORE %0, %1 :: (store 1, addrspace 1)