File: mve-tp-loop.mir

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (239 lines) | stat: -rw-r--r-- 10,614 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=thumbv8.1m.main-none-eabi -mattr=+mve -simplify-mir --verify-machineinstrs -run-pass=finalize-isel %s -o - | FileCheck %s
--- |
  target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
  target triple = "arm-arm-none-eabi"

  ; Function Attrs: argmemonly nofree nosync nounwind willreturn
  declare void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg)
  ; Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly
  declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1 immarg)

  define void @test1(i32* noalias %X, i32* noalias readonly %Y, i32 %n) {
  entry:
    %0 = bitcast i32* %X to i8*
    %1 = bitcast i32* %Y to i8*
    call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %0, i8* align 4 %1, i32 %n, i1 false)
    ret void
  }

  define void @test2(i32* noalias %X, i32* noalias readonly %Y, i32 %n) {
  entry:
    %cmp6 = icmp sgt i32 %n, 0
    br i1 %cmp6, label %for.body.preheader, label %for.cond.cleanup

  for.body.preheader:                               ; preds = %entry
    %X.bits = bitcast i32* %X to i8*
    %Y.bits = bitcast i32* %Y to i8*
    call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %X.bits, i8* align 4 %Y.bits, i32 %n, i1 false)
    br label %for.cond.cleanup

  for.cond.cleanup:                                 ; preds = %for.body.preheader, %entry
    ret void
  }

  define void @test3(i32* nocapture %X, i8 zeroext %c, i32 %n) {
  entry:
    %0 = bitcast i32* %X to i8*
    tail call void @llvm.memset.p0i8.i32(i8* align 4 %0, i8 %c, i32 %n, i1 false)
    ret void
  }


  define void @test4(i8* nocapture %X, i8 zeroext %c, i32 %n) {
  entry:
    %cmp4 = icmp sgt i32 %n, 0
    br i1 %cmp4, label %for.body.preheader, label %for.cond.cleanup

  for.body.preheader:                               ; preds = %entry
    call void @llvm.memset.p0i8.i32(i8* align 1 %X, i8 %c, i32 %n, i1 false)
    br label %for.cond.cleanup

  for.cond.cleanup:                                 ; preds = %for.body.preheader, %entry
    ret void
  }

...
---
name:            test1
tracksRegLiveness: true
body:             |
  bb.0.entry:
    liveins: $r0, $r1, $r2

    ; CHECK-LABEL: name: test1
    ; CHECK: liveins: $r0, $r1, $r2
    ; CHECK: [[COPY:%[0-9]+]]:rgpr = COPY $r2
    ; CHECK: [[COPY1:%[0-9]+]]:rgpr = COPY $r1
    ; CHECK: [[COPY2:%[0-9]+]]:rgpr = COPY $r0
    ; CHECK: [[t2ADDri:%[0-9]+]]:rgpr = t2ADDri [[COPY]], 15, 14 /* CC::al */, $noreg, $noreg
    ; CHECK: [[t2LSRri:%[0-9]+]]:rgpr = t2LSRri killed [[t2ADDri]], 4, 14 /* CC::al */, $noreg, $noreg
    ; CHECK: [[t2WhileLoopSetup:%[0-9]+]]:gprlr = t2WhileLoopSetup killed [[t2LSRri]]
    ; CHECK: t2WhileLoopStart [[t2WhileLoopSetup]], %bb.2, implicit-def $cpsr
    ; CHECK: t2B %bb.1, 14 /* CC::al */, $noreg
    ; CHECK: .1:
    ; CHECK: [[PHI:%[0-9]+]]:rgpr = PHI [[COPY1]], %bb.0, %7, %bb.1
    ; CHECK: [[PHI1:%[0-9]+]]:rgpr = PHI [[COPY2]], %bb.0, %9, %bb.1
    ; CHECK: [[PHI2:%[0-9]+]]:gprlr = PHI [[t2WhileLoopSetup]], %bb.0, %11, %bb.1
    ; CHECK: [[PHI3:%[0-9]+]]:rgpr = PHI [[COPY]], %bb.0, %13, %bb.1
    ; CHECK: [[MVE_VCTP8_:%[0-9]+]]:vccr = MVE_VCTP8 [[PHI3]], 0, $noreg, $noreg
    ; CHECK: [[t2SUBri:%[0-9]+]]:rgpr = t2SUBri [[PHI3]], 16, 14 /* CC::al */, $noreg, $noreg
    ; CHECK: [[MVE_VLDRBU8_post:%[0-9]+]]:rgpr, [[MVE_VLDRBU8_post1:%[0-9]+]]:mqpr = MVE_VLDRBU8_post [[PHI]], 16, 1, [[MVE_VCTP8_]], $noreg
    ; CHECK: [[MVE_VSTRBU8_post:%[0-9]+]]:rgpr = MVE_VSTRBU8_post [[MVE_VLDRBU8_post1]], [[PHI1]], 16, 1, [[MVE_VCTP8_]], $noreg
    ; CHECK: [[t2LoopDec:%[0-9]+]]:gprlr = t2LoopDec [[PHI2]], 1
    ; CHECK: t2LoopEnd [[t2LoopDec]], %bb.1, implicit-def $cpsr
    ; CHECK: t2B %bb.2, 14 /* CC::al */, $noreg
    ; CHECK: .2.entry:
    ; CHECK: tBX_RET 14 /* CC::al */, $noreg
    %2:rgpr = COPY $r2
    %1:rgpr = COPY $r1
    %0:rgpr = COPY $r0
    MVE_MEMCPYLOOPINST %0, %1, %2, implicit-def $cpsr
    tBX_RET 14 /* CC::al */, $noreg

