Coverage Report

Created: 2018-09-25 00:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/clang-build/lib/Target/AArch64/AArch64GenCallingConv.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
static bool CC_AArch64_AAPCS(unsigned ValNo, MVT ValVT,
10
                             MVT LocVT, CCValAssign::LocInfo LocInfo,
11
                             ISD::ArgFlagsTy ArgFlags, CCState &State);
12
static bool CC_AArch64_DarwinPCS(unsigned ValNo, MVT ValVT,
13
                                 MVT LocVT, CCValAssign::LocInfo LocInfo,
14
                                 ISD::ArgFlagsTy ArgFlags, CCState &State);
15
static bool CC_AArch64_DarwinPCS_VarArg(unsigned ValNo, MVT ValVT,
16
                                        MVT LocVT, CCValAssign::LocInfo LocInfo,
17
                                        ISD::ArgFlagsTy ArgFlags, CCState &State);
18
static bool CC_AArch64_GHC(unsigned ValNo, MVT ValVT,
19
                           MVT LocVT, CCValAssign::LocInfo LocInfo,
20
                           ISD::ArgFlagsTy ArgFlags, CCState &State);
21
static bool CC_AArch64_WebKit_JS(unsigned ValNo, MVT ValVT,
22
                                 MVT LocVT, CCValAssign::LocInfo LocInfo,
23
                                 ISD::ArgFlagsTy ArgFlags, CCState &State);
24
static bool CC_AArch64_Win64_VarArg(unsigned ValNo, MVT ValVT,
25
                                    MVT LocVT, CCValAssign::LocInfo LocInfo,
26
                                    ISD::ArgFlagsTy ArgFlags, CCState &State);
27
static bool RetCC_AArch64_AAPCS(unsigned ValNo, MVT ValVT,
28
                                MVT LocVT, CCValAssign::LocInfo LocInfo,
29
                                ISD::ArgFlagsTy ArgFlags, CCState &State);
30
static bool RetCC_AArch64_WebKit_JS(unsigned ValNo, MVT ValVT,
31
                                    MVT LocVT, CCValAssign::LocInfo LocInfo,
32
                                    ISD::ArgFlagsTy ArgFlags, CCState &State);
33
34
35
static bool CC_AArch64_AAPCS(unsigned ValNo, MVT ValVT,
36
                             MVT LocVT, CCValAssign::LocInfo LocInfo,
37
22.8k
                             ISD::ArgFlagsTy ArgFlags, CCState &State) {
38
22.8k
39
22.8k
  if (LocVT == MVT::iPTR) {
40
0
    LocVT = MVT::i64;
41
0
    LocInfo = CCValAssign::BCvt;
42
0
  }
43
22.8k
44
22.8k
  if (LocVT == MVT::v2f32) {
45
490
    LocVT = MVT::v2i32;
46
490
    LocInfo = CCValAssign::BCvt;
47
490
  }
48
22.8k
49
22.8k
  if (LocVT == MVT::v2f64 ||
50
22.8k
      
LocVT == MVT::v4f3222.3k
) {
51
1.07k
    LocVT = MVT::v2i64;
52
1.07k
    LocInfo = CCValAssign::BCvt;
53
1.07k
  }
54
22.8k
55
22.8k
  if (State.getMachineFunction().getDataLayout().isBigEndian()) {
56
1.61k
    if (LocVT == MVT::v2i32 ||
57
1.61k
        
LocVT == MVT::v2f321.54k
||
58
1.61k
        
LocVT == MVT::v4i161.54k
||
59
1.61k
        
LocVT == MVT::v4f161.51k
||
60
1.61k
        
LocVT == MVT::v8i81.50k
) {
61
139
      LocVT = MVT::f64;
62
139
      LocInfo = CCValAssign::BCvt;
63
139
    }
64
1.61k
  }
65
22.8k
66
22.8k
  if (State.getMachineFunction().getDataLayout().isBigEndian()) {
67
1.61k
    if (LocVT == MVT::v2i64 ||
68
1.61k
        
LocVT == MVT::v2f641.52k
||
69
1.61k
        
LocVT == MVT::v4i321.52k
||
70
1.61k
        
LocVT == MVT::v4f321.49k
||
71
1.61k
        
LocVT == MVT::v8i161.49k
||
72
1.61k
        
LocVT == MVT::v8f161.45k
||
73
1.61k
        
LocVT == MVT::v16i81.45k
) {
74
196
      LocVT = MVT::f128;
75
196
      LocInfo = CCValAssign::BCvt;
76
196
    }
77
1.61k
  }
78
22.8k
79
22.8k
  if (ArgFlags.isSRet()) {
80
13
    if (LocVT == MVT::i64) {
81
13
      if (unsigned Reg = State.AllocateReg(AArch64::X8, AArch64::W8)) {
82
13
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
83
13
        return false;
84
13
      }
85
22.7k
    }
86
13
  }
87
22.7k
88
22.7k
  if (ArgFlags.isByVal()) {
89
15
    State.HandleByVal(ValNo, ValVT, LocVT, LocInfo, 8, 8, ArgFlags);
90
15
    return false;
91
15
  }
92
22.7k
93
22.7k
  if (ArgFlags.isNest()) {
94
2
    if (unsigned Reg = State.AllocateReg(AArch64::X18)) {
95
2
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
96
2
      return false;
97
2
    }
98
22.7k
  }
99
22.7k
100
22.7k
  if (ArgFlags.isSwiftSelf()) {
101
14
    if (LocVT == MVT::i64) {
102
14
      if (unsigned Reg = State.AllocateReg(AArch64::X20, AArch64::W20)) {
103
14
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
104
14
        return false;
105
14
      }
106
22.7k
    }
107
14
  }
108
22.7k
109
22.7k
  if (ArgFlags.isSwiftError()) {
110
6
    if (LocVT == MVT::i64) {
111
6
      if (unsigned Reg = State.AllocateReg(AArch64::X21, AArch64::W21)) {
112
6
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
113
6
        return false;
114
6
      }
115
22.7k
    }
116
6
  }
117
22.7k
118
22.7k
  if (ArgFlags.isInConsecutiveRegs()) {
119
873
    if (CC_AArch64_Custom_Block(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
120
353
        return false;
121
22.4k
  }
122
22.4k
123
22.4k
  if (LocVT == MVT::i1 ||
124
22.4k
      
LocVT == MVT::i822.3k
||
125
22.4k
      
LocVT == MVT::i1621.7k
) {
126
1.24k
    LocVT = MVT::i32;
127
1.24k
    if (ArgFlags.isSExt())
128
6
        LocInfo = CCValAssign::SExt;
129
1.23k
    else if (ArgFlags.isZExt())
130
42
        LocInfo = CCValAssign::ZExt;
131
1.19k
    else
132
1.19k
        LocInfo = CCValAssign::AExt;
133
1.24k
  }
134
22.4k
135
22.4k
  if (LocVT == MVT::i32) {
136
4.47k
    static const MCPhysReg RegList1[] = {
137
4.47k
      AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
138
4.47k
    };
139
4.47k
    static const MCPhysReg RegList2[] = {
140
4.47k
      AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
141
4.47k
    };
142
4.47k
    if (unsigned Reg = State.AllocateReg(RegList1, RegList2)) {
143
4.40k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
144
4.40k
      return false;
145
4.40k
    }
146
18.0k
  }
147
18.0k
148
18.0k
  if (LocVT == MVT::i64) {
149
6.59k
    if (ArgFlags.isSplit()) {
150
160
      static const MCPhysReg RegList3[] = {
151
160
        AArch64::X0, AArch64::X2, AArch64::X4, AArch64::X6
152
160
      };
153
160
      static const MCPhysReg RegList4[] = {
154
160
        AArch64::X0, AArch64::X1, AArch64::X3, AArch64::X5
155
160
      };
156
160
      if (unsigned Reg = State.AllocateReg(RegList3, RegList4)) {
157
111
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
158
111
        return false;
159
111
      }
160
17.8k
    }
161
6.59k
  }
162
17.8k
163
17.8k
  if (LocVT == MVT::i64) {
164
6.47k
    if (ArgFlags.isSplit()) {
165
49
      static const MCPhysReg ShadowRegList5[] = {
166
49
        AArch64::X7
167
49
      };
168
49
      unsigned Offset6 = State.AllocateStack(8, 16, ShadowRegList5);
169
49
      State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset6, LocVT, LocInfo));
170
49
      return false;
171
49
    }
172
17.8k
  }
173
17.8k
174
17.8k
  if (LocVT == MVT::i64) {
175
6.43k
    static const MCPhysReg RegList7[] = {
176
6.43k
      AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
177
6.43k
    };
178
6.43k
    static const MCPhysReg RegList8[] = {
179
6.43k
      AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
180
6.43k
    };
181
6.43k
    if (unsigned Reg = State.AllocateReg(RegList7, RegList8)) {
182
6.32k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
183
6.32k
      return false;
184
6.32k
    }
185
11.5k
  }
186
11.5k
187
11.5k
  if (LocVT == MVT::f16) {
188
336
    static const MCPhysReg RegList9[] = {
189
336
      AArch64::H0, AArch64::H1, AArch64::H2, AArch64::H3, AArch64::H4, AArch64::H5, AArch64::H6, AArch64::H7
190
336
    };
191
336
    static const MCPhysReg RegList10[] = {
192
336
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
193
336
    };
194
336
    if (unsigned Reg = State.AllocateReg(RegList9, RegList10)) {
195
336
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
196
336
      return false;
197
336
    }
198
11.1k
  }
199
11.1k
200
11.1k
  if (LocVT == MVT::f32) {
201
894
    static const MCPhysReg RegList11[] = {
202
894
      AArch64::S0, AArch64::S1, AArch64::S2, AArch64::S3, AArch64::S4, AArch64::S5, AArch64::S6, AArch64::S7
203
894
    };
204
894
    static const MCPhysReg RegList12[] = {
205
894
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
206
894
    };
207
894
    if (unsigned Reg = State.AllocateReg(RegList11, RegList12)) {
208
889
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
209
889
      return false;
210
889
    }
211
10.2k
  }
212
10.2k
213
10.2k
  if (LocVT == MVT::f64) {
214
784
    static const MCPhysReg RegList13[] = {
215
784
      AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
216
784
    };
217
784
    static const MCPhysReg RegList14[] = {
218
784
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
219
784
    };
220
784
    if (unsigned Reg = State.AllocateReg(RegList13, RegList14)) {
221
766
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
222
766
      return false;
223
766
    }
224
9.52k
  }
225
9.52k
226
9.52k
  if (LocVT == MVT::v1i64 ||
227
9.52k
      
LocVT == MVT::v2i329.31k
||
228
9.52k
      
LocVT == MVT::v4i167.93k
||
229
9.52k
      
LocVT == MVT::v8i86.91k
||
230
9.52k
      
LocVT == MVT::v1f646.39k
||
231
9.52k
      
LocVT == MVT::v2f326.25k
||
232
9.52k
      
LocVT == MVT::v4f166.25k
) {
233
3.50k
    static const MCPhysReg RegList15[] = {
234
3.50k
      AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
235
3.50k
    };
236
3.50k
    static const MCPhysReg RegList16[] = {
237
3.50k
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
238
3.50k
    };
239
3.50k
    if (unsigned Reg = State.AllocateReg(RegList15, RegList16)) {
240
3.49k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
241
3.49k
      return false;
242
3.49k
    }
243
6.02k
  }
244
6.02k
245
6.02k
  if (LocVT == MVT::f128 ||
246
6.02k
      
LocVT == MVT::v2i645.47k
||
247
6.02k
      
LocVT == MVT::v4i323.81k
||
248
6.02k
      
LocVT == MVT::v8i162.07k
||
249
6.02k
      
LocVT == MVT::v16i81.02k
||
250
6.02k
      
LocVT == MVT::v4f32421
||
251
6.02k
      
LocVT == MVT::v2f64421
||
252
6.02k
      
LocVT == MVT::v8f16421
) {
253
5.82k
    static const MCPhysReg RegList17[] = {
254
5.82k
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
255
5.82k
    };
256
5.82k
    if (unsigned Reg = State.AllocateReg(RegList17)) {
257
5.82k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
258
5.82k
      return false;
259
5.82k
    }
260
205
  }
261
205
262
205
  if (LocVT == MVT::i1 ||
263
205
      LocVT == MVT::i8 ||
264
205
      LocVT == MVT::i16 ||
265
205
      LocVT == MVT::f16) {
266
0
    unsigned Offset18 = State.AllocateStack(8, 8);
267
0
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset18, LocVT, LocInfo));
268
0
    return false;
269
0
  }
270
205
271
205
  if (LocVT == MVT::i32 ||
272
205
      
LocVT == MVT::f32141
) {
273
69
    unsigned Offset19 = State.AllocateStack(8, 8);
274
69
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset19, LocVT, LocInfo));
275
69
    return false;
276
69
  }
277
136
278
136
  if (LocVT == MVT::i64 ||
279
136
      
LocVT == MVT::f6429
||
280
136
      
LocVT == MVT::v1f6411
||
281
136
      
LocVT == MVT::v2f3211
||
282
136
      
LocVT == MVT::v1i6411
||
283
136
      
LocVT == MVT::v2i3211
||
284
136
      
LocVT == MVT::v4i1611
||
285
136
      
LocVT == MVT::v8i811
||
286
136
      
LocVT == MVT::v4f1611
) {
287
126
    unsigned Offset20 = State.AllocateStack(8, 8);
288
126
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset20, LocVT, LocInfo));
289
126
    return false;
290
126
  }
291
10
292
10
  if (LocVT == MVT::f128 ||
293
10
      
LocVT == MVT::v2i649
||
294
10
      
LocVT == MVT::v4i326
||
295
10
      
LocVT == MVT::v8i166
||
296
10
      
LocVT == MVT::v16i86
||
297
10
      
LocVT == MVT::v4f326
||
298
10
      
LocVT == MVT::v2f646
||
299
10
      
LocVT == MVT::v8f166
) {
300
5
    unsigned Offset21 = State.AllocateStack(16, 16);
301
5
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset21, LocVT, LocInfo));
302
5
    return false;
303
5
  }
304
5
305
5
  return true;  // CC didn't match.
