File: legalize-trap.mir

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (64 lines) | stat: -rw-r--r-- 1,955 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 2
# RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=tahiti -run-pass=legalizer -o - %s | FileCheck -check-prefix=GCN %s

# Check edge cases for trap legalization

---
name: test_fallthrough_after_trap
body: |
  ; GCN-LABEL: name: test_fallthrough_after_trap
  ; GCN: bb.0:
  ; GCN-NEXT:   successors: %bb.1(0x80000000), %bb.2(0x00000000)
  ; GCN-NEXT: {{  $}}
  ; GCN-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
  ; GCN-NEXT:   [[C1:%[0-9]+]]:_(p1) = G_CONSTANT i64 0
  ; GCN-NEXT:   S_CBRANCH_EXECNZ %bb.2, implicit $exec
  ; GCN-NEXT: {{  $}}
  ; GCN-NEXT: bb.1:
  ; GCN-NEXT:   successors: {{$}}
  ; GCN-NEXT: {{  $}}
  ; GCN-NEXT:   G_STORE [[C]](s32), [[C1]](p1) :: (store (s8), addrspace 1)
  ; GCN-NEXT: {{  $}}
  ; GCN-NEXT: bb.2:
  ; GCN-NEXT:   S_ENDPGM 0
  bb.0:
    %0:_(s8) = G_CONSTANT i8 0
    %1:_(p1) = G_CONSTANT i64 0
    G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.trap)

  bb.1:
    G_STORE %0, %1 :: (store 1, addrspace 1)

...

---
name: test_def_fallthrough_after_trap
body: |
  ; GCN-LABEL: name: test_def_fallthrough_after_trap
  ; GCN: bb.0:
  ; GCN-NEXT:   successors: %bb.2(0x40000000), %bb.3(0x40000000)
  ; GCN-NEXT: {{  $}}
  ; GCN-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
  ; GCN-NEXT:   S_CBRANCH_EXECNZ %bb.3, implicit $exec
  ; GCN-NEXT: {{  $}}
  ; GCN-NEXT: bb.2:
  ; GCN-NEXT:   successors: %bb.1(0x80000000)
  ; GCN-NEXT: {{  $}}
  ; GCN-NEXT:   [[C1:%[0-9]+]]:_(p1) = G_CONSTANT i64 0
  ; GCN-NEXT: {{  $}}
  ; GCN-NEXT: bb.1:
  ; GCN-NEXT:   successors: {{$}}
  ; GCN-NEXT: {{  $}}
  ; GCN-NEXT:   G_STORE [[C]](s32), [[C1]](p1) :: (store (s8), addrspace 1)
  ; GCN-NEXT: {{  $}}
  ; GCN-NEXT: bb.3:
  ; GCN-NEXT:   S_ENDPGM 0
  bb.0:
    %0:_(s8) = G_CONSTANT i8 0
    G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.trap)
    %1:_(p1) = G_CONSTANT i64 0

  bb.1:
    G_STORE %0, %1 :: (store 1, addrspace 1)

...