...
---
name:            test2
tracksRegLiveness: true
body:             |
  ; CHECK-LABEL: name: test2
  ; CHECK: bb.0.entry:
  ; CHECK:   successors: %bb.1(0x50000000), %bb.2(0x30000000)
  ; CHECK:   liveins: $r0, $r1, $r2
  ; CHECK:   [[COPY:%[0-9]+]]:rgpr = COPY $r2
  ; CHECK:   [[COPY1:%[0-9]+]]:rgpr = COPY $r1
  ; CHECK:   [[COPY2:%[0-9]+]]:rgpr = COPY $r0
  ; CHECK:   t2CMPri [[COPY]], 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
  ; CHECK:   t2Bcc %bb.2, 11 /* CC::lt */, $cpsr
  ; CHECK:   t2B %bb.1, 14 /* CC::al */, $noreg
  ; CHECK: bb.1.for.body.preheader:
  ; CHECK:   [[t2ADDri:%[0-9]+]]:rgpr = t2ADDri [[COPY]], 15, 14 /* CC::al */, $noreg, $noreg
  ; CHECK:   [[t2LSRri:%[0-9]+]]:rgpr = t2LSRri killed [[t2ADDri]], 4, 14 /* CC::al */, $noreg, $noreg
  ; CHECK:   [[t2WhileLoopSetup:%[0-9]+]]:gprlr = t2WhileLoopSetup killed [[t2LSRri]]
  ; CHECK:   t2WhileLoopStart [[t2WhileLoopSetup]], %bb.4, implicit-def $cpsr
  ; CHECK:   t2B %bb.3, 14 /* CC::al */, $noreg
  ; CHECK: bb.3:
  ; CHECK:   [[PHI:%[0-9]+]]:rgpr = PHI [[COPY1]], %bb.1, %7, %bb.3
  ; CHECK:   [[PHI1:%[0-9]+]]:rgpr = PHI [[COPY2]], %bb.1, %9, %bb.3
  ; CHECK:   [[PHI2:%[0-9]+]]:gprlr = PHI [[t2WhileLoopSetup]], %bb.1, %11, %bb.3
  ; CHECK:   [[PHI3:%[0-9]+]]:rgpr = PHI [[COPY]], %bb.1, %13, %bb.3
  ; CHECK:   [[MVE_VCTP8_:%[0-9]+]]:vccr = MVE_VCTP8 [[PHI3]], 0, $noreg, $noreg
  ; CHECK:   [[t2SUBri:%[0-9]+]]:rgpr = t2SUBri [[PHI3]], 16, 14 /* CC::al */, $noreg, $noreg
  ; CHECK:   [[MVE_VLDRBU8_post:%[0-9]+]]:rgpr, [[MVE_VLDRBU8_post1:%[0-9]+]]:mqpr = MVE_VLDRBU8_post [[PHI]], 16, 1, [[MVE_VCTP8_]], $noreg
  ; CHECK:   [[MVE_VSTRBU8_post:%[0-9]+]]:rgpr = MVE_VSTRBU8_post [[MVE_VLDRBU8_post1]], [[PHI1]], 16, 1, [[MVE_VCTP8_]], $noreg
  ; CHECK:   [[t2LoopDec:%[0-9]+]]:gprlr = t2LoopDec [[PHI2]], 1
  ; CHECK:   t2LoopEnd [[t2LoopDec]], %bb.3, implicit-def $cpsr
  ; CHECK:   t2B %bb.4, 14 /* CC::al */, $noreg
  ; CHECK: bb.4.for.body.preheader:
  ; CHECK:   t2B %bb.2, 14 /* CC::al */, $noreg
  ; CHECK: bb.2.for.cond.cleanup:
  ; CHECK:   tBX_RET 14 /* CC::al */, $noreg
  bb.0.entry:
    successors: %bb.1(0x50000000), %bb.2(0x30000000)
    liveins: $r0, $r1, $r2

    %2:rgpr = COPY $r2
    %1:rgpr = COPY $r1
    %0:rgpr = COPY $r0
    t2CMPri %2, 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
    t2Bcc %bb.2, 11 /* CC::lt */, $cpsr
    t2B %bb.1, 14 /* CC::al */, $noreg

  bb.1.for.body.preheader:
    successors: %bb.2(0x80000000)

    MVE_MEMCPYLOOPINST %0, %1, %2, implicit-def $cpsr

  bb.2.for.cond.cleanup:
    tBX_RET 14 /* CC::al */, $noreg

