Coverage Report

Created: 2019-02-15 18:59

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/clang-build/lib/Target/ARM/ARMGenCallingConv.inc
Line
Count
Source (jump to first uncovered line)
1
/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2
|*                                                                            *|
3
|* Calling Convention Implementation Fragment                                 *|
4
|*                                                                            *|
5
|* Automatically generated file, do not edit!                                 *|
6
|*                                                                            *|
7
\*===----------------------------------------------------------------------===*/
8
9
bool llvm::CC_ARM_AAPCS(unsigned ValNo, MVT ValVT,
10
                        MVT LocVT, CCValAssign::LocInfo LocInfo,
11
                        ISD::ArgFlagsTy ArgFlags, CCState &State);
12
static bool CC_ARM_AAPCS_Common(unsigned ValNo, MVT ValVT,
13
                                MVT LocVT, CCValAssign::LocInfo LocInfo,
14
                                ISD::ArgFlagsTy ArgFlags, CCState &State);
15
bool llvm::CC_ARM_AAPCS_VFP(unsigned ValNo, MVT ValVT,
16
                            MVT LocVT, CCValAssign::LocInfo LocInfo,
17
                            ISD::ArgFlagsTy ArgFlags, CCState &State);
18
bool llvm::CC_ARM_APCS(unsigned ValNo, MVT ValVT,
19
                       MVT LocVT, CCValAssign::LocInfo LocInfo,
20
                       ISD::ArgFlagsTy ArgFlags, CCState &State);
21
bool llvm::CC_ARM_APCS_GHC(unsigned ValNo, MVT ValVT,
22
                           MVT LocVT, CCValAssign::LocInfo LocInfo,
23
                           ISD::ArgFlagsTy ArgFlags, CCState &State);
24
bool llvm::FastCC_ARM_APCS(unsigned ValNo, MVT ValVT,
25
                           MVT LocVT, CCValAssign::LocInfo LocInfo,
26
                           ISD::ArgFlagsTy ArgFlags, CCState &State);
27
bool llvm::RetCC_ARM_AAPCS(unsigned ValNo, MVT ValVT,
28
                           MVT LocVT, CCValAssign::LocInfo LocInfo,
29
                           ISD::ArgFlagsTy ArgFlags, CCState &State);
30
static bool RetCC_ARM_AAPCS_Common(unsigned ValNo, MVT ValVT,
31
                                   MVT LocVT, CCValAssign::LocInfo LocInfo,
32
                                   ISD::ArgFlagsTy ArgFlags, CCState &State);
33
bool llvm::RetCC_ARM_AAPCS_VFP(unsigned ValNo, MVT ValVT,
34
                               MVT LocVT, CCValAssign::LocInfo LocInfo,
35
                               ISD::ArgFlagsTy ArgFlags, CCState &State);
36
bool llvm::RetCC_ARM_APCS(unsigned ValNo, MVT ValVT,
37
                          MVT LocVT, CCValAssign::LocInfo LocInfo,
38
                          ISD::ArgFlagsTy ArgFlags, CCState &State);
39
bool llvm::RetFastCC_ARM_APCS(unsigned ValNo, MVT ValVT,
40
                              MVT LocVT, CCValAssign::LocInfo LocInfo,
41
                              ISD::ArgFlagsTy ArgFlags, CCState &State);