306
5
}
AArch64FastISel.cpp:CC_AArch64_AAPCS(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)
Line
Count
Source
37
66
                             ISD::ArgFlagsTy ArgFlags, CCState &State) {
38
66
39
66
  if (LocVT == MVT::iPTR) {
40
0
    LocVT = MVT::i64;
41
0
    LocInfo = CCValAssign::BCvt;
42
0
  }
43
66
44
66
  if (LocVT == MVT::v2f32) {
45
2
    LocVT = MVT::v2i32;
46
2
    LocInfo = CCValAssign::BCvt;
47
2
  }
48
66
49
66
  if (LocVT == MVT::v2f64 ||
50
66
      LocVT == MVT::v4f32) {
51
0
    LocVT = MVT::v2i64;
52
0
    LocInfo = CCValAssign::BCvt;
53
0
  }
54
66
55
66
  if (State.getMachineFunction().getDataLayout().isBigEndian()) {
56
57
    if (LocVT == MVT::v2i32 ||
57
57
        
LocVT == MVT::v2f3253
||
58
57
        
LocVT == MVT::v4i1653
||
59
57
        
LocVT == MVT::v4f1651
||
60
57
        
LocVT == MVT::v8i851
) {
61
8
      LocVT = MVT::f64;
62
8
      LocInfo = CCValAssign::BCvt;
63
8
    }
64
57
  }
65
66
66
66
  if (State.getMachineFunction().getDataLayout().isBigEndian()) {
67
57
    if (LocVT == MVT::v2i64 ||
68
57
        LocVT == MVT::v2f64 ||
69
57
        LocVT == MVT::v4i32 ||
70
57
        LocVT == MVT::v4f32 ||
71
57
        LocVT == MVT::v8i16 ||
72
57
        LocVT == MVT::v8f16 ||
73
57
        LocVT == MVT::v16i8) {
74
0
      LocVT = MVT::f128;
75
0
      LocInfo = CCValAssign::BCvt;
76
0
    }
77
57
  }
78
66
79
66
  if (ArgFlags.isSRet()) {
80
0
    if (LocVT == MVT::i64) {
81
0
      if (unsigned Reg = State.AllocateReg(AArch64::X8, AArch64::W8)) {
82
0
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
83
0
        return false;
84
0
      }
85
66
    }
86
0
  }
87
66
88
66
  if (ArgFlags.isByVal()) {
89
0
    State.HandleByVal(ValNo, ValVT, LocVT, LocInfo, 8, 8, ArgFlags);
90
0
    return false;
91
0
  }
92
66
93
66
  if (ArgFlags.isNest()) {
94
0
    if (unsigned Reg = State.AllocateReg(AArch64::X18)) {
95
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
96
0
      return false;
97
0
    }
98
66
  }
99
66
100
66
  if (ArgFlags.isSwiftSelf()) {
101
0
    if (LocVT == MVT::i64) {
102
0
      if (unsigned Reg = State.AllocateReg(AArch64::X20, AArch64::W20)) {
103
0
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
104
0
        return false;
105
0
      }
106
66
    }
107
0
  }
108
66
109
66
  if (ArgFlags.isSwiftError()) {
110
0
    if (LocVT == MVT::i64) {
111
0
      if (unsigned Reg = State.AllocateReg(AArch64::X21, AArch64::W21)) {
112
0
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
113
0
        return false;
114
0
      }
115
66
    }
116
0
  }
117
66
118
66
  if (ArgFlags.isInConsecutiveRegs()) {
119
0
    if (CC_AArch64_Custom_Block(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
120
0
        return false;
121
66
  }
122
66
123
66
  if (LocVT == MVT::i1 ||
124
66
      
LocVT == MVT::i864
||
125
66
      
LocVT == MVT::i1643
) {
126
26
    LocVT = MVT::i32;
127
26
    if (ArgFlags.isSExt())
128
3
        LocInfo = CCValAssign::SExt;
129
23
    else if (ArgFlags.isZExt())
130
14
        LocInfo = CCValAssign::ZExt;
131
9
    else
132
9
        LocInfo = CCValAssign::AExt;
133
26
  }
134
66
135
66
  if (LocVT == MVT::i32) {
136
32
    static const MCPhysReg RegList1[] = {
137
32
      AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
138
32
    };
139
32
    static const MCPhysReg RegList2[] = {
140
32
      AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
141
32
    };
142
32
    if (unsigned Reg = State.AllocateReg(RegList1, RegList2)) {
143
30
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
144
30
      return false;
145
30
    }
146
36
  }
147
36
148
36
  if (LocVT == MVT::i64) {
149
17
    if (ArgFlags.isSplit()) {
150
0
      static const MCPhysReg RegList3[] = {
151
0
        AArch64::X0, AArch64::X2, AArch64::X4, AArch64::X6
152
0
      };
153
0
      static const MCPhysReg RegList4[] = {
154
0
        AArch64::X0, AArch64::X1, AArch64::X3, AArch64::X5
155
0
      };
156
0
      if (unsigned Reg = State.AllocateReg(RegList3, RegList4)) {
157
0
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
158
0
        return false;
159
0
      }
160
36
    }
161
17
  }
162
36
163
36
  if (LocVT == MVT::i64) {
164
17
    if (ArgFlags.isSplit()) {
165
0
      static const MCPhysReg ShadowRegList5[] = {
166
0
        AArch64::X7
167
0
      };
168
0
      unsigned Offset6 = State.AllocateStack(8, 16, ShadowRegList5);
169
0
      State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset6, LocVT, LocInfo));
170
0
      return false;
171
0
    }
172
36
  }
173
36
174
36
  if (LocVT == MVT::i64) {
175
17
    static const MCPhysReg RegList7[] = {
176
17
      AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
177
17
    };
178
17
    static const MCPhysReg RegList8[] = {
179
17
      AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
180
17
    };
181
17
    if (unsigned Reg = State.AllocateReg(RegList7, RegList8)) {
182
17
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
183
17
      return false;
184
17
    }
185
19
  }
186
19
187
19
  if (LocVT == MVT::f16) {
188
0
    static const MCPhysReg RegList9[] = {
189
0
      AArch64::H0, AArch64::H1, AArch64::H2, AArch64::H3, AArch64::H4, AArch64::H5, AArch64::H6, AArch64::H7
190
0
    };
191
0
    static const MCPhysReg RegList10[] = {
192
0
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
193
0
    };
194
0
    if (unsigned Reg = State.AllocateReg(RegList9, RegList10)) {
195
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
196
0
      return false;
197
0
    }
198
19
  }
199
19
200
19
  if (LocVT == MVT::f32) {
201
0
    static const MCPhysReg RegList11[] = {
202
0
      AArch64::S0, AArch64::S1, AArch64::S2, AArch64::S3, AArch64::S4, AArch64::S5, AArch64::S6, AArch64::S7
203
0
    };
204
0
    static const MCPhysReg RegList12[] = {
205
0
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
206
0
    };
207
0
    if (unsigned Reg = State.AllocateReg(RegList11, RegList12)) {
208
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
209
0
      return false;
210
0
    }
211
19
  }
212
19
213
19
  if (LocVT == MVT::f64) {
214
15
    static const MCPhysReg RegList13[] = {
215
15
      AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
216
15
    };
217
15
    static const MCPhysReg RegList14[] = {
218
15
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
219
15
    };
220
15
    if (unsigned Reg = State.AllocateReg(RegList13, RegList14)) {
221
15
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
222
15
      return false;
223
15
    }
224
4
  }
225
4
226
4
  if (LocVT == MVT::v1i64 ||
227
4
      
LocVT == MVT::v2i322
||
228
4
      
LocVT == MVT::v4i162
||
229
4
      
LocVT == MVT::v8i82
||
230
4
      
LocVT == MVT::v1f642
||
231
4
      
LocVT == MVT::v2f322
||
232
4
      
LocVT == MVT::v4f162
) {
233
2
    static const MCPhysReg RegList15[] = {
234
2
      AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
235
2
    };
236
2
    static const MCPhysReg RegList16[] = {
237
2
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
238
2
    };
239
2
    if (unsigned Reg = State.AllocateReg(RegList15, RegList16)) {
240
2
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
241
2
      return false;
242
2
    }
243
2
  }
244
2
245
2
  if (LocVT == MVT::f128 ||
246
2
      LocVT == MVT::v2i64 ||
247
2
      LocVT == MVT::v4i32 ||
248
2
      LocVT == MVT::v8i16 ||
249
2
      LocVT == MVT::v16i8 ||
250
2
      LocVT == MVT::v4f32 ||
251
2
      LocVT == MVT::v2f64 ||
252
2
      LocVT == MVT::v8f16) {
253
0
    static const MCPhysReg RegList17[] = {
254
0
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
255
0
    };
256
0
    if (unsigned Reg = State.AllocateReg(RegList17)) {
257
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
258
0
      return false;
259
0
    }
260
2
  }
261
2
262
2
  if (LocVT == MVT::i1 ||
263
2
      LocVT == MVT::i8 ||
264
2
      LocVT == MVT::i16 ||
265
2
      LocVT == MVT::f16) {
266
0
    unsigned Offset18 = State.AllocateStack(8, 8);
267
0
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset18, LocVT, LocInfo));
268
0
    return false;
269
0
  }
270
2
271
2
  if (LocVT == MVT::i32 ||
272
2
      
LocVT == MVT::f320
) {
273
2
    unsigned Offset19 = State.AllocateStack(8, 8);
274
2
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset19, LocVT, LocInfo));
275
2
    return false;
276
2
  }
277
0
278
0
  if (LocVT == MVT::i64 ||
279
0
      LocVT == MVT::f64 ||
280
0
      LocVT == MVT::v1f64 ||
281
0
      LocVT == MVT::v2f32 ||
282
0
      LocVT == MVT::v1i64 ||
283
0
      LocVT == MVT::v2i32 ||
284
0
      LocVT == MVT::v4i16 ||
285
0
      LocVT == MVT::v8i8 ||
286
0
      LocVT == MVT::v4f16) {
287
0
    unsigned Offset20 = State.AllocateStack(8, 8);
288
0
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset20, LocVT, LocInfo));
289
0
    return false;
290
0
  }
291
0
292
0
  if (LocVT == MVT::f128 ||
293
0
      LocVT == MVT::v2i64 ||
294
0
      LocVT == MVT::v4i32 ||
295
0
      LocVT == MVT::v8i16 ||
296
0
      LocVT == MVT::v16i8 ||
297
0
      LocVT == MVT::v4f32 ||
298
0
      LocVT == MVT::v2f64 ||
299
0
      LocVT == MVT::v8f16) {
300
0
    unsigned Offset21 = State.AllocateStack(16, 16);
301
0
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset21, LocVT, LocInfo));
302
0
    return false;
303
0
  }
304
0
305
0
  return true;  // CC didn't match.