...
---
name:            test3
tracksRegLiveness: true
body:             |
  bb.0.entry:
    liveins: $r0, $r1, $r2

    ; CHECK-LABEL: name: test3
    ; CHECK: liveins: $r0, $r1, $r2
    ; CHECK: [[COPY:%[0-9]+]]:rgpr = COPY $r2
    ; CHECK: [[COPY1:%[0-9]+]]:mqpr = COPY $r1
    ; CHECK: [[COPY2:%[0-9]+]]:rgpr = COPY $r0
    ; CHECK: [[t2ADDri:%[0-9]+]]:rgpr = t2ADDri [[COPY]], 15, 14 /* CC::al */, $noreg, $noreg
    ; CHECK: [[t2LSRri:%[0-9]+]]:rgpr = t2LSRri killed [[t2ADDri]], 4, 14 /* CC::al */, $noreg, $noreg
    ; CHECK: [[t2WhileLoopSetup:%[0-9]+]]:gprlr = t2WhileLoopSetup killed [[t2LSRri]]
    ; CHECK: t2WhileLoopStart [[t2WhileLoopSetup]], %bb.2, implicit-def $cpsr
    ; CHECK: t2B %bb.1, 14 /* CC::al */, $noreg
    ; CHECK: .1:
    ; CHECK: [[PHI:%[0-9]+]]:rgpr = PHI [[COPY2]], %bb.0, %7, %bb.1
    ; CHECK: [[PHI1:%[0-9]+]]:gprlr = PHI [[t2WhileLoopSetup]], %bb.0, %9, %bb.1
    ; CHECK: [[PHI2:%[0-9]+]]:rgpr = PHI [[COPY]], %bb.0, %11, %bb.1
    ; CHECK: [[MVE_VCTP8_:%[0-9]+]]:vccr = MVE_VCTP8 [[PHI2]], 0, $noreg, $noreg
    ; CHECK: [[t2SUBri:%[0-9]+]]:rgpr = t2SUBri [[PHI2]], 16, 14 /* CC::al */, $noreg, $noreg
    ; CHECK: [[MVE_VSTRBU8_post:%[0-9]+]]:rgpr = MVE_VSTRBU8_post [[COPY1]], [[PHI]], 16, 1, [[MVE_VCTP8_]], $noreg
    ; CHECK: [[t2LoopDec:%[0-9]+]]:gprlr = t2LoopDec [[PHI1]], 1
    ; CHECK: t2LoopEnd [[t2LoopDec]], %bb.1, implicit-def $cpsr
    ; CHECK: t2B %bb.2, 14 /* CC::al */, $noreg
    ; CHECK: .2.entry:
    ; CHECK: tBX_RET 14 /* CC::al */, $noreg
    %2:rgpr = COPY $r2
    %1:mqpr = COPY $r1
    %0:rgpr = COPY $r0
    MVE_MEMSETLOOPINST %0, %1, %2, implicit-def $cpsr
    tBX_RET 14 /* CC::al */, $noreg