42
43
44
bool llvm::CC_ARM_AAPCS(unsigned ValNo, MVT ValVT,
45
                        MVT LocVT, CCValAssign::LocInfo LocInfo,
46
37.8k
                        ISD::ArgFlagsTy ArgFlags, CCState &State) {
47
37.8k
48
37.8k
  if (ArgFlags.isByVal()) {
49
381
    State.HandleByVal(ValNo, ValVT, LocVT, LocInfo, 4, 4, ArgFlags);
50
381
    return false;
51
381
  }
52
37.5k
53
37.5k
  if (ArgFlags.isNest()) {
54
10
    if (unsigned Reg = State.AllocateReg(ARM::R12)) {
55
10
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
56
10
      return false;
57
10
    }
58
37.5k
  }
59
37.5k
60
37.5k
  if (LocVT == MVT::v1i64 ||
61
37.5k
      
LocVT == MVT::v2i3237.4k
||
62
37.5k
      
LocVT == MVT::v4i1637.3k
||
63
37.5k
      
LocVT == MVT::v4f1637.3k
||
64
37.5k
      
LocVT == MVT::v8i837.3k
||
65
37.5k
      
LocVT == MVT::v2f3237.2k
) {
66
280
    LocVT = MVT::f64;
67
280
    LocInfo = CCValAssign::BCvt;
68
280
  }
69
37.5k
70
37.5k
  if (LocVT == MVT::v2i64 ||
71
37.5k
      
LocVT == MVT::v4i3237.4k
||
72
37.5k
      
LocVT == MVT::v8i1637.3k
||
73
37.5k
      
LocVT == MVT::v8f1637.3k
||
74
37.5k
      
LocVT == MVT::v16i837.3k
||
75
37.5k
      
LocVT == MVT::v4f3237.2k
) {
76
268
    LocVT = MVT::v2f64;
77
268
    LocInfo = CCValAssign::BCvt;
78
268
  }
79
37.5k
80
37.5k
  if (ArgFlags.isSwiftSelf()) {
81
0
    if (LocVT == MVT::i32) {
82
0
      if (unsigned Reg = State.AllocateReg(ARM::R10)) {
83
0
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
84
0
        return false;
85
0
      }
86
37.5k
    }
87
0
  }
88
37.5k
89
37.5k
  if (ArgFlags.isSwiftError()) {
90
11
    if (LocVT == MVT::i32) {
91
11
      if (unsigned Reg = State.AllocateReg(ARM::R8)) {
92
11
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
93
11
        return false;
94
11
      }
95
37.4k
    }
96
11
  }
97
37.4k
98
37.4k
  if (LocVT == MVT::f64 ||
99
37.4k
      
LocVT == MVT::v2f6436.0k
) {
100
1.76k
    if (CC_ARM_AAPCS_Custom_f64(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
101
1.34k
        return false;
102
36.1k
  }
103
36.1k
104
36.1k
  if (LocVT == MVT::f32) {
105
1.65k
    LocVT = MVT::i32;
106
1.65k
    LocInfo = CCValAssign::BCvt;
107
1.65k
  }
108
36.1k
109
36.1k
  if (!CC_ARM_AAPCS_Common(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
110
36.1k
    return false;
111
5
112
5
  return true;  // CC didn't match.
113
5
}
114
115
116
static bool CC_ARM_AAPCS_Common(unsigned ValNo, MVT ValVT,
117
                                MVT LocVT, CCValAssign::LocInfo LocInfo,
118
93.3k
                                ISD::ArgFlagsTy ArgFlags, CCState &State) {
119
93.3k
120
93.3k
  if (LocVT == MVT::i1 ||
121
93.3k
      
LocVT == MVT::i893.2k
||
122
93.3k
      
LocVT == MVT::i1693.1k
) {
123
256
    LocVT = MVT::i32;
124
256
    if (ArgFlags.isSExt())
125
27
        LocInfo = CCValAssign::SExt;
126
229
    else if (ArgFlags.isZExt())
127
55
        LocInfo = CCValAssign::ZExt;
128
174
    else
129
174
        LocInfo = CCValAssign::AExt;
130
256
  }
131
93.3k
132
93.3k
  if (LocVT == MVT::i32) {
133
92.8k
    if (ArgFlags.getOrigAlign() == 8) {
134
8.45k
      static const MCPhysReg RegList1[] = {
135
8.45k
        ARM::R0, ARM::R2
136
8.45k
      };
137
8.45k
      static const MCPhysReg RegList2[] = {
138
8.45k
        ARM::R0, ARM::R1
139
8.45k
      };
140
8.45k
      if (unsigned Reg = State.AllocateReg(RegList1, RegList2)) {
141
5.28k
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
142
5.28k
        return false;
143
5.28k
      }
144
88.0k
    }
145
92.8k
  }
146
88.0k
147
88.0k
  if (LocVT == MVT::i32) {
148
87.5k
    if (ArgFlags.getOrigAlign() != 8) {
149
84.3k
      static const MCPhysReg RegList3[] = {
150
84.3k
        ARM::R0, ARM::R1, ARM::R2, ARM::R3
151
84.3k
      };
152
84.3k
      if (unsigned Reg = State.AllocateReg(RegList3)) {
153
70.8k
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
154
70.8k
        return false;
155
70.8k
      }
156
17.1k
    }
157
87.5k
  }
158
17.1k
159
17.1k
  if (LocVT == MVT::i32) {
160
16.6k
    if (ArgFlags.getOrigAlign() == 8) {
161
3.17k
      static const MCPhysReg ShadowRegList4[] = {
162
3.17k
        ARM::R0, ARM::R1, ARM::R2, ARM::R3
163
3.17k
      };
164
3.17k
      unsigned Offset5 = State.AllocateStack(4, 8, ShadowRegList4);
165
3.17k
      State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset5, LocVT, LocInfo));
166
3.17k
      return false;
167
3.17k
    }
168
14.0k
  }
169
14.0k
170
14.0k
  if (LocVT == MVT::i32) {
171
13.5k
    static const MCPhysReg ShadowRegList6[] = {
172
13.5k
      ARM::R0, ARM::R1, ARM::R2, ARM::R3
173
13.5k
    };
174
13.5k
    unsigned Offset7 = State.AllocateStack(4, 4, ShadowRegList6);
175
13.5k
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset7, LocVT, LocInfo));
176
13.5k
    return false;
177
13.5k
  }
178
482
179
482
  if (LocVT == MVT::f32) {
180
4
    static const MCPhysReg ShadowRegList8[] = {
181
4
      ARM::Q0, ARM::Q1, ARM::Q2, ARM::Q3
182
4
    };
183
4
    unsigned Offset9 = State.AllocateStack(4, 4, ShadowRegList8);
184
4
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset9, LocVT, LocInfo));
185
4
    return false;
186
4
  }
187
478
188
478
  if (LocVT == MVT::f64) {
189
321
    static const MCPhysReg ShadowRegList10[] = {
190
321
      ARM::Q0, ARM::Q1, ARM::Q2, ARM::Q3
191
321
    };
192
321
    unsigned Offset11 = State.AllocateStack(8, 8, ShadowRegList10);
193
321
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset11, LocVT, LocInfo));
194
321
    return false;
195
321
  }