306
0
}
AArch64ISelLowering.cpp:CC_AArch64_AAPCS(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)
Line
Count
Source
37
22.7k
                             ISD::ArgFlagsTy ArgFlags, CCState &State) {
38
22.7k
39
22.7k
  if (LocVT == MVT::iPTR) {
40
0
    LocVT = MVT::i64;
41
0
    LocInfo = CCValAssign::BCvt;
42
0
  }
43
22.7k
44
22.7k
  if (LocVT == MVT::v2f32) {
45
488
    LocVT = MVT::v2i32;
46
488
    LocInfo = CCValAssign::BCvt;
47
488
  }
48
22.7k
49
22.7k
  if (LocVT == MVT::v2f64 ||
50
22.7k
      
LocVT == MVT::v4f3222.2k
) {
51
1.07k
    LocVT = MVT::v2i64;
52
1.07k
    LocInfo = CCValAssign::BCvt;
53
1.07k
  }
54
22.7k
55
22.7k
  if (State.getMachineFunction().getDataLayout().isBigEndian()) {
56
1.55k
    if (LocVT == MVT::v2i32 ||
57
1.55k
        
LocVT == MVT::v2f321.49k
||
58
1.55k
        
LocVT == MVT::v4i161.49k
||
59
1.55k
        
LocVT == MVT::v4f161.46k
||
60
1.55k
        
LocVT == MVT::v8i81.45k
) {
61
131
      LocVT = MVT::f64;
62
131
      LocInfo = CCValAssign::BCvt;
63
131
    }
64
1.55k
  }
65
22.7k
66
22.7k
  if (State.getMachineFunction().getDataLayout().isBigEndian()) {
67
1.55k
    if (LocVT == MVT::v2i64 ||
68
1.55k
        
LocVT == MVT::v2f641.46k
||
69
1.55k
        
LocVT == MVT::v4i321.46k
||
70
1.55k
        
LocVT == MVT::v4f321.43k
||
71
1.55k
        
LocVT == MVT::v8i161.43k
||
72
1.55k
        
LocVT == MVT::v8f161.39k
||
73
1.55k
        
LocVT == MVT::v16i81.39k
) {
74
196
      LocVT = MVT::f128;
75
196
      LocInfo = CCValAssign::BCvt;
76
196
    }
77
1.55k
  }
78
22.7k
79
22.7k
  if (ArgFlags.isSRet()) {
80
13
    if (LocVT == MVT::i64) {
81
13
      if (unsigned Reg = State.AllocateReg(AArch64::X8, AArch64::W8)) {
82
13
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
83
13
        return false;
84
13
      }
85
22.7k
    }
86
13
  }
87
22.7k
88
22.7k
  if (ArgFlags.isByVal()) {
89
15
    State.HandleByVal(ValNo, ValVT, LocVT, LocInfo, 8, 8, ArgFlags);
90
15
    return false;
91
15
  }
92
22.7k
93
22.7k
  if (ArgFlags.isNest()) {
94
2
    if (unsigned Reg = State.AllocateReg(AArch64::X18)) {
95
2
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
96
2
      return false;
97
2
    }
98
22.7k
  }
99
22.7k
100
22.7k
  if (ArgFlags.isSwiftSelf()) {
101
14
    if (LocVT == MVT::i64) {
102
14
      if (unsigned Reg = State.AllocateReg(AArch64::X20, AArch64::W20)) {
103
14
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
104
14
        return false;
105
14
      }
106
22.7k
    }
107
14
  }
108
22.7k
109
22.7k
  if (ArgFlags.isSwiftError()) {
110
6
    if (LocVT == MVT::i64) {
111
6
      if (unsigned Reg = State.AllocateReg(AArch64::X21, AArch64::W21)) {
112
6
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
113
6
        return false;
114
6
      }
115
22.6k
    }
116
6
  }
117
22.6k
118
22.6k
  if (ArgFlags.isInConsecutiveRegs()) {
119
873
    if (CC_AArch64_Custom_Block(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
120
353
        return false;
121
22.3k
  }
122
22.3k
123
22.3k
  if (LocVT == MVT::i1 ||
124
22.3k
      
LocVT == MVT::i822.3k
||
125
22.3k
      
LocVT == MVT::i1621.7k
) {
126
1.21k
    LocVT = MVT::i32;
127
1.21k
    if (ArgFlags.isSExt())
128
3
        LocInfo = CCValAssign::SExt;
129
1.21k
    else if (ArgFlags.isZExt())
130
28
        LocInfo = CCValAssign::ZExt;
131
1.18k
    else
132
1.18k
        LocInfo = CCValAssign::AExt;
133
1.21k
  }
134
22.3k
135
22.3k
  if (LocVT == MVT::i32) {
136
4.44k
    static const MCPhysReg RegList1[] = {
137
4.44k
      AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
138
4.44k
    };
139
4.44k
    static const MCPhysReg RegList2[] = {
140
4.44k
      AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
141
4.44k
    };
142
4.44k
    if (unsigned Reg = State.AllocateReg(RegList1, RegList2)) {
143
4.37k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
144
4.37k
      return false;
145
4.37k
    }
146
17.9k
  }
147
17.9k
148
17.9k
  if (LocVT == MVT::i64) {
149
6.57k
    if (ArgFlags.isSplit()) {
150
160
      static const MCPhysReg RegList3[] = {
151
160
        AArch64::X0, AArch64::X2, AArch64::X4, AArch64::X6
152
160
      };
153
160
      static const MCPhysReg RegList4[] = {
154
160
        AArch64::X0, AArch64::X1, AArch64::X3, AArch64::X5
155
160
      };
156
160
      if (unsigned Reg = State.AllocateReg(RegList3, RegList4)) {
157
111
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
158
111
        return false;
159
111
      }
160
17.8k
    }
161
6.57k
  }
162
17.8k
163
17.8k
  if (LocVT == MVT::i64) {
164
6.46k
    if (ArgFlags.isSplit()) {
165
49
      static const MCPhysReg ShadowRegList5[] = {
166
49
        AArch64::X7
167
49
      };
168
49
      unsigned Offset6 = State.AllocateStack(8, 16, ShadowRegList5);
169
49
      State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset6, LocVT, LocInfo));
170
49
      return false;
171
49
    }
172
17.8k
  }
173
17.8k
174
17.8k
  if (LocVT == MVT::i64) {
175
6.41k
    static const MCPhysReg RegList7[] = {
176
6.41k
      AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
177
6.41k
    };
178
6.41k
    static const MCPhysReg RegList8[] = {
179
6.41k
      AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
180
6.41k
    };
181
6.41k
    if (unsigned Reg = State.AllocateReg(RegList7, RegList8)) {
182
6.30k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
183
6.30k
      return false;
184
6.30k
    }
185
11.4k
  }
186
11.4k
187
11.4k
  if (LocVT == MVT::f16) {
188
336
    static const MCPhysReg RegList9[] = {
189
336
      AArch64::H0, AArch64::H1, AArch64::H2, AArch64::H3, AArch64::H4, AArch64::H5, AArch64::H6, AArch64::H7
190
336
    };
191
336
    static const MCPhysReg RegList10[] = {
192
336
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
193
336
    };
194
336
    if (unsigned Reg = State.AllocateReg(RegList9, RegList10)) {
195
336
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
196
336
      return false;
197
336
    }
198
11.1k
  }
199
11.1k
200
11.1k
  if (LocVT == MVT::f32) {
201
894
    static const MCPhysReg RegList11[] = {
202
894
      AArch64::S0, AArch64::S1, AArch64::S2, AArch64::S3, AArch64::S4, AArch64::S5, AArch64::S6, AArch64::S7
203
894
    };
204
894
    static const MCPhysReg RegList12[] = {
205
894
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
206
894
    };
207
894
    if (unsigned Reg = State.AllocateReg(RegList11, RegList12)) {
208
889
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
209
889
      return false;
210
889
    }
211
10.2k
  }
212
10.2k
213
10.2k
  if (LocVT == MVT::f64) {
214
769
    static const MCPhysReg RegList13[] = {
215
769
      AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
216
769
    };
217
769
    static const MCPhysReg RegList14[] = {
218
769
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
219
769
    };
220
769
    if (unsigned Reg = State.AllocateReg(RegList13, RegList14)) {
221
751
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
222
751
      return false;
223
751
    }
224
9.52k
  }
225
9.52k
226
9.52k
  if (LocVT == MVT::v1i64 ||
227
9.52k
      
LocVT == MVT::v2i329.31k
||
228
9.52k
      
LocVT == MVT::v4i167.93k
||
229
9.52k
      
LocVT == MVT::v8i86.90k
||
230
9.52k
      
LocVT == MVT::v1f646.39k
||
231
9.52k
      
LocVT == MVT::v2f326.24k
||
232
9.52k
      
LocVT == MVT::v4f166.24k
) {
233
3.49k
    static const MCPhysReg RegList15[] = {
234
3.49k
      AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
235
3.49k
    };
236
3.49k
    static const MCPhysReg RegList16[] = {
237
3.49k
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
238
3.49k
    };
239
3.49k
    if (unsigned Reg = State.AllocateReg(RegList15, RegList16)) {
240
3.49k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
241
3.49k
      return false;
242
3.49k
    }
243
6.02k
  }
244
6.02k
245
6.02k
  if (LocVT == MVT::f128 ||
246
6.02k
      
LocVT == MVT::v2i645.47k
||
247
6.02k
      
LocVT == MVT::v4i323.80k
||
248
6.02k
      
LocVT == MVT::v8i162.07k
||
249
6.02k
      
LocVT == MVT::v16i81.02k
||
250
6.02k
      
LocVT == MVT::v4f32419
||
251
6.02k
      
LocVT == MVT::v2f64419
||
252
6.02k
      
LocVT == MVT::v8f16419
) {
253
5.82k
    static const MCPhysReg RegList17[] = {
254
5.82k
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
255
5.82k
    };
256
5.82k
    if (unsigned Reg = State.AllocateReg(RegList17)) {
257
5.82k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
258
5.82k
      return false;
259
5.82k
    }
260
203
  }
261
203
262
203
  if (LocVT == MVT::i1 ||
263
203
      LocVT == MVT::i8 ||
264
203
      LocVT == MVT::i16 ||
265
203
      LocVT == MVT::f16) {
266
0
    unsigned Offset18 = State.AllocateStack(8, 8);
267
0
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset18, LocVT, LocInfo));
268
0
    return false;
269
0
  }
270
203
271
203
  if (LocVT == MVT::i32 ||
272
203
      
LocVT == MVT::f32141
) {
273
67
    unsigned Offset19 = State.AllocateStack(8, 8);
274
67
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset19, LocVT, LocInfo));
275
67
    return false;
276
67
  }
277
136
278
136
  if (LocVT == MVT::i64 ||
279
136
      
LocVT == MVT::f6429
||
280
136
      
LocVT == MVT::v1f6411
||
281
136
      
LocVT == MVT::v2f3211
||
282
136
      
LocVT == MVT::v1i6411
||
283
136
      
LocVT == MVT::v2i3211
||
284
136
      
LocVT == MVT::v4i1611
||
285
136
      
LocVT == MVT::v8i811
||
286
136
      
LocVT == MVT::v4f1611
) {
287
126
    unsigned Offset20 = State.AllocateStack(8, 8);
288
126
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset20, LocVT, LocInfo));
289
126
    return false;
290
126
  }
291
10
292
10
  if (LocVT == MVT::f128 ||
293
10
      
LocVT == MVT::v2i649
||
294
10
      
LocVT == MVT::v4i326
||
295
10
      
LocVT == MVT::v8i166
||
296
10
      
LocVT == MVT::v16i86
||
297
10
      
LocVT == MVT::v4f326
||
298
10
      
LocVT == MVT::v2f646
||
299
10
      
LocVT == MVT::v8f166
) {
300
5
    unsigned Offset21 = State.AllocateStack(16, 16);
301
5
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset21, LocVT, LocInfo));
302
5
    return false;
303
5
  }
304
5
305
5
  return true;  // CC didn't match.
306
5
}
307
308
309
static bool CC_AArch64_DarwinPCS(unsigned ValNo, MVT ValVT,
310
                                 MVT LocVT, CCValAssign::LocInfo LocInfo,
311
5.00M
                                 ISD::ArgFlagsTy ArgFlags, CCState &State) {
312
5.00M
313
5.00M
  if (LocVT == MVT::iPTR) {
314
0
    LocVT = MVT::i64;
315
0
    LocInfo = CCValAssign::BCvt;
316
0
  }
317
5.00M
318
5.00M
  if (LocVT == MVT::v2f32) {
319
98
    LocVT = MVT::v2i32;
320
98
    LocInfo = CCValAssign::BCvt;
321
98
  }
322
5.00M
323
5.00M
  if (LocVT == MVT::v2f64 ||
324
5.00M
      
LocVT == MVT::v4f325.00M
||
325
5.00M
      
LocVT == MVT::f1285.00M
) {
326
249
    LocVT = MVT::v2i64;
327
249
    LocInfo = CCValAssign::BCvt;
328
249
  }
329
5.00M
330
5.00M
  if (ArgFlags.isSRet()) {
331
10.8k
    if (LocVT == MVT::i64) {
332
10.8k
      if (unsigned Reg = State.AllocateReg(AArch64::X8, AArch64::W8)) {
333
10.8k
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
334
10.8k
        return false;
335
10.8k
      }
336
4.99M
    }
337
10.8k
  }
338
4.99M
339
4.99M
  if (ArgFlags.isByVal()) {
340
0
    State.HandleByVal(ValNo, ValVT, LocVT, LocInfo, 8, 8, ArgFlags);
341
0
    return false;
342
0
  }
343
4.99M
344
4.99M
  if (ArgFlags.isSwiftSelf()) {
345
43
    if (LocVT == MVT::i64) {
346
43
      if (unsigned Reg = State.AllocateReg(AArch64::X20, AArch64::W20)) {
347
43
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
348
43
        return false;
349
43
      }
350
4.99M
    }
351
43
  }
352
4.99M
353
4.99M
  if (ArgFlags.isSwiftError()) {
354
46
    if (LocVT == MVT::i64) {
355
46
      if (unsigned Reg = State.AllocateReg(AArch64::X21, AArch64::W21)) {
356
46
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
357
46
        return false;
358
46
      }
359
4.99M
    }
360
46
  }
361
4.99M
362
4.99M
  if (ArgFlags.isInConsecutiveRegs()) {
363
3.41k
    if (CC_AArch64_Custom_Block(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
364
3.41k
        return false;
365
4.99M
  }
366
4.99M
367
4.99M
  if (LocVT == MVT::i1 ||
368
4.99M
      
LocVT == MVT::i84.99M
||
369
4.99M
      
LocVT == MVT::i164.95M
) {
370
49.8k
    LocVT = MVT::i32;
371
49.8k
    if (ArgFlags.isSExt())
372
8.49k
        LocInfo = CCValAssign::SExt;
373
41.3k
    else if (ArgFlags.isZExt())
374
18.7k
        LocInfo = CCValAssign::ZExt;
375
22.6k
    else
376
22.6k
        LocInfo = CCValAssign::AExt;
377
49.8k
  }
378
4.99M
379
4.99M
  if (LocVT == MVT::i32) {
380
705k
    static const MCPhysReg RegList1[] = {
381
705k
      AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
382
705k
    };
383
705k
    static const MCPhysReg RegList2[] = {
384
705k
      AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
385
705k
    };
386
705k
    if (unsigned Reg = State.AllocateReg(RegList1, RegList2)) {
387
702k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
388
702k
      return false;
389
702k
    }
390
4.29M
  }
391
4.29M
392
4.29M
  if (LocVT == MVT::i64) {
393
4.23M
    if (ArgFlags.isSplit()) {
394
206
      static const MCPhysReg RegList3[] = {
395
206
        AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6
396
206
      };
397
206
      static const MCPhysReg RegList4[] = {
398
206
        AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6
399
206
      };
400
206
      if (unsigned Reg = State.AllocateReg(RegList3, RegList4)) {
401
186
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
402
186
        return false;
403
186
      }
404
4.29M
    }
405
4.23M
  }
406
4.29M
407
4.29M
  if (LocVT == MVT::i64) {
408
4.23M
    if (ArgFlags.isSplit()) {
409
20
      static const MCPhysReg ShadowRegList5[] = {
410
20
        AArch64::X7
411
20
      };
412
20
      unsigned Offset6 = State.AllocateStack(8, 16, ShadowRegList5);
413
20
      State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset6, LocVT, LocInfo));
414
20
      return false;
415
20
    }
416
4.29M
  }
417
4.29M
418
4.29M
  if (LocVT == MVT::i64) {
419
4.23M
    static const MCPhysReg RegList7[] = {
420
4.23M
      AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
421
4.23M
    };
422
4.23M
    static const MCPhysReg RegList8[] = {
423
4.23M
      AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
424
4.23M
    };
425
4.23M
    if (unsigned Reg = State.AllocateReg(RegList7, RegList8)) {
426
4.19M
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
427
4.19M
      return false;
428
4.19M
    }
429
101k
  }
430
101k
431
101k
  if (LocVT == MVT::f16) {
432
14
    static const MCPhysReg RegList9[] = {
433
14
      AArch64::H0, AArch64::H1, AArch64::H2, AArch64::H3, AArch64::H4, AArch64::H5, AArch64::H6, AArch64::H7
434
14
    };
435
14
    static const MCPhysReg RegList10[] = {
436
14
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
437
14
    };
438
14
    if (unsigned Reg = State.AllocateReg(RegList9, RegList10)) {
439
14
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
440
14
      return false;
441
14
    }
442
101k
  }
443
101k
444
101k
  if (LocVT == MVT::f32) {
445
3.10k
    static const MCPhysReg RegList11[] = {
446
3.10k
      AArch64::S0, AArch64::S1, AArch64::S2, AArch64::S3, AArch64::S4, AArch64::S5, AArch64::S6, AArch64::S7
447
3.10k
    };
448
3.10k
    static const MCPhysReg RegList12[] = {
449
3.10k
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
450
3.10k
    };
451
3.10k
    if (unsigned Reg = State.AllocateReg(RegList11, RegList12)) {
452
3.09k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
453
3.09k
      return false;
454
3.09k
    }
455
98.4k
  }
456
98.4k
457
98.4k
  if (LocVT == MVT::f64) {
458
47.6k
    static const MCPhysReg RegList13[] = {
459
47.6k
      AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
460
47.6k
    };
461
47.6k
    static const MCPhysReg RegList14[] = {
462
47.6k
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
463
47.6k
    };
464
47.6k
    if (unsigned Reg = State.AllocateReg(RegList13, RegList14)) {
465
46.7k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
466
46.7k
      return false;
467
46.7k
    }
468
51.6k
  }
469
51.6k
470
51.6k
  if (LocVT == MVT::v1i64 ||
471
51.6k
      
LocVT == MVT::v2i3251.5k
||
472
51.6k
      
LocVT == MVT::v4i1651.3k
||
473
51.6k
      
LocVT == MVT::v8i851.2k
||
474
51.6k
      
LocVT == MVT::v1f6451.1k
||
475
51.6k
      
LocVT == MVT::v2f3251.1k
||
476
51.6k
      
LocVT == MVT::v4f1651.1k
) {
477
540
    static const MCPhysReg RegList15[] = {
478
540
      AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
479
540
    };
480
540
    static const MCPhysReg RegList16[] = {
481
540
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
482
540
    };
483
540
    if (unsigned Reg = State.AllocateReg(RegList15, RegList16)) {
484
536
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
485
536
      return false;
486
536
    }
487
51.1k
  }
488
51.1k
489
51.1k
  if (LocVT == MVT::v2i64 ||
490
51.1k
      
LocVT == MVT::v4i3250.7k
||
491
51.1k
      
LocVT == MVT::v8i1650.6k
||
492
51.1k
      
LocVT == MVT::v16i850.5k
||
493
51.1k
      
LocVT == MVT::v4f3250.4k
||
494
51.1k
      
LocVT == MVT::v2f6450.4k
||
495
51.1k
      
LocVT == MVT::v8f1650.4k
) {
496
712
    static const MCPhysReg RegList17[] = {
497
712
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
498
712
    };
499
712
    if (unsigned Reg = State.AllocateReg(RegList17)) {
500
708
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
501
708
      return false;
502
708
    }
503
50.4k
  }
504
50.4k
505
50.4k
  if (ValVT == MVT::i1 || 
ValVT == MVT::i850.3k
) {
506
210
    unsigned Offset18 = State.AllocateStack(1, 1);
507
210
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset18, LocVT, LocInfo));
508
210
    return false;