...
---
name:            test4
alignment:       2
tracksRegLiveness: true
body:             |
  ; CHECK-LABEL: name: test4
  ; CHECK: bb.0.entry:
  ; CHECK:   successors: %bb.1(0x50000000), %bb.2(0x30000000)
  ; CHECK:   liveins: $r0, $r1, $r2
  ; CHECK:   [[COPY:%[0-9]+]]:rgpr = COPY $r2
  ; CHECK:   [[COPY1:%[0-9]+]]:mqpr = COPY $r1
  ; CHECK:   [[COPY2:%[0-9]+]]:rgpr = COPY $r0
  ; CHECK:   t2CMPri [[COPY]], 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
  ; CHECK:   t2Bcc %bb.2, 11 /* CC::lt */, $cpsr
  ; CHECK:   t2B %bb.1, 14 /* CC::al */, $noreg
  ; CHECK: bb.1.for.body.preheader:
  ; CHECK:   [[t2ADDri:%[0-9]+]]:rgpr = t2ADDri [[COPY]], 15, 14 /* CC::al */, $noreg, $noreg
  ; CHECK:   [[t2LSRri:%[0-9]+]]:rgpr = t2LSRri killed [[t2ADDri]], 4, 14 /* CC::al */, $noreg, $noreg
  ; CHECK:   [[t2WhileLoopSetup:%[0-9]+]]:gprlr = t2WhileLoopSetup killed [[t2LSRri]]
  ; CHECK:   t2WhileLoopStart [[t2WhileLoopSetup]], %bb.4, implicit-def $cpsr
  ; CHECK:   t2B %bb.3, 14 /* CC::al */, $noreg
  ; CHECK: bb.3:
  ; CHECK:   [[PHI:%[0-9]+]]:rgpr = PHI [[COPY2]], %bb.1, %7, %bb.3
  ; CHECK:   [[PHI1:%[0-9]+]]:gprlr = PHI [[t2WhileLoopSetup]], %bb.1, %9, %bb.3
  ; CHECK:   [[PHI2:%[0-9]+]]:rgpr = PHI [[COPY]], %bb.1, %11, %bb.3
  ; CHECK:   [[MVE_VCTP8_:%[0-9]+]]:vccr = MVE_VCTP8 [[PHI2]], 0, $noreg, $noreg
  ; CHECK:   [[t2SUBri:%[0-9]+]]:rgpr = t2SUBri [[PHI2]], 16, 14 /* CC::al */, $noreg, $noreg
  ; CHECK:   [[MVE_VSTRBU8_post:%[0-9]+]]:rgpr = MVE_VSTRBU8_post [[COPY1]], [[PHI]], 16, 1, [[MVE_VCTP8_]], $noreg
  ; CHECK:   [[t2LoopDec:%[0-9]+]]:gprlr = t2LoopDec [[PHI1]], 1
  ; CHECK:   t2LoopEnd [[t2LoopDec]], %bb.3, implicit-def $cpsr
  ; CHECK:   t2B %bb.4, 14 /* CC::al */, $noreg
  ; CHECK: bb.4.for.body.preheader:
  ; CHECK:   t2B %bb.2, 14 /* CC::al */, $noreg
  ; CHECK: bb.2.for.cond.cleanup:
  ; CHECK:   tBX_RET 14 /* CC::al */, $noreg
  bb.0.entry:
    successors: %bb.1(0x50000000), %bb.2(0x30000000)
    liveins: $r0, $r1, $r2

    %2:rgpr = COPY $r2
    %1:mqpr = COPY $r1
    %0:rgpr = COPY $r0
    t2CMPri %2, 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
    t2Bcc %bb.2, 11 /* CC::lt */, $cpsr
    t2B %bb.1, 14 /* CC::al */, $noreg

  bb.1.for.body.preheader:
    MVE_MEMSETLOOPINST %0, %1, %2, implicit-def $cpsr

  bb.2.for.cond.cleanup:
    tBX_RET 14 /* CC::al */, $noreg

...