196
157
197
157
  if (LocVT == MVT::v2f64) {
198
152
    if (ArgFlags.getOrigAlign() == 16) {
199
3
      static const MCPhysReg ShadowRegList12[] = {
200
3
        ARM::Q0, ARM::Q1, ARM::Q2, ARM::Q3
201
3
      };
202
3
      unsigned Offset13 = State.AllocateStack(16, 16, ShadowRegList12);
203
3
      State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset13, LocVT, LocInfo));
204
3
      return false;
205
3
    }
206
154
  }
207
154
208
154
  if (LocVT == MVT::v2f64) {
209
149
    static const MCPhysReg ShadowRegList14[] = {
210
149
      ARM::Q0, ARM::Q1, ARM::Q2, ARM::Q3
211
149
    };
212
149
    unsigned Offset15 = State.AllocateStack(16, 8, ShadowRegList14);
213
149
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset15, LocVT, LocInfo));
214
149
    return false;
215
149
  }
216
5
217
5
  return true;  // CC didn't match.
218
5
}
219
220
221
bool llvm::CC_ARM_AAPCS_VFP(unsigned ValNo, MVT ValVT,
222
                            MVT LocVT, CCValAssign::LocInfo LocInfo,
223
62.6k
                            ISD::ArgFlagsTy ArgFlags, CCState &State) {
224
62.6k
225
62.6k
  if (ArgFlags.isByVal()) {
226
12
    State.HandleByVal(ValNo, ValVT, LocVT, LocInfo, 4, 4, ArgFlags);
227
12
    return false;
228
12
  }
229
62.6k
230
62.6k
  if (LocVT == MVT::v1i64 ||
231
62.6k
      
LocVT == MVT::v2i3262.5k
||
232
62.6k
      
LocVT == MVT::v4i1662.5k
||
233
62.6k
      
LocVT == MVT::v4f1662.4k
||
234
62.6k
      
LocVT == MVT::v8i862.3k
||
235
62.6k
      
LocVT == MVT::v2f3262.3k
) {
236
315
    LocVT = MVT::f64;
237
315
    LocInfo = CCValAssign::BCvt;
238
315
  }
239
62.6k
240
62.6k
  if (LocVT == MVT::v2i64 ||
241
62.6k
      
LocVT == MVT::v4i3262.5k
||
242
62.6k
      
LocVT == MVT::v8i1662.4k
||
243
62.6k
      
LocVT == MVT::v8f1662.4k
||
244
62.6k
      
LocVT == MVT::v16i862.3k
||
245
62.6k
      
LocVT == MVT::v4f3262.2k
) {
246
350
    LocVT = MVT::v2f64;
247
350
    LocInfo = CCValAssign::BCvt;
248
350
  }
249
62.6k
250
62.6k
  if (ArgFlags.isSwiftSelf()) {
251
53
    if (LocVT == MVT::i32) {
252
53
      if (unsigned Reg = State.AllocateReg(ARM::R10)) {
253
53
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
254
53
        return false;
255
53
      }
256
62.5k
    }
257
53
  }
258
62.5k
259
62.5k
  if (ArgFlags.isSwiftError()) {
260
36
    if (LocVT == MVT::i32) {
261
36
      if (unsigned Reg = State.AllocateReg(ARM::R8)) {
262
36
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
263
36
        return false;
264
36
      }
265
62.5k
    }
266
36
  }
267
62.5k
268
62.5k
  if (ArgFlags.isInConsecutiveRegs()) {
269
5.08k
    if (CC_ARM_AAPCS_Custom_Aggregate(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
270
5.08k
        return false;
271
57.4k
  }
272
57.4k
273
57.4k
  if (LocVT == MVT::v2f64) {
274
62
    static const MCPhysReg RegList1[] = {
275
62
      ARM::Q0, ARM::Q1, ARM::Q2, ARM::Q3
276
62
    };
277
62
    if (unsigned Reg = State.AllocateReg(RegList1)) {
278
14
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
279
14
      return false;
280
14
    }
281
57.4k
  }
282
57.4k
283
57.4k
  if (LocVT == MVT::f64) {
284
160
    static const MCPhysReg RegList2[] = {
285
160
      ARM::D0, ARM::D1, ARM::D2, ARM::D3, ARM::D4, ARM::D5, ARM::D6, ARM::D7
286
160
    };
287
160
    if (unsigned Reg = State.AllocateReg(RegList2)) {
288
148
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
289
148
      return false;
290
148
    }
291
57.2k
  }
292
57.2k
293
57.2k
  if (LocVT == MVT::f32) {
294
112
    static const MCPhysReg RegList3[] = {
295
112
      ARM::S0, ARM::S1, ARM::S2, ARM::S3, ARM::S4, ARM::S5, ARM::S6, ARM::S7, ARM::S8, ARM::S9, ARM::S10, ARM::S11, ARM::S12, ARM::S13, ARM::S14, ARM::S15
296
112
    };
297
112
    if (unsigned Reg = State.AllocateReg(RegList3)) {
298
108
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
299
108
      return false;
300
108
    }
301
57.1k
  }
302
57.1k
303
57.1k
  if (!CC_ARM_AAPCS_Common(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
304
57.1k
    return false;
305
0
306
0
  return true;  // CC didn't match.
307
0
}
308
309
310
bool llvm::CC_ARM_APCS(unsigned ValNo, MVT ValVT,
311
                       MVT LocVT, CCValAssign::LocInfo LocInfo,
312
122k
                       ISD::ArgFlagsTy ArgFlags, CCState &State) {
313
122k
314
122k
  if (ArgFlags.isByVal()) {
315
34
    State.HandleByVal(ValNo, ValVT, LocVT, LocInfo, 4, 4, ArgFlags);
316
34
    return false;
317
34
  }
318
122k
319
122k
  if (LocVT == MVT::i1 ||
320
122k
      
LocVT == MVT::i8122k
||
321
122k
      
LocVT == MVT::i16122k
) {
322
91
    LocVT = MVT::i32;
323
91
    if (ArgFlags.isSExt())
324
13
        LocInfo = CCValAssign::SExt;
325
78
    else if (ArgFlags.isZExt())
326
72
        LocInfo = CCValAssign::ZExt;
327
6
    else
328
6
        LocInfo = CCValAssign::AExt;
329
91
  }
330
122k
331
122k
  if (ArgFlags.isSwiftSelf()) {
332
20
    if (LocVT == MVT::i32) {
333
20
      if (unsigned Reg = State.AllocateReg(ARM::R10)) {
334
20
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
335
20
        return false;
336
20
      }
337
122k
    }
338
20
  }
339
122k
340
122k
  if (ArgFlags.isSwiftError()) {
341
22
    if (LocVT == MVT::i32) {
342
22
      if (unsigned Reg = State.AllocateReg(ARM::R8)) {
343
22
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
344
22
        return false;
345
22
      }
346
122k
    }
347
22
  }
348
122k
349
122k
  if (LocVT == MVT::v1i64 ||
350
122k
      
LocVT == MVT::v2i32122k
||
351
122k
      
LocVT == MVT::v4i16122k
||
352
122k
      
LocVT == MVT::v8i8122k
||
353
122k
      
LocVT == MVT::v2f32122k
) {
354
81
    LocVT = MVT::f64;
355
81
    LocInfo = CCValAssign::BCvt;
356
81
  }
357
122k
358
122k
  if (LocVT == MVT::v2i64 ||
359
122k
      
LocVT == MVT::v4i32122k
||
360
122k
      
LocVT == MVT::v8i16122k
||
361
122k
      
LocVT == MVT::v16i8122k
||
362
122k
      
LocVT == MVT::v4f32122k
) {
363
85
    LocVT = MVT::v2f64;
364
85
    LocInfo = CCValAssign::BCvt;
365
85
  }
366
122k
367
122k
  if (LocVT == MVT::f64 ||
368
122k
      
LocVT == MVT::v2f64121k
) {
369
1.06k
    if (CC_ARM_APCS_Custom_f64(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
370
571
        return false;
371
122k
  }
372
122k
373
122k
  if (LocVT == MVT::f32) {
374
1.05k
    LocVT = MVT::i32;
375
1.05k
    LocInfo = CCValAssign::BCvt;
376
1.05k
  }
377
122k
378
122k
  if (LocVT == MVT::i32) {
379
121k
    static const MCPhysReg RegList1[] = {
380
121k
      ARM::R0, ARM::R1, ARM::R2, ARM::R3
381
121k
    };
382
121k
    if (unsigned Reg = State.AllocateReg(RegList1)) {
383
93.2k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
384
93.2k
      return false;
385
93.2k
    }
386
28.7k
  }
387
28.7k
388
28.7k
  if (LocVT == MVT::i32) {
389
28.2k
    unsigned Offset2 = State.AllocateStack(4, 4);
390
28.2k
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset2, LocVT, LocInfo));
391
28.2k
    return false;
392
28.2k
  }
393
498
394
498
  if (LocVT == MVT::f64) {
395
471
    unsigned Offset3 = State.AllocateStack(8, 4);
396
471
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset3, LocVT, LocInfo));
397
471
    return false;
398
471
  }
399
27
400
27
  if (LocVT == MVT::v2f64) {
401
27
    unsigned Offset4 = State.AllocateStack(16, 4);
402
27
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset4, LocVT, LocInfo));
403
27
    return false;
404
27
  }
405
0
406
0
  return true;  // CC didn't match.
407
0
}
408
409
410
bool llvm::CC_ARM_APCS_GHC(unsigned ValNo, MVT ValVT,
411
                           MVT LocVT, CCValAssign::LocInfo LocInfo,
412
0
                           ISD::ArgFlagsTy ArgFlags, CCState &State) {
413
0
414
0
  if (LocVT == MVT::v1i64 ||
415
0
      LocVT == MVT::v2i32 ||
416
0
      LocVT == MVT::v4i16 ||
417
0
      LocVT == MVT::v8i8 ||
418
0
      LocVT == MVT::v2f32) {
419
0
    LocVT = MVT::f64;
420
0
    LocInfo = CCValAssign::BCvt;
421
0
  }
422
0
423
0
  if (LocVT == MVT::v2i64 ||
424
0
      LocVT == MVT::v4i32 ||
425
0
      LocVT == MVT::v8i16 ||
426
0
      LocVT == MVT::v16i8 ||
427
0
      LocVT == MVT::v4f32) {
428
0
    LocVT = MVT::v2f64;
429
0
    LocInfo = CCValAssign::BCvt;
430
0
  }
431
0
432
0
  if (LocVT == MVT::v2f64) {
433
0
    static const MCPhysReg RegList1[] = {
434
0
      ARM::Q4, ARM::Q5
435
0
    };
436
0
    if (unsigned Reg = State.AllocateReg(RegList1)) {
437
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
438
0
      return false;
439
0
    }
440
0
  }
441
0
442
0
  if (LocVT == MVT::f64) {
443
0
    static const MCPhysReg RegList2[] = {
444
0
      ARM::D8, ARM::D9, ARM::D10, ARM::D11
445
0
    };
446
0
    if (unsigned Reg = State.AllocateReg(RegList2)) {
447
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
448
0
      return false;
449
0
    }
450
0
  }
451
0
452
0
  if (LocVT == MVT::f32) {
453
0
    static const MCPhysReg RegList3[] = {
454
0
      ARM::S16, ARM::S17, ARM::S18, ARM::S19, ARM::S20, ARM::S21, ARM::S22, ARM::S23
455
0
    };
456
0
    if (unsigned Reg = State.AllocateReg(RegList3)) {
457
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
458
0
      return false;
459
0
    }
460
0
  }
461
0
462
0
  if (LocVT == MVT::i8 ||
463
0
      LocVT == MVT::i16) {
464
0
    LocVT = MVT::i32;
465
0
    if (ArgFlags.isSExt())
466
0
        LocInfo = CCValAssign::SExt;
467
0
    else if (ArgFlags.isZExt())
468
0
        LocInfo = CCValAssign::ZExt;
469
0
    else
470
0
        LocInfo = CCValAssign::AExt;
471
0
  }
472
0
473
0
  if (LocVT == MVT::i32) {
474
0
    static const MCPhysReg RegList4[] = {
475
0
      ARM::R4, ARM::R5, ARM::R6, ARM::R7, ARM::R8, ARM::R9, ARM::R10, ARM::R11
476
0
    };
477
0
    if (unsigned Reg = State.AllocateReg(RegList4)) {
478
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
479
0
      return false;
480
0
    }
481
0
  }
482
0
483
0
  return true;  // CC didn't match.
484
0
}
485
486
487
bool llvm::FastCC_ARM_APCS(unsigned ValNo, MVT ValVT,
488
                           MVT LocVT, CCValAssign::LocInfo LocInfo,
489
3.50k
                           ISD::ArgFlagsTy ArgFlags, CCState &State) {
490
3.50k
491
3.50k
  if (LocVT == MVT::v1i64 ||
492
3.50k
      LocVT == MVT::v2i32 ||
493
3.50k
      LocVT == MVT::v4i16 ||
494
3.50k
      LocVT == MVT::v8i8 ||
495
3.50k
      LocVT == MVT::v2f32) {
496
0
    LocVT = MVT::f64;
497
0
    LocInfo = CCValAssign::BCvt;
498
0
  }
499
3.50k
500
3.50k
  if (LocVT == MVT::v2i64 ||
501
3.50k
      LocVT == MVT::v4i32 ||
502
3.50k
      LocVT == MVT::v8i16 ||
503
3.50k
      LocVT == MVT::v16i8 ||
504
3.50k
      LocVT == MVT::v4f32) {
505
0
    LocVT = MVT::v2f64;
506
0
    LocInfo = CCValAssign::BCvt;
507
0
  }
508
3.50k
509
3.50k
  if (LocVT == MVT::v2f64) {
510
0
    static const MCPhysReg RegList1[] = {
511
0
      ARM::Q0, ARM::Q1, ARM::Q2, ARM::Q3
512
0
    };
513
0
    if (unsigned Reg = State.AllocateReg(RegList1)) {
514
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
515
0
      return false;
516
0
    }
517
3.50k
  }
518
3.50k
519
3.50k
  if (LocVT == MVT::f64) {
520
44
    static const MCPhysReg RegList2[] = {
521
44
      ARM::D0, ARM::D1, ARM::D2, ARM::D3, ARM::D4, ARM::D5, ARM::D6, ARM::D7
522
44
    };
523
44
    if (unsigned Reg = State.AllocateReg(RegList2)) {
524
41
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
525
41
      return false;
526
41
    }
527
3.46k
  }
528
3.46k
529
3.46k
  if (LocVT == MVT::f32) {
530
14
    static const MCPhysReg RegList3[] = {
531
14
      ARM::S0, ARM::S1, ARM::S2, ARM::S3, ARM::S4, ARM::S5, ARM::S6, ARM::S7, ARM::S8, ARM::S9, ARM::S10, ARM::S11, ARM::S12, ARM::S13, ARM::S14, ARM::S15
532
14
    };
533
14
    if (unsigned Reg = State.AllocateReg(RegList3)) {
534
11
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
535
11
      return false;
536
11
    }
537
3.45k
  }
538
3.45k
539
3.45k
  if (LocVT == MVT::f32) {
540
3
    static const MCPhysReg ShadowRegList4[] = {
541
3
      ARM::Q0, ARM::Q1, ARM::Q2, ARM::Q3
542
3
    };
543
3
    unsigned Offset5 = State.AllocateStack(4, 4, ShadowRegList4);
544
3
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset5, LocVT, LocInfo));
545
3
    return false;