509
210
  }
510
50.2k
511
50.2k
  if (ValVT == MVT::i16 || 
ValVT == MVT::f1650.1k
) {
512
32
    unsigned Offset19 = State.AllocateStack(2, 2);
513
32
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset19, LocVT, LocInfo));
514
32
    return false;
515
32
  }
516
50.1k
517
50.1k
  if (LocVT == MVT::i32 ||
518
50.1k
      
LocVT == MVT::f3247.5k
) {
519
2.59k
    unsigned Offset20 = State.AllocateStack(4, 4);
520
2.59k
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset20, LocVT, LocInfo));
521
2.59k
    return false;
522
2.59k
  }
523
47.5k
524
47.5k
  if (LocVT == MVT::i64 ||
525
47.5k
      
LocVT == MVT::f64874
||
526
47.5k
      
LocVT == MVT::v1f648
||
527
47.5k
      
LocVT == MVT::v2f328
||
528
47.5k
      
LocVT == MVT::v1i648
||
529
47.5k
      
LocVT == MVT::v2i328
||
530
47.5k
      
LocVT == MVT::v4i164
||
531
47.5k
      
LocVT == MVT::v8i84
||
532
47.5k
      
LocVT == MVT::v4f164
) {
533
47.5k
    unsigned Offset21 = State.AllocateStack(8, 8);
534
47.5k
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset21, LocVT, LocInfo));
535
47.5k
    return false;
536
47.5k
  }
537
4
538
4
  if (LocVT == MVT::v2i64 ||
539
4
      LocVT == MVT::v4i32 ||
540
4
      
LocVT == MVT::v8i160
||
541
4
      
LocVT == MVT::v16i80
||
542
4
      
LocVT == MVT::v4f320
||
543
4
      
LocVT == MVT::v2f640
||
544
4
      
LocVT == MVT::v8f160
) {
545
4
    unsigned Offset22 = State.AllocateStack(16, 16);
546
4
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset22, LocVT, LocInfo));
547
4
    return false;
548
4
  }
549
0
550
0
  return true;  // CC didn't match.
551
0
}
AArch64FastISel.cpp:CC_AArch64_DarwinPCS(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)
Line
Count
Source
311
1.29k
                                 ISD::ArgFlagsTy ArgFlags, CCState &State) {
312
1.29k
313
1.29k
  if (LocVT == MVT::iPTR) {
314
0
    LocVT = MVT::i64;
315
0
    LocInfo = CCValAssign::BCvt;
316
0
  }
317
1.29k
318
1.29k
  if (LocVT == MVT::v2f32) {
319
0
    LocVT = MVT::v2i32;
320
0
    LocInfo = CCValAssign::BCvt;
321
0
  }
322
1.29k
323
1.29k
  if (LocVT == MVT::v2f64 ||
324
1.29k
      LocVT == MVT::v4f32 ||
325
1.29k
      LocVT == MVT::f128) {
326
0
    LocVT = MVT::v2i64;
327
0
    LocInfo = CCValAssign::BCvt;
328
0
  }
329
1.29k
330
1.29k
  if (ArgFlags.isSRet()) {
331
0
    if (LocVT == MVT::i64) {
332
0
      if (unsigned Reg = State.AllocateReg(AArch64::X8, AArch64::W8)) {
333
0
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
334
0
        return false;
335
0
      }
336
1.29k
    }
337
0
  }
338
1.29k
339
1.29k
  if (ArgFlags.isByVal()) {
340
0
    State.HandleByVal(ValNo, ValVT, LocVT, LocInfo, 8, 8, ArgFlags);
341
0
    return false;
342
0
  }
343
1.29k
344
1.29k
  if (ArgFlags.isSwiftSelf()) {
345
0
    if (LocVT == MVT::i64) {
346
0
      if (unsigned Reg = State.AllocateReg(AArch64::X20, AArch64::W20)) {
347
0
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
348
0
        return false;
349
0
      }
350
1.29k
    }
351
0
  }
352
1.29k
353
1.29k
  if (ArgFlags.isSwiftError()) {
354
0
    if (LocVT == MVT::i64) {
355
0
      if (unsigned Reg = State.AllocateReg(AArch64::X21, AArch64::W21)) {
356
0
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
357
0
        return false;
358
0
      }
359
1.29k
    }
360
0
  }
361
1.29k
362
1.29k
  if (ArgFlags.isInConsecutiveRegs()) {
363
0
    if (CC_AArch64_Custom_Block(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
364
0
        return false;
365
1.29k
  }
366
1.29k
367
1.29k
  if (LocVT == MVT::i1 ||
368
1.29k
      
LocVT == MVT::i81.27k
||
369
1.29k
      
LocVT == MVT::i161.22k
) {
370
73
    LocVT = MVT::i32;
371
73
    if (ArgFlags.isSExt())
372
12
        LocInfo = CCValAssign::SExt;
373
61
    else if (ArgFlags.isZExt())
374
40
        LocInfo = CCValAssign::ZExt;
375
21
    else
376
21
        LocInfo = CCValAssign::AExt;
377
73
  }
378
1.29k
379
1.29k
  if (LocVT == MVT::i32) {
380
109
    static const MCPhysReg RegList1[] = {
381
109
      AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
382
109
    };
383
109
    static const MCPhysReg RegList2[] = {
384
109
      AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
385
109
    };
386
109
    if (unsigned Reg = State.AllocateReg(RegList1, RegList2)) {
387
93
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
388
93
      return false;
389
93
    }
390
1.19k
  }
391
1.19k
392
1.19k
  if (LocVT == MVT::i64) {
393
1.14k
    if (ArgFlags.isSplit()) {
394
0
      static const MCPhysReg RegList3[] = {
395
0
        AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6
396
0
      };
397
0
      static const MCPhysReg RegList4[] = {
398
0
        AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6
399
0
      };
400
0
      if (unsigned Reg = State.AllocateReg(RegList3, RegList4)) {
401
0
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
402
0
        return false;
403
0
      }
404
1.19k
    }
405
1.14k
  }
406
1.19k
407
1.19k
  if (LocVT == MVT::i64) {
408
1.14k
    if (ArgFlags.isSplit()) {
409
0
      static const MCPhysReg ShadowRegList5[] = {
410
0
        AArch64::X7
411
0
      };
412
0
      unsigned Offset6 = State.AllocateStack(8, 16, ShadowRegList5);
413
0
      State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset6, LocVT, LocInfo));
414
0
      return false;
415
0
    }
416
1.19k
  }
417
1.19k
418
1.19k
  if (LocVT == MVT::i64) {
419
1.14k
    static const MCPhysReg RegList7[] = {
420
1.14k
      AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
421
1.14k
    };
422
1.14k
    static const MCPhysReg RegList8[] = {
423
1.14k
      AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
424
1.14k
    };
425
1.14k
    if (unsigned Reg = State.AllocateReg(RegList7, RegList8)) {
426
112
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
427
112
      return false;
428
112
    }
429
1.08k
  }
430
1.08k
431
1.08k
  if (LocVT == MVT::f16) {
432
0
    static const MCPhysReg RegList9[] = {
433
0
      AArch64::H0, AArch64::H1, AArch64::H2, AArch64::H3, AArch64::H4, AArch64::H5, AArch64::H6, AArch64::H7
434
0
    };
435
0
    static const MCPhysReg RegList10[] = {
436
0
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
437
0
    };
438
0
    if (unsigned Reg = State.AllocateReg(RegList9, RegList10)) {
439
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
440
0
      return false;
441
0
    }
442
1.08k
  }
443
1.08k
444
1.08k
  if (LocVT == MVT::f32) {
445
20
    static const MCPhysReg RegList11[] = {
446
20
      AArch64::S0, AArch64::S1, AArch64::S2, AArch64::S3, AArch64::S4, AArch64::S5, AArch64::S6, AArch64::S7
447
20
    };
448
20
    static const MCPhysReg RegList12[] = {
449
20
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
450
20
    };
451
20
    if (unsigned Reg = State.AllocateReg(RegList11, RegList12)) {
452
20
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
453
20
      return false;
454
20
    }
455
1.06k
  }
456
1.06k
457
1.06k
  if (LocVT == MVT::f64) {
458
20
    static const MCPhysReg RegList13[] = {
459
20
      AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
460
20
    };
461
20
    static const MCPhysReg RegList14[] = {
462
20
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
463
20
    };
464
20
    if (unsigned Reg = State.AllocateReg(RegList13, RegList14)) {
465
20
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
466
20
      return false;
467
20
    }
468
1.04k
  }
469
1.04k
470
1.04k
  if (LocVT == MVT::v1i64 ||
471
1.04k
      LocVT == MVT::v2i32 ||
472
1.04k
      LocVT == MVT::v4i16 ||
473
1.04k
      LocVT == MVT::v8i8 ||
474
1.04k
      LocVT == MVT::v1f64 ||
475
1.04k
      LocVT == MVT::v2f32 ||
476
1.04k
      LocVT == MVT::v4f16) {
477
0
    static const MCPhysReg RegList15[] = {
478
0
      AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
479
0
    };
480
0
    static const MCPhysReg RegList16[] = {
481
0
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
482
0
    };
483
0
    if (unsigned Reg = State.AllocateReg(RegList15, RegList16)) {
484
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
485
0
      return false;
486
0
    }
487
1.04k
  }
488
1.04k
489
1.04k
  if (LocVT == MVT::v2i64 ||
490
1.04k
      LocVT == MVT::v4i32 ||
491
1.04k
      LocVT == MVT::v8i16 ||
492
1.04k
      LocVT == MVT::v16i8 ||
493
1.04k
      LocVT == MVT::v4f32 ||
494
1.04k
      LocVT == MVT::v2f64 ||
495
1.04k
      LocVT == MVT::v8f16) {
496
0
    static const MCPhysReg RegList17[] = {
497
0
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
498
0
    };
499
0
    if (unsigned Reg = State.AllocateReg(RegList17)) {
500
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
501
0
      return false;
502
0
    }
503
1.04k
  }
504
1.04k
505
1.04k
  if (ValVT == MVT::i1 || 
ValVT == MVT::i81.04k
) {
506
13
    unsigned Offset18 = State.AllocateStack(1, 1);
507
13
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset18, LocVT, LocInfo));
508
13
    return false;
509
13
  }
510
1.03k
511
1.03k
  if (ValVT == MVT::i16 || 
ValVT == MVT::f161.03k
) {
512
1
    unsigned Offset19 = State.AllocateStack(2, 2);
513
1
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset19, LocVT, LocInfo));
514
1
    return false;
515
1
  }
516
1.03k
517
1.03k
  if (LocVT == MVT::i32 ||
518
1.03k
      
LocVT == MVT::f321.03k
) {
519
2
    unsigned Offset20 = State.AllocateStack(4, 4);
520
2
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset20, LocVT, LocInfo));
521
2
    return false;
522
2
  }
523
1.03k
524
1.03k
  if (LocVT == MVT::i64 ||
525
1.03k
      
LocVT == MVT::f640
||
526
1.03k
      
LocVT == MVT::v1f640
||
527
1.03k
      
LocVT == MVT::v2f320
||
528
1.03k
      
LocVT == MVT::v1i640
||
529
1.03k
      
LocVT == MVT::v2i320
||
530
1.03k
      
LocVT == MVT::v4i160
||
531
1.03k
      
LocVT == MVT::v8i80
||
532
1.03k
      
LocVT == MVT::v4f160
) {
533
1.03k
    unsigned Offset21 = State.AllocateStack(8, 8);
534
1.03k
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset21, LocVT, LocInfo));
535
1.03k
    return false;
536
1.03k
  }
537
0
538
0
  if (LocVT == MVT::v2i64 ||
539
0
      LocVT == MVT::v4i32 ||
540
0
      LocVT == MVT::v8i16 ||
541
0
      LocVT == MVT::v16i8 ||
542
0
      LocVT == MVT::v4f32 ||
543
0
      LocVT == MVT::v2f64 ||
544
0
      LocVT == MVT::v8f16) {
545
0
    unsigned Offset22 = State.AllocateStack(16, 16);
546
0
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset22, LocVT, LocInfo));
547
0
    return false;
548
0
  }
549
0
550
0
  return true;  // CC didn't match.
