File: legalize-uadde.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 (138 lines) | stat: -rw-r--r-- 6,080 bytes parent folder | download | duplicates (4)
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple aarch64 -verify-machineinstrs -run-pass=legalizer -debugify-and-strip-all-safe %s -o - | FileCheck %s

---
name:            narrow_scalar_uadde_s128
body:             |
  bb.0.entry:
    ; CHECK-LABEL: name: narrow_scalar_uadde_s128
    ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
    ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
    ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s64) = COPY $x3
    ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(s64) = COPY $x4
    ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
    ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY4]](s64)
    ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[TRUNC]], [[C]]
    ; CHECK-NEXT: [[UADDE:%[0-9]+]]:_(s64), [[UADDE1:%[0-9]+]]:_(s32) = G_UADDE [[COPY]], [[COPY2]], [[AND]]
    ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[UADDE1]], [[C]]
    ; CHECK-NEXT: [[UADDE2:%[0-9]+]]:_(s64), [[UADDE3:%[0-9]+]]:_(s32) = G_UADDE [[COPY1]], [[COPY3]], [[AND1]]
    ; CHECK-NEXT: %carry_out_ext:_(s64) = G_ANYEXT [[UADDE3]](s32)
    ; CHECK-NEXT: $x0 = COPY [[UADDE]](s64)
    ; CHECK-NEXT: $x1 = COPY [[UADDE2]](s64)
    ; CHECK-NEXT: $x2 = COPY %carry_out_ext(s64)
    %0:_(s64) = COPY $x0
    %1:_(s64) = COPY $x1
    %2:_(s64) = COPY $x2
    %3:_(s64) = COPY $x3
    %4:_(s64) = COPY $x4
    %lhs:_(s128) = G_MERGE_VALUES %0, %1
    %rhs:_(s128) = G_MERGE_VALUES %2, %3
    %carry_in:_(s1) = G_TRUNC %4
    %add:_(s128), %carry_out:_(s1) = G_UADDE %lhs, %rhs, %carry_in
    %add0:_(s64), %add1:_(s64) = G_UNMERGE_VALUES %add
    %carry_out_ext:_(s64) = G_ANYEXT %carry_out
    $x0 = COPY %add0
    $x1 = COPY %add1
    $x2 = COPY %carry_out_ext

...
---
name:            narrow_scalar_uadde_big_nonpow2
body:             |
  bb.0.entry:
    ; CHECK-LABEL: name: narrow_scalar_uadde_big_nonpow2
    ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
    ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
    ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s64) = COPY $x3
    ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(s64) = COPY $x4
    ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
    ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY4]](s64)
    ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[TRUNC]], [[C]]
    ; CHECK-NEXT: [[UADDE:%[0-9]+]]:_(s64), [[UADDE1:%[0-9]+]]:_(s32) = G_UADDE [[COPY]], [[COPY1]], [[AND]]
    ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[UADDE1]], [[C]]
    ; CHECK-NEXT: [[UADDE2:%[0-9]+]]:_(s64), [[UADDE3:%[0-9]+]]:_(s32) = G_UADDE [[COPY1]], [[COPY2]], [[AND1]]
    ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[UADDE3]], [[C]]
    ; CHECK-NEXT: [[UADDE4:%[0-9]+]]:_(s64), [[UADDE5:%[0-9]+]]:_(s32) = G_UADDE [[COPY2]], [[COPY3]], [[AND2]]
    ; CHECK-NEXT: %carry_out_ext:_(s64) = G_ANYEXT [[UADDE5]](s32)
    ; CHECK-NEXT: $x0 = COPY [[UADDE]](s64)
    ; CHECK-NEXT: $x1 = COPY [[UADDE2]](s64)
    ; CHECK-NEXT: $x2 = COPY [[UADDE4]](s64)
    ; CHECK-NEXT: $x3 = COPY %carry_out_ext(s64)
    %0:_(s64) = COPY $x0
    %1:_(s64) = COPY $x1
    %2:_(s64) = COPY $x2
    %3:_(s64) = COPY $x3
    %4:_(s64) = COPY $x4
    %lhs:_(s192) = G_MERGE_VALUES %0, %1, %2
    %rhs:_(s192) = G_MERGE_VALUES %1, %2, %3
    %carry_in:_(s1) = G_TRUNC %4
    %add:_(s192), %carry_out:_(s1) = G_UADDE %lhs, %rhs, %carry_in
    %add0:_(s64), %add1:_(s64), %add2:_(s64) = G_UNMERGE_VALUES %add
    %carry_out_ext:_(s64) = G_ANYEXT %carry_out
    $x0 = COPY %add0
    $x1 = COPY %add1
    $x2 = COPY %add2
    $x3 = COPY %carry_out_ext