546
3
  }
547
3.45k
548
3.45k
  if (LocVT == MVT::f64) {
549
3
    static const MCPhysReg ShadowRegList6[] = {
550
3
      ARM::Q0, ARM::Q1, ARM::Q2, ARM::Q3
551
3
    };
552
3
    unsigned Offset7 = State.AllocateStack(8, 4, ShadowRegList6);
553
3
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset7, LocVT, LocInfo));
554
3
    return false;
555
3
  }
556
3.45k
557
3.45k
  if (LocVT == MVT::v2f64) {
558
0
    static const MCPhysReg ShadowRegList8[] = {
559
0
      ARM::Q0, ARM::Q1, ARM::Q2, ARM::Q3
560
0
    };
561
0
    unsigned Offset9 = State.AllocateStack(16, 4, ShadowRegList8);
562
0
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset9, LocVT, LocInfo));
563
0
    return false;
564
0
  }
565
3.45k
566
3.45k
  if (!CC_ARM_APCS(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
567
3.45k
    return false;
568
0
569
0
  return true;  // CC didn't match.
570
0
}
571
572
573
bool llvm::RetCC_ARM_AAPCS(unsigned ValNo, MVT ValVT,
574
                           MVT LocVT, CCValAssign::LocInfo LocInfo,
575
32.7k
                           ISD::ArgFlagsTy ArgFlags, CCState &State) {
576
32.7k
577
32.7k
  if (LocVT == MVT::v1i64 ||
578
32.7k
      
LocVT == MVT::v2i3232.5k
||
579
32.7k
      
LocVT == MVT::v4i1632.0k
||
580
32.7k
      
LocVT == MVT::v4f1631.6k
||
581
32.7k
      
LocVT == MVT::v8i831.6k
||
582
32.7k
      
LocVT == MVT::v2f3231.2k
) {
583
1.63k
    LocVT = MVT::f64;
584
1.63k
    LocInfo = CCValAssign::BCvt;
585
1.63k
  }
586
32.7k
587
32.7k
  if (LocVT == MVT::v2i64 ||
588
32.7k
      
LocVT == MVT::v4i3232.5k
||
589
32.7k
      
LocVT == MVT::v8i1632.0k
||
590
32.7k
      
LocVT == MVT::v8f1631.6k
||
591
32.7k
      
LocVT == MVT::v16i831.6k
||
592
32.7k
      
LocVT == MVT::v4f3231.3k
) {
593
1.53k
    LocVT = MVT::v2f64;
594
1.53k
    LocInfo = CCValAssign::BCvt;
595
1.53k
  }
596
32.7k
597
32.7k
  if (ArgFlags.isSwiftSelf()) {
598
0
    if (LocVT == MVT::i32) {
599
0
      if (unsigned Reg = State.AllocateReg(ARM::R10)) {
600
0
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
601
0
        return false;
602
0
      }
603
32.7k
    }
604
0
  }
605
32.7k
606
32.7k
  if (ArgFlags.isSwiftError()) {
607
12
    if (LocVT == MVT::i32) {
608
12
      if (unsigned Reg = State.AllocateReg(ARM::R8)) {
609
12
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
610
12
        return false;
611
12
      }
612
32.7k
    }
613
12
  }
614
32.7k
615
32.7k
  if (LocVT == MVT::f64 ||
616
32.7k
      
LocVT == MVT::v2f6430.3k
) {
617
3.98k
    if (RetCC_ARM_AAPCS_Custom_f64(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
618
3.92k
        return false;
619
28.8k
  }
620
28.8k
621
28.8k
  if (LocVT == MVT::f32) {
622
1.89k
    LocVT = MVT::i32;
623
1.89k
    LocInfo = CCValAssign::BCvt;
624
1.89k
  }
625
28.8k
626
28.8k
  if (!RetCC_ARM_AAPCS_Common(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
627
28.5k
    return false;
628
235
629
235
  return true;  // CC didn't match.
630
235
}
631
632
633
static bool RetCC_ARM_AAPCS_Common(unsigned ValNo, MVT ValVT,
634
                                   MVT LocVT, CCValAssign::LocInfo LocInfo,
635
56.6k
                                   ISD::ArgFlagsTy ArgFlags, CCState &State) {
636
56.6k
637
56.6k
  if (LocVT == MVT::i1 ||
638
56.6k
      
LocVT == MVT::i856.6k
||
639
56.6k
      
LocVT == MVT::i1656.5k
) {
640
97
    LocVT = MVT::i32;
641
97
    if (ArgFlags.isSExt())
642
12
        LocInfo = CCValAssign::SExt;
643
85
    else if (ArgFlags.isZExt())
644
6
        LocInfo = CCValAssign::ZExt;
645
79
    else
646
79
        LocInfo = CCValAssign::AExt;
647
97
  }
648
56.6k
649
56.6k
  if (LocVT == MVT::i32) {
650
56.4k
    static const MCPhysReg RegList1[] = {
651
56.4k
      ARM::R0, ARM::R1, ARM::R2, ARM::R3
652
56.4k
    };
653
56.4k
    if (unsigned Reg = State.AllocateReg(RegList1)) {
654
56.3k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
655
56.3k
      return false;
656
56.3k
    }
657
281
  }
658
281
659
281
  if (LocVT == MVT::i64) {
660
0
    static const MCPhysReg RegList2[] = {
661
0
      ARM::R0, ARM::R2
662
0
    };
663
0
    static const MCPhysReg RegList3[] = {
664
0
      ARM::R1, ARM::R3
665
0
    };
666
0
    if (unsigned Reg = State.AllocateReg(RegList2, RegList3)) {
667
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
668
0
      return false;
669
0
    }
670
281
  }
671
281
672
281
  return true;  // CC didn't match.
673
281
}
674
675
676
bool llvm::RetCC_ARM_AAPCS_VFP(unsigned ValNo, MVT ValVT,
677
                               MVT LocVT, CCValAssign::LocInfo LocInfo,
678
32.5k
                               ISD::ArgFlagsTy ArgFlags, CCState &State) {
679
32.5k
680
32.5k
  if (LocVT == MVT::v1i64 ||
681
32.5k
      
LocVT == MVT::v2i3232.5k
||
682
32.5k
      
LocVT == MVT::v4i1632.4k
||
683
32.5k
      
LocVT == MVT::v4f1632.3k
||
684
32.5k
      
LocVT == MVT::v8i832.2k
||
685
32.5k
      
LocVT == MVT::v2f3232.2k
) {
686
374
    LocVT = MVT::f64;
687
374
    LocInfo = CCValAssign::BCvt;
688
374
  }
689
32.5k
690
32.5k
  if (LocVT == MVT::v2i64 ||
691
32.5k
      
LocVT == MVT::v4i3232.4k
||
692
32.5k
      
LocVT == MVT::v8i1632.4k
||
693
32.5k
      
LocVT == MVT::v8f1632.3k
||
694
32.5k
      
LocVT == MVT::v16i832.1k
||
695
32.5k
      
LocVT == MVT::v4f3232.1k
) {
696
532
    LocVT = MVT::v2f64;
697
532
    LocInfo = CCValAssign::BCvt;
698
532
  }
699
32.5k
700
32.5k
  if (ArgFlags.isSwiftSelf()) {
701
0
    if (LocVT == MVT::i32) {
702
0
      if (unsigned Reg = State.AllocateReg(ARM::R10)) {
703
0
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
704
0
        return false;
705
0
      }
706
32.5k
    }
707
0
  }
708
32.5k
709
32.5k
  if (ArgFlags.isSwiftError()) {
710
36
    if (LocVT == MVT::i32) {
711
36
      if (unsigned Reg = State.AllocateReg(ARM::R8)) {
712
36
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
713
36
        return false;
714
36
      }
715
32.4k
    }
716
36
  }
717
32.4k
718
32.4k
  if (LocVT == MVT::v2f64) {
719
560
    static const MCPhysReg RegList1[] = {
720
560
      ARM::Q0, ARM::Q1, ARM::Q2, ARM::Q3
721
560
    };
722
560
    if (unsigned Reg = State.AllocateReg(RegList1)) {
723
560
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
724
560
      return false;
725
560
    }
726
31.9k
  }
727
31.9k
728
31.9k
  if (LocVT == MVT::f64) {
729
2.15k
    static const MCPhysReg RegList2[] = {
730
2.15k
      ARM::D0, ARM::D1, ARM::D2, ARM::D3, ARM::D4, ARM::D5, ARM::D6, ARM::D7
731
2.15k
    };
732
2.15k
    if (unsigned Reg = State.AllocateReg(RegList2)) {
733
2.15k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
734
2.15k
      return false;
735
2.15k
    }
736
29.7k
  }
737
29.7k
738
29.7k
  if (LocVT == MVT::f32) {
739
1.95k
    static const MCPhysReg RegList3[] = {
740
1.95k
      ARM::S0, ARM::S1, ARM::S2, ARM::S3, ARM::S4, ARM::S5, ARM::S6, ARM::S7, ARM::S8, ARM::S9, ARM::S10, ARM::S11, ARM::S12, ARM::S13, ARM::S14, ARM::S15
741
1.95k
    };
742
1.95k
    if (unsigned Reg = State.AllocateReg(RegList3)) {
743
1.95k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
744
1.95k
      return false;
745
1.95k
    }
746
27.8k
  }
747
27.8k
748
27.8k
  if (!RetCC_ARM_AAPCS_Common(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
749
27.7k
    return false;
750
46
751
46
  return true;  // CC didn't match.
752
46
}
753
754
755
bool llvm::RetCC_ARM_APCS(unsigned ValNo, MVT ValVT,
756
                          MVT LocVT, CCValAssign::LocInfo LocInfo,
757
53.5k
                          ISD::ArgFlagsTy ArgFlags, CCState &State) {
758
53.5k
759
53.5k
  if (LocVT == MVT::i1 ||
760
53.5k
      
LocVT == MVT::i853.5k
||
761
53.5k
      
LocVT == MVT::i1653.5k
) {
762
30
    LocVT = MVT::i32;
763
30
    if (ArgFlags.isSExt())
764
0
        LocInfo = CCValAssign::SExt;
765
30
    else if (ArgFlags.isZExt())
766
0
        LocInfo = CCValAssign::ZExt;
767
30
    else
768
30
        LocInfo = CCValAssign::AExt;
769
30
  }
770
53.5k
771
53.5k
  if (LocVT == MVT::f32) {
772
528
    LocVT = MVT::i32;
773
528
    LocInfo = CCValAssign::BCvt;
774
528
  }
775
53.5k
776
53.5k
  if (ArgFlags.isSwiftSelf()) {
777
0
    if (LocVT == MVT::i32) {
778
0
      if (unsigned Reg = State.AllocateReg(ARM::R10)) {
779
0
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
780
0
        return false;
781
0
      }
782
53.5k
    }
783
0
  }
784
53.5k
785
53.5k
  if (ArgFlags.isSwiftError()) {
786
24
    if (LocVT == MVT::i32) {
787
24
      if (unsigned Reg = State.AllocateReg(ARM::R8)) {
788
24
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
789
24
        return false;
790
24
      }
791
53.5k
    }
792
24
  }
793
53.5k
794
53.5k
  if (LocVT == MVT::v1i64 ||
795
53.5k
      
LocVT == MVT::v2i3253.5k
||
796
53.5k
      
LocVT == MVT::v4i1653.5k
||
797
53.5k
      
LocVT == MVT::v8i853.5k
||
798
53.5k
      
LocVT == MVT::v2f3253.4k
) {
799
128
    LocVT = MVT::f64;
800
128
    LocInfo = CCValAssign::BCvt;
801
128
  }
802
53.5k
803
53.5k
  if (LocVT == MVT::v2i64 ||
804
53.5k
      
LocVT == MVT::v4i3253.5k
||
805
53.5k
      
LocVT == MVT::v8i1653.5k
||
806
53.5k
      
LocVT == MVT::v16i853.5k
||
807
53.5k
      
LocVT == MVT::v4f3253.4k
) {
808
139
    LocVT = MVT::v2f64;
809
139
    LocInfo = CCValAssign::BCvt;
810
139
  }
811
53.5k
812
53.5k
  if (LocVT == MVT::f64 ||
813
53.5k
      
LocVT == MVT::v2f6453.0k
) {
814
660
    if (RetCC_ARM_APCS_Custom_f64(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
815
656
        return false;
816
52.9k
  }
817
52.9k
818
52.9k
  if (LocVT == MVT::i32) {
819
52.9k
    static const MCPhysReg RegList1[] = {
820
52.9k
      ARM::R0, ARM::R1, ARM::R2, ARM::R3
821
52.9k
    };
822
52.9k
    if (unsigned Reg = State.AllocateReg(RegList1)) {
823
52.9k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
824
52.9k
      return false;
825
52.9k
    }
826
5
  }
827
5
828
5
  if (LocVT == MVT::i64) {
829
0
    static const MCPhysReg RegList2[] = {
830
0
      ARM::R0, ARM::R2
831
0
    };
832
0
    static const MCPhysReg RegList3[] = {
833
0
      ARM::R1, ARM::R3
834
0
    };
835
0
    if (unsigned Reg = State.AllocateReg(RegList2, RegList3)) {
836
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
837
0
      return false;
838
0
    }
839
5
  }
840
5
841
5
  return true;  // CC didn't match.
842
5
}
843
844
845
bool llvm::RetFastCC_ARM_APCS(unsigned ValNo, MVT ValVT,
846
                              MVT LocVT, CCValAssign::LocInfo LocInfo,
847
1.45k
                              ISD::ArgFlagsTy ArgFlags, CCState &State) {
848
1.45k
849
1.45k
  if (LocVT == MVT::v1i64 ||
850
1.45k
      LocVT == MVT::v2i32 ||
851
1.45k
      LocVT == MVT::v4i16 ||
852
1.45k
      LocVT == MVT::v8i8 ||
853
1.45k
      LocVT == MVT::v2f32) {
854
0
    LocVT = MVT::f64;
855
0
    LocInfo = CCValAssign::BCvt;
856
0
  }
857
1.45k
858
1.45k
  if (LocVT == MVT::v2i64 ||
859
1.45k
      LocVT == MVT::v4i32 ||
860
1.45k
      LocVT == MVT::v8i16 ||
861
1.45k
      LocVT == MVT::v16i8 ||
862
1.45k
      LocVT == MVT::v4f32) {
863
0
    LocVT = MVT::v2f64;
864
0
    LocInfo = CCValAssign::BCvt;
865
0
  }
866
1.45k
867
1.45k
  if (LocVT == MVT::v2f64) {
868
0
    static const MCPhysReg RegList1[] = {
869
0
      ARM::Q0, ARM::Q1, ARM::Q2, ARM::Q3
870
0
    };
871
0
    if (unsigned Reg = State.AllocateReg(RegList1)) {
872
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
873
0
      return false;
874
0
    }
875
1.45k
  }
876
1.45k
877
1.45k
  if (LocVT == MVT::f64) {
878
8
    static const MCPhysReg RegList2[] = {
879
8
      ARM::D0, ARM::D1, ARM::D2, ARM::D3, ARM::D4, ARM::D5, ARM::D6, ARM::D7
880
8
    };
881
8
    if (unsigned Reg = State.AllocateReg(RegList2)) {
882
8
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
883
8
      return false;
884
8
    }
885
1.44k
  }
886
1.44k
887
1.44k
  if (LocVT == MVT::f32) {
888
4
    static const MCPhysReg RegList3[] = {
889
4
      ARM::S0, ARM::S1, ARM::S2, ARM::S3, ARM::S4, ARM::S5, ARM::S6, ARM::S7, ARM::S8, ARM::S9, ARM::S10, ARM::S11, ARM::S12, ARM::S13, ARM::S14, ARM::S15
890
4
    };
891
4
    if (unsigned Reg = State.AllocateReg(RegList3)) {
892
4
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
893
4
      return false;
894
4
    }
895
1.44k
  }
896
1.44k
897
1.44k
  if (!RetCC_ARM_APCS(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
898
1.44k
    return false;
899
0
900
0
  return true;  // CC didn't match.
901
0
}