551
0
}
AArch64ISelLowering.cpp:CC_AArch64_DarwinPCS(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)
Line
Count
Source
311
5.00M
                                 ISD::ArgFlagsTy ArgFlags, CCState &State) {
312
5.00M
313
5.00M
  if (LocVT == MVT::iPTR) {
314
0
    LocVT = MVT::i64;
315
0
    LocInfo = CCValAssign::BCvt;
316
0
  }
317
5.00M
318
5.00M
  if (LocVT == MVT::v2f32) {
319
98
    LocVT = MVT::v2i32;
320
98
    LocInfo = CCValAssign::BCvt;
321
98
  }
322
5.00M
323
5.00M
  if (LocVT == MVT::v2f64 ||
324
5.00M
      
LocVT == MVT::v4f325.00M
||
325
5.00M
      
LocVT == MVT::f1285.00M
) {
326
249
    LocVT = MVT::v2i64;
327
249
    LocInfo = CCValAssign::BCvt;
328
249
  }
329
5.00M
330
5.00M
  if (ArgFlags.isSRet()) {
331
10.8k
    if (LocVT == MVT::i64) {
332
10.8k
      if (unsigned Reg = State.AllocateReg(AArch64::X8, AArch64::W8)) {
333
10.8k
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
334
10.8k
        return false;
335
10.8k
      }
336
4.99M
    }
337
10.8k
  }
338
4.99M
339
4.99M
  if (ArgFlags.isByVal()) {
340
0
    State.HandleByVal(ValNo, ValVT, LocVT, LocInfo, 8, 8, ArgFlags);
341
0
    return false;
342
0
  }
343
4.99M
344
4.99M
  if (ArgFlags.isSwiftSelf()) {
345
43
    if (LocVT == MVT::i64) {
346
43
      if (unsigned Reg = State.AllocateReg(AArch64::X20, AArch64::W20)) {
347
43
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
348
43
        return false;
349
43
      }
350
4.99M
    }
351
43
  }
352
4.99M
353
4.99M
  if (ArgFlags.isSwiftError()) {
354
46
    if (LocVT == MVT::i64) {
355
46
      if (unsigned Reg = State.AllocateReg(AArch64::X21, AArch64::W21)) {
356
46
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
357
46
        return false;
358
46
      }
359
4.99M
    }
360
46
  }
361
4.99M
362
4.99M
  if (ArgFlags.isInConsecutiveRegs()) {
363
3.41k
    if (CC_AArch64_Custom_Block(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
364
3.41k
        return false;
365
4.99M
  }
366
4.99M
367
4.99M
  if (LocVT == MVT::i1 ||
368
4.99M
      
LocVT == MVT::i84.99M
||
369
4.99M
      
LocVT == MVT::i164.95M
) {
370
49.7k
    LocVT = MVT::i32;
371
49.7k
    if (ArgFlags.isSExt())
372
8.48k
        LocInfo = CCValAssign::SExt;
373
41.3k
    else if (ArgFlags.isZExt())
374
18.6k
        LocInfo = CCValAssign::ZExt;
375
22.6k
    else
376
22.6k
        LocInfo = CCValAssign::AExt;
377
49.7k
  }
378
4.99M
379
4.99M
  if (LocVT == MVT::i32) {
380
704k
    static const MCPhysReg RegList1[] = {
381
704k
      AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
382
704k
    };
383
704k
    static const MCPhysReg RegList2[] = {
384
704k
      AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
385
704k
    };
386
704k
    if (unsigned Reg = State.AllocateReg(RegList1, RegList2)) {
387
702k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
388
702k
      return false;
389
702k
    }
390
4.29M
  }
391
4.29M
392
4.29M
  if (LocVT == MVT::i64) {
393
4.23M
    if (ArgFlags.isSplit()) {
394
206
      static const MCPhysReg RegList3[] = {
395
206
        AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6
396
206
      };
397
206
      static const MCPhysReg RegList4[] = {
398
206
        AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6
399
206
      };
400
206
      if (unsigned Reg = State.AllocateReg(RegList3, RegList4)) {
401
186
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
402
186
        return false;
403
186
      }
404
4.29M
    }
405
4.23M
  }
406
4.29M
407
4.29M
  if (LocVT == MVT::i64) {
408
4.23M
    if (ArgFlags.isSplit()) {
409
20
      static const MCPhysReg ShadowRegList5[] = {
410
20
        AArch64::X7
411
20
      };
412
20
      unsigned Offset6 = State.AllocateStack(8, 16, ShadowRegList5);
413
20
      State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset6, LocVT, LocInfo));
414
20
      return false;
415
20
    }
416
4.29M
  }
417
4.29M
418
4.29M
  if (LocVT == MVT::i64) {
419
4.23M
    static const MCPhysReg RegList7[] = {
420
4.23M
      AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
421
4.23M
    };
422
4.23M
    static const MCPhysReg RegList8[] = {
423
4.23M
      AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
424
4.23M
    };
425
4.23M
    if (unsigned Reg = State.AllocateReg(RegList7, RegList8)) {
426
4.19M
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
427
4.19M
      return false;
428
4.19M
    }
429
100k
  }
430
100k
431
100k
  if (LocVT == MVT::f16) {
432
14
    static const MCPhysReg RegList9[] = {
433
14
      AArch64::H0, AArch64::H1, AArch64::H2, AArch64::H3, AArch64::H4, AArch64::H5, AArch64::H6, AArch64::H7
434
14
    };
435
14
    static const MCPhysReg RegList10[] = {
436
14
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
437
14
    };
438
14
    if (unsigned Reg = State.AllocateReg(RegList9, RegList10)) {
439
14
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
440
14
      return false;
441
14
    }
442
100k
  }
443
100k
444
100k
  if (LocVT == MVT::f32) {
445
3.08k
    static const MCPhysReg RegList11[] = {
446
3.08k
      AArch64::S0, AArch64::S1, AArch64::S2, AArch64::S3, AArch64::S4, AArch64::S5, AArch64::S6, AArch64::S7
447
3.08k
    };
448
3.08k
    static const MCPhysReg RegList12[] = {
449
3.08k
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
450
3.08k
    };
451
3.08k
    if (unsigned Reg = State.AllocateReg(RegList11, RegList12)) {
452
3.07k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
453
3.07k
      return false;
454
3.07k
    }
455
97.3k
  }
456
97.3k
457
97.3k
  if (LocVT == MVT::f64) {
458
47.6k
    static const MCPhysReg RegList13[] = {
459
47.6k
      AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
460
47.6k
    };
461
47.6k
    static const MCPhysReg RegList14[] = {
462
47.6k
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
463
47.6k
    };
464
47.6k
    if (unsigned Reg = State.AllocateReg(RegList13, RegList14)) {
465
46.7k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
466
46.7k
      return false;
467
46.7k
    }
468
50.6k
  }
469
50.6k
470
50.6k
  if (LocVT == MVT::v1i64 ||
471
50.6k
      
LocVT == MVT::v2i3250.5k
||
472
50.6k
      
LocVT == MVT::v4i1650.3k
||
473
50.6k
      
LocVT == MVT::v8i850.2k
||
474
50.6k
      
LocVT == MVT::v1f6450.1k
||
475
50.6k
      
LocVT == MVT::v2f3250.0k
||
476
50.6k
      
LocVT == MVT::v4f1650.0k
) {
477
540
    static const MCPhysReg RegList15[] = {
478
540
      AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
479
540
    };
480
540
    static const MCPhysReg RegList16[] = {
481
540
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
482
540
    };
483
540
    if (unsigned Reg = State.AllocateReg(RegList15, RegList16)) {
484
536
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
485
536
      return false;
486
536
    }
487
50.0k
  }
488
50.0k
489
50.0k
  if (LocVT == MVT::v2i64 ||
490
50.0k
      
LocVT == MVT::v4i3249.7k
||
491
50.0k
      
LocVT == MVT::v8i1649.5k
||
492
50.0k
      
LocVT == MVT::v16i849.4k
||
493
50.0k
      
LocVT == MVT::v4f3249.3k
||
494
50.0k
      
LocVT == MVT::v2f6449.3k
||
495
50.0k
      
LocVT == MVT::v8f1649.3k
) {
496
712
    static const MCPhysReg RegList17[] = {
497
712
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
498
712
    };
499
712
    if (unsigned Reg = State.AllocateReg(RegList17)) {
500
708
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
501
708
      return false;
502
708
    }
503
49.3k
  }
504
49.3k
505
49.3k
  if (ValVT == MVT::i1 || 
ValVT == MVT::i849.2k
) {
506
197
    unsigned Offset18 = State.AllocateStack(1, 1);
507
197
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset18, LocVT, LocInfo));
508
197
    return false;
509
197
  }
510
49.1k
511
49.1k
  if (ValVT == MVT::i16 || 
ValVT == MVT::f1649.1k
) {
512
31
    unsigned Offset19 = State.AllocateStack(2, 2);
513
31
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset19, LocVT, LocInfo));
514
31
    return false;
515
31
  }
516
49.1k
517
49.1k
  if (LocVT == MVT::i32 ||
518
49.1k
      
LocVT == MVT::f3246.5k
) {
519
2.59k
    unsigned Offset20 = State.AllocateStack(4, 4);
520
2.59k
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset20, LocVT, LocInfo));
521
2.59k
    return false;
522
2.59k
  }
523
46.5k
524
46.5k
  if (LocVT == MVT::i64 ||
525
46.5k
      
LocVT == MVT::f64874
||
526
46.5k
      
LocVT == MVT::v1f648
||
527
46.5k
      
LocVT == MVT::v2f328
||
528
46.5k
      
LocVT == MVT::v1i648
||
529
46.5k
      
LocVT == MVT::v2i328
||
530
46.5k
      
LocVT == MVT::v4i164
||
531
46.5k
      
LocVT == MVT::v8i84
||
532
46.5k
      
LocVT == MVT::v4f164
) {
533
46.5k
    unsigned Offset21 = State.AllocateStack(8, 8);
534
46.5k
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset21, LocVT, LocInfo));
535
46.5k
    return false;
536
46.5k
  }
537
4
538
4
  if (LocVT == MVT::v2i64 ||
539
4
      LocVT == MVT::v4i32 ||
540
4
      
LocVT == MVT::v8i160
||
541
4
      
LocVT == MVT::v16i80
||
542
4
      
LocVT == MVT::v4f320
||
543
4
      
LocVT == MVT::v2f640
||
544
4
      
LocVT == MVT::v8f160
) {
545
4
    unsigned Offset22 = State.AllocateStack(16, 16);
546
4
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset22, LocVT, LocInfo));
547
4
    return false;
548
4
  }
549
0
550
0
  return true;  // CC didn't match.
551
0
}
552
553
554
static bool CC_AArch64_DarwinPCS_VarArg(unsigned ValNo, MVT ValVT,
555
                                        MVT LocVT, CCValAssign::LocInfo LocInfo,
556
81.0k
                                        ISD::ArgFlagsTy ArgFlags, CCState &State) {
557
81.0k
558
81.0k
  if (LocVT == MVT::iPTR) {
559
0
    LocVT = MVT::i64;
560
0
    LocInfo = CCValAssign::BCvt;
561
0
  }
562
81.0k
563
81.0k
  if (LocVT == MVT::v2f32) {
564
0
    LocVT = MVT::v2i32;
565
0
    LocInfo = CCValAssign::BCvt;
566
0
  }
567
81.0k
568
81.0k
  if (LocVT == MVT::v2f64 ||
569
81.0k
      LocVT == MVT::v4f32 ||
570
81.0k
      LocVT == MVT::f128) {
571
0
    LocVT = MVT::v2i64;
572
0
    LocInfo = CCValAssign::BCvt;
573
0
  }
574
81.0k
575
81.0k
  if (ArgFlags.isInConsecutiveRegs()) {
576
17
    if (CC_AArch64_Custom_Stack_Block(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
577
17
        return false;
578
80.9k
  }
579
80.9k
580
80.9k
  if (LocVT == MVT::i8 ||
581
80.9k
      
LocVT == MVT::i1680.9k
||
582
80.9k
      
LocVT == MVT::i3280.9k
) {
583
26.8k
    LocVT = MVT::i64;
584
26.8k
    if (ArgFlags.isSExt())
585
0
        LocInfo = CCValAssign::SExt;
586
26.8k
    else if (ArgFlags.isZExt())
587
0
        LocInfo = CCValAssign::ZExt;
588
26.8k
    else
589
26.8k
        LocInfo = CCValAssign::AExt;
590
26.8k
  }
591
80.9k
592
80.9k
  if (LocVT == MVT::f16 ||
593
80.9k
      LocVT == MVT::f32) {
594
2
    LocVT = MVT::f64;
595
2
    LocInfo = CCValAssign::FPExt;
596
2
  }
597
80.9k
598
80.9k
  if (LocVT == MVT::i64) {
599
73.3k
    if (ArgFlags.isSplit()) {
600
1
      unsigned Offset1 = State.AllocateStack(8, 16);
601
1
      State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset1, LocVT, LocInfo));
602
1
      return false;
603
1
    }
604
80.9k
  }
605
80.9k
606
80.9k
  if (LocVT == MVT::i64 ||
607
80.9k
      
LocVT == MVT::f647.66k
||
608
80.9k
      
LocVT == MVT::v1i641
||
609
80.9k
      
LocVT == MVT::v2i321
||
610
80.9k
      
LocVT == MVT::v4i161
||
611
80.9k
      
LocVT == MVT::v8i81
||
612
80.9k
      
LocVT == MVT::v1f641
||
613
80.9k
      
LocVT == MVT::v2f321
||
614
80.9k
      
LocVT == MVT::v4f161
) {
615
80.9k
    unsigned Offset2 = State.AllocateStack(8, 8);
616
80.9k
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset2, LocVT, LocInfo));
617
80.9k
    return false;
618
80.9k
  }
619
1
620
1
  if (LocVT == MVT::v2i64 ||
621
1
      LocVT == MVT::v4i32 ||
622
1
      
LocVT == MVT::v8i160
||
623
1
      
LocVT == MVT::v16i80
||
624
1
      
LocVT == MVT::v4f320
||
625
1
      
LocVT == MVT::v2f640
||
626
1
      
LocVT == MVT::v8f160
) {
627
1
    unsigned Offset3 = State.AllocateStack(16, 16);
628
1
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset3, LocVT, LocInfo));
629
1
    return false;
630
1
  }
631
0
632
0
  return true;  // CC didn't match.
633
0
}
Unexecuted instantiation: AArch64FastISel.cpp:CC_AArch64_DarwinPCS_VarArg(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)
AArch64ISelLowering.cpp:CC_AArch64_DarwinPCS_VarArg(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)
Line
Count
Source
556
81.0k
                                        ISD::ArgFlagsTy ArgFlags, CCState &State) {
557
81.0k
558
81.0k
  if (LocVT == MVT::iPTR) {
559
0
    LocVT = MVT::i64;
560
0
    LocInfo = CCValAssign::BCvt;
561
0
  }
562
81.0k
563
81.0k
  if (LocVT == MVT::v2f32) {
564
0
    LocVT = MVT::v2i32;
565
0
    LocInfo = CCValAssign::BCvt;
566
0
  }
567
81.0k
568
81.0k
  if (LocVT == MVT::v2f64 ||
569
81.0k
      LocVT == MVT::v4f32 ||
570
81.0k
      LocVT == MVT::f128) {
571
0
    LocVT = MVT::v2i64;
572
0
    LocInfo = CCValAssign::BCvt;
573
0
  }
574
81.0k
575
81.0k
  if (ArgFlags.isInConsecutiveRegs()) {
576
17
    if (CC_AArch64_Custom_Stack_Block(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
577
17
        return false;
578
80.9k
  }
579
80.9k
580
80.9k
  if (LocVT == MVT::i8 ||
581
80.9k
      
LocVT == MVT::i1680.9k
||
582
80.9k
      
LocVT == MVT::i3280.9k
) {
583
26.8k
    LocVT = MVT::i64;
584
26.8k
    if (ArgFlags.isSExt())
585
0
        LocInfo = CCValAssign::SExt;
586
26.8k
    else if (ArgFlags.isZExt())
587
0
        LocInfo = CCValAssign::ZExt;
588
26.8k
    else
589
26.8k
        LocInfo = CCValAssign::AExt;
590
26.8k
  }
591
80.9k
592
80.9k
  if (LocVT == MVT::f16 ||
593
80.9k
      LocVT == MVT::f32) {
594
2
    LocVT = MVT::f64;
595
2
    LocInfo = CCValAssign::FPExt;
596
2
  }
597
80.9k
598
80.9k
  if (LocVT == MVT::i64) {
599
73.3k
    if (ArgFlags.isSplit()) {
600
1
      unsigned Offset1 = State.AllocateStack(8, 16);
601
1
      State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset1, LocVT, LocInfo));
602
1
      return false;
603
1
    }
604
80.9k
  }
605
80.9k
606
80.9k
  if (LocVT == MVT::i64 ||
607
80.9k
      
LocVT == MVT::f647.66k
||
608
80.9k
      
LocVT == MVT::v1i641
||
609
80.9k
      
LocVT == MVT::v2i321
||
610
80.9k
      
LocVT == MVT::v4i161
||
611
80.9k
      
LocVT == MVT::v8i81
||
612
80.9k
      
LocVT == MVT::v1f641
||
613
80.9k
      
LocVT == MVT::v2f321
||
614
80.9k
      
LocVT == MVT::v4f161
) {
615
80.9k
    unsigned Offset2 = State.AllocateStack(8, 8);
616
80.9k
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset2, LocVT, LocInfo));
617
80.9k
    return false;