...
---
name:            widen_scalar_uadde_s8
body:             |
  bb.0.entry:
    ; CHECK-LABEL: name: widen_scalar_uadde_s8
    ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
    ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
    ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
    ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
    ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
    ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[TRUNC]], [[C]]
    ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
    ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[TRUNC1]], [[C]]
    ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
    ; CHECK-NEXT: [[TRUNC2:%[0-9]+]]:_(s32) = G_TRUNC [[COPY2]](s64)
    ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[TRUNC2]], [[C1]]
    ; CHECK-NEXT: [[UADDE:%[0-9]+]]:_(s32), [[UADDE1:%[0-9]+]]:_(s32) = G_UADDE [[AND]], [[AND1]], [[AND2]]
    ; CHECK-NEXT: [[AND3:%[0-9]+]]:_(s32) = G_AND [[UADDE]], [[C]]
    ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[UADDE]](s32), [[AND3]]
    ; CHECK-NEXT: %add_ext:_(s64) = G_ANYEXT [[UADDE]](s32)
    ; CHECK-NEXT: %carry_out_ext:_(s64) = G_ANYEXT [[ICMP]](s32)
    ; CHECK-NEXT: $x0 = COPY %add_ext(s64)
    ; CHECK-NEXT: $x1 = COPY %carry_out_ext(s64)
    %0:_(s64) = COPY $x0
    %1:_(s64) = COPY $x1
    %2:_(s64) = COPY $x2
    %lhs:_(s8) = G_TRUNC %0
    %rhs:_(s8) = G_TRUNC %1
    %carry_in:_(s1) = G_TRUNC %2
    %add:_(s8), %carry_out:_(s1) = G_UADDE %lhs, %rhs, %carry_in
    %add_ext:_(s64) = G_ANYEXT %add
    %carry_out_ext:_(s64) = G_ANYEXT %carry_out
    $x0 = COPY %add_ext
    $x1 = COPY %carry_out_ext

...
---
name:            test_scalar_uadde_32
body:             |
  bb.0.entry:
    ; CHECK-LABEL: name: test_scalar_uadde_32
    ; CHECK: %lhs:_(s32) = COPY $w0
    ; CHECK-NEXT: %rhs:_(s32) = COPY $w1
    ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w2
    ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
    ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
    ; CHECK-NEXT: %add:_(s32), %8:_(s32) = G_UADDE %lhs, %rhs, [[AND]]
    ; CHECK-NEXT: $w0 = COPY %add(s32)
    ; CHECK-NEXT: $w1 = COPY %8(s32)
    %lhs:_(s32) = COPY $w0
    %rhs:_(s32) = COPY $w1
    %2:_(s32) = COPY $w2
    %carry_in:_(s1) = G_TRUNC %2
    %add:_(s32), %carry_out:_(s1) = G_UADDE %lhs, %rhs, %carry_in
    %carry_out_ext:_(s32) = G_ANYEXT %carry_out
    $w0 = COPY %add
    $w1 = COPY %carry_out_ext

...