File: legalize-bitreverse.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 (135 lines) | stat: -rw-r--r-- 4,237 bytes parent folder | download | duplicates (12)
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
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple aarch64 -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s

...
---
name:            s32_legal
tracksRegLiveness: true
body: |
  bb.0:
    liveins: $w0
    ; CHECK-LABEL: name: s32_legal
    ; CHECK: liveins: $w0
    ; CHECK: %copy:_(s32) = COPY $w0
    ; CHECK: %bitreverse:_(s32) = G_BITREVERSE %copy
    ; CHECK: $w0 = COPY %bitreverse(s32)
    ; CHECK: RET_ReallyLR implicit $w0
    %copy:_(s32) = COPY $w0
    %bitreverse:_(s32) = G_BITREVERSE %copy
    $w0 = COPY %bitreverse
    RET_ReallyLR implicit $w0
...
---
name:            s64_legal
tracksRegLiveness: true
body: |
  bb.0:
    liveins: $x0
    ; CHECK-LABEL: name: s64_legal
    ; CHECK: liveins: $x0
    ; CHECK: %copy:_(s64) = COPY $x0
    ; CHECK: %bitreverse:_(s64) = G_BITREVERSE %copy
    ; CHECK: $x0 = COPY %bitreverse(s64)
    ; CHECK: RET_ReallyLR implicit $x0
    %copy:_(s64) = COPY $x0
    %bitreverse:_(s64) = G_BITREVERSE %copy
    $x0 = COPY %bitreverse
    RET_ReallyLR implicit $x0
...
---
name:            v8s8_legal
tracksRegLiveness: true
body: |
  bb.0:
    liveins: $x0
    ; CHECK-LABEL: name: v8s8_legal
    ; CHECK: liveins: $x0
    ; CHECK: %vec:_(<8 x s8>) = G_IMPLICIT_DEF
    ; CHECK: %bitreverse:_(<8 x s8>) = G_BITREVERSE %vec
    ; CHECK: $x0 = COPY %bitreverse(<8 x s8>)
    ; CHECK: RET_ReallyLR implicit $x0
    %vec:_(<8 x s8>) = G_IMPLICIT_DEF
    %bitreverse:_(<8 x s8>) = G_BITREVERSE %vec
    $x0 = COPY %bitreverse
    RET_ReallyLR implicit $x0
...
---
name:            v16s8_legal
tracksRegLiveness: true
body: |
  bb.0:
    liveins: $q0
    ; CHECK-LABEL: name: v16s8_legal
    ; CHECK: liveins: $q0
    ; CHECK: %vec:_(<16 x s8>) = G_IMPLICIT_DEF
    ; CHECK: %bitreverse:_(<16 x s8>) = G_BITREVERSE %vec
    ; CHECK: $q0 = COPY %bitreverse(<16 x s8>)
    ; CHECK: RET_ReallyLR implicit $q0
    %vec:_(<16 x s8>) = G_IMPLICIT_DEF
    %bitreverse:_(<16 x s8>) = G_BITREVERSE %vec
    $q0 = COPY %bitreverse
    RET_ReallyLR implicit $q0
...
---
name:            s8_widen
tracksRegLiveness: true
body: |
  bb.0:
    liveins: $b0
    ; CHECK-LABEL: name: s8_widen
    ; CHECK: liveins: $b0
    ; CHECK: %copy:_(s8) = COPY $b0
    ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT %copy(s8)
    ; CHECK: [[BITREVERSE:%[0-9]+]]:_(s32) = G_BITREVERSE [[ANYEXT]]
    ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 24
    ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITREVERSE]], [[C]](s64)
    ; CHECK: %bitreverse:_(s8) = G_TRUNC [[LSHR]](s32)
    ; CHECK: $b0 = COPY %bitreverse(s8)
    ; CHECK: RET_ReallyLR implicit $b0
    %copy:_(s8) = COPY $b0
    %bitreverse:_(s8) = G_BITREVERSE %copy
    $b0 = COPY %bitreverse
    RET_ReallyLR implicit $b0
...
---
name:            s3_widen
tracksRegLiveness: true
body: |
  bb.0:
    liveins: $b0
    ; CHECK-LABEL: name: s3_widen
    ; CHECK: liveins: $b0
    ; CHECK: %copy:_(s8) = COPY $b0
    ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT %copy(s8)
    ; CHECK: [[BITREVERSE:%[0-9]+]]:_(s32) = G_BITREVERSE [[ANYEXT]]
    ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 29
    ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITREVERSE]], [[C]](s64)
    ; CHECK: %ext:_(s8) = G_TRUNC [[LSHR]](s32)
    ; CHECK: $b0 = COPY %ext(s8)
    ; CHECK: RET_ReallyLR implicit $b0
    %copy:_(s8) = COPY $b0
    %trunc:_(s3) = G_TRUNC %copy
    %bitreverse:_(s3) = G_BITREVERSE %trunc
    %ext:_(s8) = G_ANYEXT %bitreverse
    $b0 = COPY %ext
    RET_ReallyLR implicit $b0
...
---
name:            s128_narrow
tracksRegLiveness: true
body: |
  bb.0:
    liveins: $q0
    ; CHECK-LABEL: name: s128_narrow
    ; CHECK: liveins: $q0
    ; CHECK: %copy:_(s128) = COPY $q0
    ; CHECK: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES %copy(s128)
    ; CHECK: [[BITREVERSE:%[0-9]+]]:_(s64) = G_BITREVERSE [[UV1]]
    ; CHECK: [[BITREVERSE1:%[0-9]+]]:_(s64) = G_BITREVERSE [[UV]]
    ; CHECK: %bitreverse:_(s128) = G_MERGE_VALUES [[BITREVERSE]](s64), [[BITREVERSE1]](s64)
    ; CHECK: $q0 = COPY %bitreverse(s128)
    ; CHECK: RET_ReallyLR implicit $q0
    %copy:_(s128) = COPY $q0
    %bitreverse:_(s128) = G_BITREVERSE %copy
    $q0 = COPY %bitreverse
    RET_ReallyLR implicit $q0