618
80.9k
  }
619
1
620
1
  if (LocVT == MVT::v2i64 ||
621
1
      LocVT == MVT::v4i32 ||
622
1
      
LocVT == MVT::v8i160
||
623
1
      
LocVT == MVT::v16i80
||
624
1
      
LocVT == MVT::v4f320
||
625
1
      
LocVT == MVT::v2f640
||
626
1
      
LocVT == MVT::v8f160
) {
627
1
    unsigned Offset3 = State.AllocateStack(16, 16);
628
1
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset3, LocVT, LocInfo));
629
1
    return false;
630
1
  }
631
0
632
0
  return true;  // CC didn't match.
633
0
}
634
635
636
static bool CC_AArch64_GHC(unsigned ValNo, MVT ValVT,
637
                           MVT LocVT, CCValAssign::LocInfo LocInfo,
638
8
                           ISD::ArgFlagsTy ArgFlags, CCState &State) {
639
8
640
8
  if (LocVT == MVT::iPTR) {
641
0
    LocVT = MVT::i64;
642
0
    LocInfo = CCValAssign::BCvt;
643
0
  }
644
8
645
8
  if (LocVT == MVT::v1i64 ||
646
8
      LocVT == MVT::v2i32 ||
647
8
      LocVT == MVT::v4i16 ||
648
8
      LocVT == MVT::v8i8 ||
649
8
      LocVT == MVT::v2f32) {
650
0
    LocVT = MVT::f64;
651
0
    LocInfo = CCValAssign::BCvt;
652
0
  }
653
8
654
8
  if (LocVT == MVT::v2i64 ||
655
8
      LocVT == MVT::v4i32 ||
656
8
      LocVT == MVT::v8i16 ||
657
8
      LocVT == MVT::v16i8 ||
658
8
      LocVT == MVT::v4f32 ||
659
8
      LocVT == MVT::f128) {
660
0
    LocVT = MVT::v2f64;
661
0
    LocInfo = CCValAssign::BCvt;
662
0
  }
663
8
664
8
  if (LocVT == MVT::v2f64) {
665
0
    static const MCPhysReg RegList1[] = {
666
0
      AArch64::Q4, AArch64::Q5
667
0
    };
668
0
    if (unsigned Reg = State.AllocateReg(RegList1)) {
669
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
670
0
      return false;
671
0
    }
672
8
  }
673
8
674
8
  if (LocVT == MVT::f32) {
675
2
    static const MCPhysReg RegList2[] = {
676
2
      AArch64::S8, AArch64::S9, AArch64::S10, AArch64::S11
677
2
    };
678
2
    if (unsigned Reg = State.AllocateReg(RegList2)) {
679
2
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
680
2
      return false;
681
2
    }
682
6
  }
683
6
684
6
  if (LocVT == MVT::f64) {
685
1
    static const MCPhysReg RegList3[] = {
686
1
      AArch64::D12, AArch64::D13, AArch64::D14, AArch64::D15
687
1
    };
688
1
    if (unsigned Reg = State.AllocateReg(RegList3)) {
689
1
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
690
1
      return false;
691
1
    }
692
5
  }
693
5
694
5
  if (LocVT == MVT::i8 ||
695
5
      LocVT == MVT::i16 ||
696
5
      LocVT == MVT::i32) {
697
0
    LocVT = MVT::i64;
698
0
    if (ArgFlags.isSExt())
699
0
        LocInfo = CCValAssign::SExt;
700
0
    else if (ArgFlags.isZExt())
701
0
        LocInfo = CCValAssign::ZExt;
702
0
    else
703
0
        LocInfo = CCValAssign::AExt;
704
0
  }
705
5
706
5
  if (LocVT == MVT::i64) {
707
5
    static const MCPhysReg RegList4[] = {
708
5
      AArch64::X19, AArch64::X20, AArch64::X21, AArch64::X22, AArch64::X23, AArch64::X24, AArch64::X25, AArch64::X26, AArch64::X27, AArch64::X28
709
5
    };
710
5
    if (unsigned Reg = State.AllocateReg(RegList4)) {
711
5
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
712
5
      return false;
713
5
    }
714
0
  }
715
0
716
0
  return true;  // CC didn't match.
717
0
}
Unexecuted instantiation: AArch64FastISel.cpp:CC_AArch64_GHC(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)
AArch64ISelLowering.cpp:CC_AArch64_GHC(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)
Line
Count
Source
638
8
                           ISD::ArgFlagsTy ArgFlags, CCState &State) {
639
8
640
8
  if (LocVT == MVT::iPTR) {
641
0
    LocVT = MVT::i64;
642
0
    LocInfo = CCValAssign::BCvt;
643
0
  }
644
8
645
8
  if (LocVT == MVT::v1i64 ||
646
8
      LocVT == MVT::v2i32 ||
647
8
      LocVT == MVT::v4i16 ||
648
8
      LocVT == MVT::v8i8 ||
649
8
      LocVT == MVT::v2f32) {
650
0
    LocVT = MVT::f64;
651
0
    LocInfo = CCValAssign::BCvt;
652
0
  }
653
8
654
8
  if (LocVT == MVT::v2i64 ||
655
8
      LocVT == MVT::v4i32 ||
656
8
      LocVT == MVT::v8i16 ||
657
8
      LocVT == MVT::v16i8 ||
658
8
      LocVT == MVT::v4f32 ||
659
8
      LocVT == MVT::f128) {
660
0
    LocVT = MVT::v2f64;
661
0
    LocInfo = CCValAssign::BCvt;
662
0
  }
663
8
664
8
  if (LocVT == MVT::v2f64) {
665
0
    static const MCPhysReg RegList1[] = {
666
0
      AArch64::Q4, AArch64::Q5
667
0
    };
668
0
    if (unsigned Reg = State.AllocateReg(RegList1)) {
669
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
670
0
      return false;
671
0
    }
672
8
  }
673
8
674
8
  if (LocVT == MVT::f32) {
675
2
    static const MCPhysReg RegList2[] = {
676
2
      AArch64::S8, AArch64::S9, AArch64::S10, AArch64::S11
677
2
    };
678
2
    if (unsigned Reg = State.AllocateReg(RegList2)) {
679
2
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
680
2
      return false;
681
2
    }
682
6
  }
683
6
684
6
  if (LocVT == MVT::f64) {
685
1
    static const MCPhysReg RegList3[] = {
686
1
      AArch64::D12, AArch64::D13, AArch64::D14, AArch64::D15
687
1
    };
688
1
    if (unsigned Reg = State.AllocateReg(RegList3)) {
689
1
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
690
1
      return false;
691
1
    }
692
5
  }
693
5
694
5
  if (LocVT == MVT::i8 ||
695
5
      LocVT == MVT::i16 ||
696
5
      LocVT == MVT::i32) {
697
0
    LocVT = MVT::i64;
698
0
    if (ArgFlags.isSExt())
699
0
        LocInfo = CCValAssign::SExt;
700
0
    else if (ArgFlags.isZExt())
701
0
        LocInfo = CCValAssign::ZExt;
702
0
    else
703
0
        LocInfo = CCValAssign::AExt;
704
0
  }
705
5
706
5
  if (LocVT == MVT::i64) {
707
5
    static const MCPhysReg RegList4[] = {
708
5
      AArch64::X19, AArch64::X20, AArch64::X21, AArch64::X22, AArch64::X23, AArch64::X24, AArch64::X25, AArch64::X26, AArch64::X27, AArch64::X28
709
5
    };
710
5
    if (unsigned Reg = State.AllocateReg(RegList4)) {
711
5
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
712
5
      return false;
713
5
    }
714
0
  }
715
0
716
0
  return true;  // CC didn't match.
717
0
}
718
719
720
static bool CC_AArch64_WebKit_JS(unsigned ValNo, MVT ValVT,
721
                                 MVT LocVT, CCValAssign::LocInfo LocInfo,
722
129
                                 ISD::ArgFlagsTy ArgFlags, CCState &State) {
723
129
724
129
  if (LocVT == MVT::i1 ||
725
129
      LocVT == MVT::i8 ||
726
129
      LocVT == MVT::i16) {
727
6
    LocVT = MVT::i32;
728
6
    if (ArgFlags.isSExt())
729
0
        LocInfo = CCValAssign::SExt;
730
6
    else if (ArgFlags.isZExt())
731
6
        LocInfo = CCValAssign::ZExt;
732
0
    else
733
0
        LocInfo = CCValAssign::AExt;
734
6
  }
735
129
736
129
  if (LocVT == MVT::i32) {
737
27
    if (unsigned Reg = State.AllocateReg(AArch64::W0, AArch64::X0)) {
738
3
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
739
3
      return false;
740
3
    }
741
126
  }
742
126
743
126
  if (LocVT == MVT::i64) {
744
102
    if (unsigned Reg = State.AllocateReg(AArch64::X0, AArch64::W0)) {
745
17
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
746
17
      return false;
747
17
    }
748
109
  }
749
109
750
109
  if (LocVT == MVT::i32 ||
751
109
      
LocVT == MVT::f3285
) {
752
24
    unsigned Offset1 = State.AllocateStack(4, 4);
753
24
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset1, LocVT, LocInfo));
754
24
    return false;
755
24
  }
756
85
757
85
  if (LocVT == MVT::i64 ||
758
85
      
LocVT == MVT::f640
) {
759
85
    unsigned Offset2 = State.AllocateStack(8, 8);
760
85
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset2, LocVT, LocInfo));
761
85
    return false;
762
85
  }
763
0
764
0
  return true;  // CC didn't match.
765
0
}
AArch64FastISel.cpp:CC_AArch64_WebKit_JS(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)
Line
Count
Source
722
23
                                 ISD::ArgFlagsTy ArgFlags, CCState &State) {
723
23
724
23
  if (LocVT == MVT::i1 ||
725
23
      LocVT == MVT::i8 ||
726
23
      LocVT == MVT::i16) {
727
0
    LocVT = MVT::i32;
728
0
    if (ArgFlags.isSExt())
729
0
        LocInfo = CCValAssign::SExt;
730
0
    else if (ArgFlags.isZExt())
731
0
        LocInfo = CCValAssign::ZExt;
732
0
    else
733
0
        LocInfo = CCValAssign::AExt;
734
0
  }
735
23
736
23
  if (LocVT == MVT::i32) {
737
7
    if (unsigned Reg = State.AllocateReg(AArch64::W0, AArch64::X0)) {
738
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
739
0
      return false;
740
0
    }
741
23
  }
742
23
743
23
  if (LocVT == MVT::i64) {
744
16
    if (unsigned Reg = State.AllocateReg(AArch64::X0, AArch64::W0)) {
745
7
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
746
7
      return false;
747
7
    }
748
16
  }
749
16
750
16
  if (LocVT == MVT::i32 ||
751
16
      
LocVT == MVT::f329
) {
752
7
    unsigned Offset1 = State.AllocateStack(4, 4);
753
7
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset1, LocVT, LocInfo));
754
7
    return false;
755
7
  }
756
9
757
9
  if (LocVT == MVT::i64 ||
758
9
      
LocVT == MVT::f640
) {
759
9
    unsigned Offset2 = State.AllocateStack(8, 8);
760
9
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset2, LocVT, LocInfo));
761
9
    return false;
762
9
  }
763
0
764
0
  return true;  // CC didn't match.
765
0
}
AArch64ISelLowering.cpp:CC_AArch64_WebKit_JS(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)
Line
Count
Source
722
106
                                 ISD::ArgFlagsTy ArgFlags, CCState &State) {
723
106
724
106
  if (LocVT == MVT::i1 ||
725
106
      LocVT == MVT::i8 ||
726
106
      LocVT == MVT::i16) {
727
6
    LocVT = MVT::i32;
728
6
    if (ArgFlags.isSExt())
729
0
        LocInfo = CCValAssign::SExt;
730
6
    else if (ArgFlags.isZExt())
731
6
        LocInfo = CCValAssign::ZExt;
732
0
    else
733
0
        LocInfo = CCValAssign::AExt;
734
6
  }
735
106
736
106
  if (LocVT == MVT::i32) {
737
20
    if (unsigned Reg = State.AllocateReg(AArch64::W0, AArch64::X0)) {
738
3
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
739
3
      return false;
740
3
    }
741
103
  }
742
103
743
103
  if (LocVT == MVT::i64) {
744
86
    if (unsigned Reg = State.AllocateReg(AArch64::X0, AArch64::W0)) {
745
10
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
746
10
      return false;
747
10
    }
748
93
  }
749
93
750
93
  if (LocVT == MVT::i32 ||
751
93
      
LocVT == MVT::f3276
) {
752
17
    unsigned Offset1 = State.AllocateStack(4, 4);
753
17
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset1, LocVT, LocInfo));
754
17
    return false;
755
17
  }
756
76
757
76
  if (LocVT == MVT::i64 ||
758
76
      
LocVT == MVT::f640
) {
759
76
    unsigned Offset2 = State.AllocateStack(8, 8);
760
76
    State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset2, LocVT, LocInfo));
761
76
    return false;
762
76
  }
763
0
764
0
  return true;  // CC didn't match.
765
0
}
766
767
768
static bool CC_AArch64_Win64_VarArg(unsigned ValNo, MVT ValVT,
769
                                    MVT LocVT, CCValAssign::LocInfo LocInfo,
770
19
                                    ISD::ArgFlagsTy ArgFlags, CCState &State) {
771
19
772
19
  if (LocVT == MVT::f16 ||
773
19
      LocVT == MVT::f32) {
774
0
    LocVT = MVT::f64;
775
0
    LocInfo = CCValAssign::FPExt;
776
0
  }
777
19
778
19
  if (LocVT == MVT::f64) {
779
10
    LocVT = MVT::i64;
780
10
    LocInfo = CCValAssign::BCvt;
781
10
  }
782
19
783
19
  if (!CC_AArch64_AAPCS(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
784
19
    return false;
785
0
786
0
  return true;  // CC didn't match.
787
0
}
Unexecuted instantiation: AArch64FastISel.cpp:CC_AArch64_Win64_VarArg(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)
AArch64ISelLowering.cpp:CC_AArch64_Win64_VarArg(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)
Line
Count
Source
770
19
                                    ISD::ArgFlagsTy ArgFlags, CCState &State) {
771
19
772
19
  if (LocVT == MVT::f16 ||
773
19
      LocVT == MVT::f32) {
774
0
    LocVT = MVT::f64;
775
0
    LocInfo = CCValAssign::FPExt;
776
0
  }
777
19
778
19
  if (LocVT == MVT::f64) {
779
10
    LocVT = MVT::i64;
780
10
    LocInfo = CCValAssign::BCvt;
781
10
  }
782
19
783
19
  if (!CC_AArch64_AAPCS(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State))
784
19
    return false;
785
0
786
0
  return true;  // CC didn't match.
787
0
}
788
789
790
static bool RetCC_AArch64_AAPCS(unsigned ValNo, MVT ValVT,
791
                                MVT LocVT, CCValAssign::LocInfo LocInfo,
792
1.88M
                                ISD::ArgFlagsTy ArgFlags, CCState &State) {
793
1.88M
794
1.88M
  if (LocVT == MVT::iPTR) {
795
0
    LocVT = MVT::i64;
796
0
    LocInfo = CCValAssign::BCvt;
797
0
  }
798
1.88M
799
1.88M
  if (LocVT == MVT::v2f32) {
800
739
    LocVT = MVT::v2i32;
801
739
    LocInfo = CCValAssign::BCvt;
802
739
  }
803
1.88M
804
1.88M
  if (LocVT == MVT::v2f64 ||
805
1.88M
      
LocVT == MVT::v4f321.88M
) {
806
1.67k
    LocVT = MVT::v2i64;
807
1.67k
    LocInfo = CCValAssign::BCvt;
808
1.67k
  }
809
1.88M
810
1.88M
  if (ArgFlags.isSwiftError()) {
811
54
    if (LocVT == MVT::i64) {
812
54
      if (unsigned Reg = State.AllocateReg(AArch64::X21, AArch64::W21)) {
813
54
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
814
54
        return false;
815
54
      }
816
1.88M
    }
817
54
  }
818
1.88M
819
1.88M
  if (State.getMachineFunction().getDataLayout().isBigEndian()) {
820
1.86k
    if (LocVT == MVT::v2i32 ||
821
1.86k
        
LocVT == MVT::v2f321.74k
||
822
1.86k
        
LocVT == MVT::v4i161.74k
||
823
1.86k
        
LocVT == MVT::v4f161.68k
||
824
1.86k
        
LocVT == MVT::v8i81.68k
) {
825
240
      LocVT = MVT::f64;
826
240
      LocInfo = CCValAssign::BCvt;
827
240
    }
828
1.86k
  }
829
1.88M
830
1.88M
  if (State.getMachineFunction().getDataLayout().isBigEndian()) {
831
1.86k
    if (LocVT == MVT::v2i64 ||
832
1.86k
        
LocVT == MVT::v2f641.68k
||
833
1.86k
        
LocVT == MVT::v4i321.68k
||
834
1.86k
        
LocVT == MVT::v4f321.62k
||
835
1.86k
        
LocVT == MVT::v8i161.62k
||
836
1.86k
        
LocVT == MVT::v8f161.56k
||
837
1.86k
        
LocVT == MVT::v16i81.56k
) {
838
360
      LocVT = MVT::f128;
839
360
      LocInfo = CCValAssign::BCvt;
840
360
    }
841
1.86k
  }
842
1.88M
843
1.88M
  if (LocVT == MVT::i1 ||
844
1.88M
      
LocVT == MVT::i81.86M
||
845
1.88M
      
LocVT == MVT::i161.86M
) {
846
27.6k
    LocVT = MVT::i32;
847
27.6k
    if (ArgFlags.isSExt())
848
1.69k
        LocInfo = CCValAssign::SExt;
849
25.9k
    else if (ArgFlags.isZExt())
850
25.9k
        LocInfo = CCValAssign::ZExt;
851
4
    else
852
4
        LocInfo = CCValAssign::AExt;
853
27.6k
  }
854
1.88M
855
1.88M
  if (LocVT == MVT::i32) {
856
753k
    static const MCPhysReg RegList1[] = {
857
753k
      AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
858
753k
    };
859
753k
    static const MCPhysReg RegList2[] = {
860
753k
      AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
861
753k
    };
862
753k
    if (unsigned Reg = State.AllocateReg(RegList1, RegList2)) {
863
753k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
864
753k
      return false;
865
753k
    }
866
1.13M
  }
867
1.13M
868
1.13M
  if (LocVT == MVT::i64) {
869
1.09M
    static const MCPhysReg RegList3[] = {
870
1.09M
      AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
871
1.09M
    };
872
1.09M
    static const MCPhysReg RegList4[] = {
873
1.09M
      AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
874
1.09M
    };
875
1.09M
    if (unsigned Reg = State.AllocateReg(RegList3, RegList4)) {
876
1.09M
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
877
1.09M
      return false;
878
1.09M
    }
879
37.1k
  }
880
37.1k
881
37.1k
  if (LocVT == MVT::f16) {
882
378
    static const MCPhysReg RegList5[] = {
883
378
      AArch64::H0, AArch64::H1, AArch64::H2, AArch64::H3, AArch64::H4, AArch64::H5, AArch64::H6, AArch64::H7
884
378
    };
885
378
    static const MCPhysReg RegList6[] = {
886
378
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
887
378
    };
888
378
    if (unsigned Reg = State.AllocateReg(RegList5, RegList6)) {
889
378
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
890
378
      return false;
891
378
    }
892
36.7k
  }
893
36.7k
894
36.7k
  if (LocVT == MVT::f32) {
895
10.2k
    static const MCPhysReg RegList7[] = {
896
10.2k
      AArch64::S0, AArch64::S1, AArch64::S2, AArch64::S3, AArch64::S4, AArch64::S5, AArch64::S6, AArch64::S7
897
10.2k
    };
898
10.2k
    static const MCPhysReg RegList8[] = {
899
10.2k
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
900
10.2k
    };
901
10.2k
    if (unsigned Reg = State.AllocateReg(RegList7, RegList8)) {
902
10.2k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
903
10.2k
      return false;
904
10.2k
    }
905
26.5k
  }
906
26.5k
907
26.5k
  if (LocVT == MVT::f64) {
908
12.5k
    static const MCPhysReg RegList9[] = {
909
12.5k
      AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
910
12.5k
    };
911
12.5k
    static const MCPhysReg RegList10[] = {
912
12.5k
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
913
12.5k
    };
914
12.5k
    if (unsigned Reg = State.AllocateReg(RegList9, RegList10)) {
915
12.5k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
916
12.5k
      return false;
917
12.5k
    }
918
14.0k
  }
919
14.0k
920
14.0k
  if (LocVT == MVT::v1i64 ||
921
14.0k
      
LocVT == MVT::v2i3213.5k
||
922
14.0k
      
LocVT == MVT::v4i1611.7k
||
923
14.0k
      
LocVT == MVT::v8i810.4k
||
924
14.0k
      
LocVT == MVT::v1f649.44k
||
925
14.0k
      
LocVT == MVT::v2f329.14k
||
926
14.0k
      
LocVT == MVT::v4f169.14k
) {
927
5.16k
    static const MCPhysReg RegList11[] = {
928
5.16k
      AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
929
5.16k
    };
930
5.16k
    static const MCPhysReg RegList12[] = {
931
5.16k
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
932
5.16k
    };
933
5.16k
    if (unsigned Reg = State.AllocateReg(RegList11, RegList12)) {
934
5.16k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
935
5.16k
      return false;
936
5.16k
    }
937
8.87k
  }
938
8.87k
939
8.87k
  if (LocVT == MVT::f128 ||
940
8.87k
      
LocVT == MVT::v2i648.15k
||
941
8.87k
      
LocVT == MVT::v4i325.11k
||
942
8.87k
      
LocVT == MVT::v8i162.73k
||
943
8.87k
      
LocVT == MVT::v16i81.30k
||
944
8.87k
      
LocVT == MVT::v4f32280
||
945
8.87k
      
LocVT == MVT::v2f64280
||
946
8.87k
      
LocVT == MVT::v8f16280
) {
947
8.86k
    static const MCPhysReg RegList13[] = {
948
8.86k
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
949
8.86k
    };
950
8.86k
    if (unsigned Reg = State.AllocateReg(RegList13)) {
951
8.86k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
952
8.86k
      return false;
953
8.86k
    }
954
12
  }
955
12
956
12
  return true;  // CC didn't match.
957
12
}
AArch64FastISel.cpp:RetCC_AArch64_AAPCS(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)
Line
Count
Source
792
971
                                ISD::ArgFlagsTy ArgFlags, CCState &State) {
793
971
794
971
  if (LocVT == MVT::iPTR) {
795
0
    LocVT = MVT::i64;
796
0
    LocInfo = CCValAssign::BCvt;
797
0
  }
798
971
799
971
  if (LocVT == MVT::v2f32) {
800
9
    LocVT = MVT::v2i32;
801
9
    LocInfo = CCValAssign::BCvt;
802
9
  }
803
971
804
971
  if (LocVT == MVT::v2f64 ||
805
971
      
LocVT == MVT::v4f32961
) {
806
22
    LocVT = MVT::v2i64;
807
22
    LocInfo = CCValAssign::BCvt;
808
22
  }
809
971
810
971
  if (ArgFlags.isSwiftError()) {
811
0
    if (LocVT == MVT::i64) {
812
0
      if (unsigned Reg = State.AllocateReg(AArch64::X21, AArch64::W21)) {
813
0
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
814
0
        return false;
815
0
      }
816
971
    }
817
0
  }
818
971
819
971
  if (State.getMachineFunction().getDataLayout().isBigEndian()) {
820
106
    if (LocVT == MVT::v2i32 ||
821
106
        
LocVT == MVT::v2f3294
||
822
106
        
LocVT == MVT::v4i1694
||
823
106
        
LocVT == MVT::v4f1688
||
824
106
        
LocVT == MVT::v8i888
) {
825
24
      LocVT = MVT::f64;
826
24
      LocInfo = CCValAssign::BCvt;
827
24
    }
828
106
  }
829
971
830
971
  if (State.getMachineFunction().getDataLayout().isBigEndian()) {
831
106
    if (LocVT == MVT::v2i64 ||
832
106
        
LocVT == MVT::v2f6488
||
833
106
        
LocVT == MVT::v4i3288
||
834
106
        
LocVT == MVT::v4f3282
||
835
106
        
LocVT == MVT::v8i1682
||
836
106
        
LocVT == MVT::v8f1676
||
837
106
        
LocVT == MVT::v16i876
) {
838
36
      LocVT = MVT::f128;
839
36
      LocInfo = CCValAssign::BCvt;
840
36
    }
841
106
  }
842
971
843
971
  if (LocVT == MVT::i1 ||
844
971
      LocVT == MVT::i8 ||
845
971
      LocVT == MVT::i16) {
846
0
    LocVT = MVT::i32;
847
0
    if (ArgFlags.isSExt())
848
0
        LocInfo = CCValAssign::SExt;
849
0
    else if (ArgFlags.isZExt())
850
0
        LocInfo = CCValAssign::ZExt;
851
0
    else
852
0
        LocInfo = CCValAssign::AExt;
853
0
  }
854
971
855
971
  if (LocVT == MVT::i32) {
856
539
    static const MCPhysReg RegList1[] = {
857
539
      AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
858
539
    };
859
539
    static const MCPhysReg RegList2[] = {
860
539
      AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
861
539
    };
862
539
    if (unsigned Reg = State.AllocateReg(RegList1, RegList2)) {
863
539
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
864
539
      return false;
865
539
    }
866
432
  }
867
432
868
432
  if (LocVT == MVT::i64) {
869
208
    static const MCPhysReg RegList3[] = {
870
208
      AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
871
208
    };
872
208
    static const MCPhysReg RegList4[] = {
873
208
      AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
874
208
    };
875
208
    if (unsigned Reg = State.AllocateReg(RegList3, RegList4)) {
876
208
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
877
208
      return false;
878
208
    }
879
224
  }
880
224
881
224
  if (LocVT == MVT::f16) {
882
14
    static const MCPhysReg RegList5[] = {
883
14
      AArch64::H0, AArch64::H1, AArch64::H2, AArch64::H3, AArch64::H4, AArch64::H5, AArch64::H6, AArch64::H7
884
14
    };
885
14
    static const MCPhysReg RegList6[] = {
886
14
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
887
14
    };
888
14
    if (unsigned Reg = State.AllocateReg(RegList5, RegList6)) {
889
14
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
890
14
      return false;
891
14
    }
892
210
  }
893
210
894
210
  if (LocVT == MVT::f32) {
895
64
    static const MCPhysReg RegList7[] = {
896
64
      AArch64::S0, AArch64::S1, AArch64::S2, AArch64::S3, AArch64::S4, AArch64::S5, AArch64::S6, AArch64::S7
897
64
    };
898
64
    static const MCPhysReg RegList8[] = {
899
64
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
900
64
    };
901
64
    if (unsigned Reg = State.AllocateReg(RegList7, RegList8)) {
902
64
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
903
64
      return false;
904
64
    }
905
146
  }
906
146
907
146
  if (LocVT == MVT::f64) {
908
66
    static const MCPhysReg RegList9[] = {
909
66
      AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
910
66
    };
911
66
    static const MCPhysReg RegList10[] = {
912
66
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
913
66
    };
914
66
    if (unsigned Reg = State.AllocateReg(RegList9, RegList10)) {
915
66
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
916
66
      return false;
917
66
    }
918
80
  }
919
80
920
80
  if (LocVT == MVT::v1i64 ||
921
80
      
LocVT == MVT::v2i3274
||
922
80
      
LocVT == MVT::v4i1667
||
923
80
      
LocVT == MVT::v8i866
||
924
80
      
LocVT == MVT::v1f6464
||
925
80
      
LocVT == MVT::v2f3264
||
926
80
      
LocVT == MVT::v4f1664
) {
927
16
    static const MCPhysReg RegList11[] = {
928
16
      AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
929
16
    };
930
16
    static const MCPhysReg RegList12[] = {
931
16
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
932
16
    };
933
16
    if (unsigned Reg = State.AllocateReg(RegList11, RegList12)) {
934
16
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
935
16
      return false;
936
16
    }
937
64
  }
938
64
939
64
  if (LocVT == MVT::f128 ||
940
64
      
LocVT == MVT::v2i6420
||
941
64
      
LocVT == MVT::v4i328
||
942
64
      
LocVT == MVT::v8i165
||
943
64
      
LocVT == MVT::v16i84
||
944
64
      
LocVT == MVT::v4f320
||
945
64
      
LocVT == MVT::v2f640
||
946
64
      
LocVT == MVT::v8f160
) {
947
64
    static const MCPhysReg RegList13[] = {
948
64
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
949
64
    };
950
64
    if (unsigned Reg = State.AllocateReg(RegList13)) {
951
64
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
952
64
      return false;
953
64
    }
954
0
  }
955
0
956
0
  return true;  // CC didn't match.
957
0
}
AArch64ISelLowering.cpp:RetCC_AArch64_AAPCS(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)
Line
Count
Source
792
1.88M
                                ISD::ArgFlagsTy ArgFlags, CCState &State) {
793
1.88M
794
1.88M
  if (LocVT == MVT::iPTR) {
795
0
    LocVT = MVT::i64;
796
0
    LocInfo = CCValAssign::BCvt;
797
0
  }
798
1.88M
799
1.88M
  if (LocVT == MVT::v2f32) {
800
730
    LocVT = MVT::v2i32;
801
730
    LocInfo = CCValAssign::BCvt;
802
730
  }
803
1.88M
804
1.88M
  if (LocVT == MVT::v2f64 ||
805
1.88M
      
LocVT == MVT::v4f321.88M
) {
806
1.65k
    LocVT = MVT::v2i64;
807
1.65k
    LocInfo = CCValAssign::BCvt;
808
1.65k
  }
809
1.88M
810
1.88M
  if (ArgFlags.isSwiftError()) {
811
54
    if (LocVT == MVT::i64) {
812
54
      if (unsigned Reg = State.AllocateReg(AArch64::X21, AArch64::W21)) {
813
54
        State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
814
54
        return false;
815
54
      }
816
1.88M
    }
817
54
  }
818
1.88M
819
1.88M
  if (State.getMachineFunction().getDataLayout().isBigEndian()) {
820
1.76k
    if (LocVT == MVT::v2i32 ||
821
1.76k
        
LocVT == MVT::v2f321.65k
||
822
1.76k
        
LocVT == MVT::v4i161.65k
||
823
1.76k
        
LocVT == MVT::v4f161.60k
||
824
1.76k
        
LocVT == MVT::v8i81.60k
) {
825
216
      LocVT = MVT::f64;
826
216
      LocInfo = CCValAssign::BCvt;
827
216
    }
828
1.76k
  }
829
1.88M
830
1.88M
  if (State.getMachineFunction().getDataLayout().isBigEndian()) {
831
1.76k
    if (LocVT == MVT::v2i64 ||
832
1.76k
        
LocVT == MVT::v2f641.60k
||
833
1.76k
        
LocVT == MVT::v4i321.60k
||
834
1.76k
        
LocVT == MVT::v4f321.54k
||
835
1.76k
        
LocVT == MVT::v8i161.54k
||
836
1.76k
        
LocVT == MVT::v8f161.49k
||
837
1.76k
        
LocVT == MVT::v16i81.49k
) {
838
324
      LocVT = MVT::f128;
839
324
      LocInfo = CCValAssign::BCvt;
840
324
    }
841
1.76k
  }
842
1.88M
843
1.88M
  if (LocVT == MVT::i1 ||
844
1.88M
      
LocVT == MVT::i81.86M
||
845
1.88M
      
LocVT == MVT::i161.85M
) {
846
27.6k
    LocVT = MVT::i32;
847
27.6k
    if (ArgFlags.isSExt())
848
1.69k
        LocInfo = CCValAssign::SExt;
849
25.9k
    else if (ArgFlags.isZExt())
850
25.9k
        LocInfo = CCValAssign::ZExt;
851
4
    else
852
4
        LocInfo = CCValAssign::AExt;
853
27.6k
  }
854
1.88M
855
1.88M
  if (LocVT == MVT::i32) {
856
753k
    static const MCPhysReg RegList1[] = {
857
753k
      AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
858
753k
    };
859
753k
    static const MCPhysReg RegList2[] = {
860
753k
      AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
861
753k
    };
862
753k
    if (unsigned Reg = State.AllocateReg(RegList1, RegList2)) {
863
753k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
864
753k
      return false;
865
753k
    }
866
1.13M
  }
867
1.13M
868
1.13M
  if (LocVT == MVT::i64) {
869
1.09M
    static const MCPhysReg RegList3[] = {
870
1.09M
      AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
871
1.09M
    };
872
1.09M
    static const MCPhysReg RegList4[] = {
873
1.09M
      AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
874
1.09M
    };
875
1.09M
    if (unsigned Reg = State.AllocateReg(RegList3, RegList4)) {
876
1.09M
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
877
1.09M
      return false;
878
1.09M
    }
879
36.9k
  }
880
36.9k
881
36.9k
  if (LocVT == MVT::f16) {
882
364
    static const MCPhysReg RegList5[] = {
883
364
      AArch64::H0, AArch64::H1, AArch64::H2, AArch64::H3, AArch64::H4, AArch64::H5, AArch64::H6, AArch64::H7
884
364
    };
885
364
    static const MCPhysReg RegList6[] = {
886
364
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
887
364
    };
888
364
    if (unsigned Reg = State.AllocateReg(RegList5, RegList6)) {
889
364
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
890
364
      return false;
891
364
    }
892
36.5k
  }
893
36.5k
894
36.5k
  if (LocVT == MVT::f32) {
895
10.1k
    static const MCPhysReg RegList7[] = {
896
10.1k
      AArch64::S0, AArch64::S1, AArch64::S2, AArch64::S3, AArch64::S4, AArch64::S5, AArch64::S6, AArch64::S7
897
10.1k
    };
898
10.1k
    static const MCPhysReg RegList8[] = {
899
10.1k
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
900
10.1k
    };
901
10.1k
    if (unsigned Reg = State.AllocateReg(RegList7, RegList8)) {
902
10.1k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
903
10.1k
      return false;
904
10.1k
    }
905
26.3k
  }
906
26.3k
907
26.3k
  if (LocVT == MVT::f64) {
908
12.4k
    static const MCPhysReg RegList9[] = {
909
12.4k
      AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
910
12.4k
    };
911
12.4k
    static const MCPhysReg RegList10[] = {
912
12.4k
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
913
12.4k
    };
914
12.4k
    if (unsigned Reg = State.AllocateReg(RegList9, RegList10)) {
915
12.4k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
916
12.4k
      return false;
917
12.4k
    }
918
13.9k
  }
919
13.9k
920
13.9k
  if (LocVT == MVT::v1i64 ||
921
13.9k
      
LocVT == MVT::v2i3213.4k
||
922
13.9k
      
LocVT == MVT::v4i1611.6k
||
923
13.9k
      
LocVT == MVT::v8i810.4k
||
924
13.9k
      
LocVT == MVT::v1f649.37k
||
925
13.9k
      
LocVT == MVT::v2f329.08k
||
926
13.9k
      
LocVT == MVT::v4f169.08k
) {
927
5.14k
    static const MCPhysReg RegList11[] = {
928
5.14k
      AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
929
5.14k
    };
930
5.14k
    static const MCPhysReg RegList12[] = {
931
5.14k
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
932
5.14k
    };
933
5.14k
    if (unsigned Reg = State.AllocateReg(RegList11, RegList12)) {
934
5.14k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
935
5.14k
      return false;
936
5.14k
    }
937
8.81k
  }
938
8.81k
939
8.81k
  if (LocVT == MVT::f128 ||
940
8.81k
      
LocVT == MVT::v2i648.13k
||
941
8.81k
      
LocVT == MVT::v4i325.10k
||
942
8.81k
      
LocVT == MVT::v8i162.73k
||
943
8.81k
      
LocVT == MVT::v16i81.30k
||
944
8.81k
      
LocVT == MVT::v4f32280
||
945
8.81k
      
LocVT == MVT::v2f64280
||
946
8.81k
      
LocVT == MVT::v8f16280
) {
947
8.80k
    static const MCPhysReg RegList13[] = {
948
8.80k
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
949
8.80k
    };
950
8.80k
    if (unsigned Reg = State.AllocateReg(RegList13)) {
951
8.80k
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
952
8.80k
      return false;
953
8.80k
    }
954
12
  }
955
12
956
12
  return true;  // CC didn't match.
957
12
}
958
959
960
static bool RetCC_AArch64_WebKit_JS(unsigned ValNo, MVT ValVT,
961
                                    MVT LocVT, CCValAssign::LocInfo LocInfo,
962
21
                                    ISD::ArgFlagsTy ArgFlags, CCState &State) {
963
21
964
21
  if (LocVT == MVT::i32) {
965
6
    static const MCPhysReg RegList1[] = {
966
6
      AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
967
6
    };
968
6
    static const MCPhysReg RegList2[] = {
969
6
      AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
970
6
    };
971
6
    if (unsigned Reg = State.AllocateReg(RegList1, RegList2)) {
972
6
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
973
6
      return false;
974
6
    }
975
15
  }
976
15
977
15
  if (LocVT == MVT::i64) {
978
15
    static const MCPhysReg RegList3[] = {
979
15
      AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
980
15
    };
981
15
    static const MCPhysReg RegList4[] = {
982
15
      AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
983
15
    };
984
15
    if (unsigned Reg = State.AllocateReg(RegList3, RegList4)) {
985
15
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
986
15
      return false;
987
15
    }
988
0
  }
989
0
990
0
  if (LocVT == MVT::f32) {
991
0
    static const MCPhysReg RegList5[] = {
992
0
      AArch64::S0, AArch64::S1, AArch64::S2, AArch64::S3, AArch64::S4, AArch64::S5, AArch64::S6, AArch64::S7
993
0
    };
994
0
    static const MCPhysReg RegList6[] = {
995
0
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
996
0
    };
997
0
    if (unsigned Reg = State.AllocateReg(RegList5, RegList6)) {
998
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
999
0
      return false;
1000
0
    }
1001
0
  }
1002
0
1003
0
  if (LocVT == MVT::f64) {
1004
0
    static const MCPhysReg RegList7[] = {
1005
0
      AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
1006
0
    };
1007
0
    static const MCPhysReg RegList8[] = {
1008
0
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
1009
0
    };
1010
0
    if (unsigned Reg = State.AllocateReg(RegList7, RegList8)) {
1011
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
1012
0
      return false;
1013
0
    }
1014
0
  }
1015
0
1016
0
  return true;  // CC didn't match.
1017
0
}
AArch64FastISel.cpp:RetCC_AArch64_WebKit_JS(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)
Line
Count
Source
962
1
                                    ISD::ArgFlagsTy ArgFlags, CCState &State) {
963
1
964
1
  if (LocVT == MVT::i32) {
965
1
    static const MCPhysReg RegList1[] = {
966
1
      AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
967
1
    };
968
1
    static const MCPhysReg RegList2[] = {
969
1
      AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
970
1
    };
971
1
    if (unsigned Reg = State.AllocateReg(RegList1, RegList2)) {
972
1
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
973
1
      return false;
974
1
    }
975
0
  }
976
0
977
0
  if (LocVT == MVT::i64) {
978
0
    static const MCPhysReg RegList3[] = {
979
0
      AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
980
0
    };
981
0
    static const MCPhysReg RegList4[] = {
982
0
      AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
983
0
    };
984
0
    if (unsigned Reg = State.AllocateReg(RegList3, RegList4)) {
985
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
986
0
      return false;
987
0
    }
988
0
  }
989
0
990
0
  if (LocVT == MVT::f32) {
991
0
    static const MCPhysReg RegList5[] = {
992
0
      AArch64::S0, AArch64::S1, AArch64::S2, AArch64::S3, AArch64::S4, AArch64::S5, AArch64::S6, AArch64::S7
993
0
    };
994
0
    static const MCPhysReg RegList6[] = {
995
0
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
996
0
    };
997
0
    if (unsigned Reg = State.AllocateReg(RegList5, RegList6)) {
998
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
999
0
      return false;
1000
0
    }
1001
0
  }
1002
0
1003
0
  if (LocVT == MVT::f64) {
1004
0
    static const MCPhysReg RegList7[] = {
1005
0
      AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
1006
0
    };
1007
0
    static const MCPhysReg RegList8[] = {
1008
0
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
1009
0
    };
1010
0
    if (unsigned Reg = State.AllocateReg(RegList7, RegList8)) {
1011
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
1012
0
      return false;
1013
0
    }
1014
0
  }
1015
0
1016
0
  return true;  // CC didn't match.
1017
0
}
AArch64ISelLowering.cpp:RetCC_AArch64_WebKit_JS(unsigned int, llvm::MVT, llvm::MVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)
Line
Count
Source
962
20
                                    ISD::ArgFlagsTy ArgFlags, CCState &State) {
963
20
964
20
  if (LocVT == MVT::i32) {
965
5
    static const MCPhysReg RegList1[] = {
966
5
      AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
967
5
    };
968
5
    static const MCPhysReg RegList2[] = {
969
5
      AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
970
5
    };
971
5
    if (unsigned Reg = State.AllocateReg(RegList1, RegList2)) {
972
5
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
973
5
      return false;
974
5
    }
975
15
  }
976
15
977
15
  if (LocVT == MVT::i64) {
978
15
    static const MCPhysReg RegList3[] = {
979
15
      AArch64::X0, AArch64::X1, AArch64::X2, AArch64::X3, AArch64::X4, AArch64::X5, AArch64::X6, AArch64::X7
980
15
    };
981
15
    static const MCPhysReg RegList4[] = {
982
15
      AArch64::W0, AArch64::W1, AArch64::W2, AArch64::W3, AArch64::W4, AArch64::W5, AArch64::W6, AArch64::W7
983
15
    };
984
15
    if (unsigned Reg = State.AllocateReg(RegList3, RegList4)) {
985
15
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
986
15
      return false;
987
15
    }
988
0
  }
989
0
990
0
  if (LocVT == MVT::f32) {
991
0
    static const MCPhysReg RegList5[] = {
992
0
      AArch64::S0, AArch64::S1, AArch64::S2, AArch64::S3, AArch64::S4, AArch64::S5, AArch64::S6, AArch64::S7
993
0
    };
994
0
    static const MCPhysReg RegList6[] = {
995
0
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
996
0
    };
997
0
    if (unsigned Reg = State.AllocateReg(RegList5, RegList6)) {
998
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
999
0
      return false;
1000
0
    }
1001
0
  }
1002
0
1003
0
  if (LocVT == MVT::f64) {
1004
0
    static const MCPhysReg RegList7[] = {
1005
0
      AArch64::D0, AArch64::D1, AArch64::D2, AArch64::D3, AArch64::D4, AArch64::D5, AArch64::D6, AArch64::D7
1006
0
    };
1007
0
    static const MCPhysReg RegList8[] = {
1008
0
      AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3, AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7
1009
0
    };
1010
0
    if (unsigned Reg = State.AllocateReg(RegList7, RegList8)) {
1011
0
      State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
1012
0
      return false;
1013
0
    }
1014
0
  }
1015
0
1016
0
  return true;  // CC didn't match.
1017
0
}